-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feature: Snippet completions #1705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
More comments from @matklad on zulip I can't give a super-thorogh mentoring instructions right now, but (besides dec docs in the repo) what you want to look at are: |
Hello, I'm a maintainer of a client that doesn't support snippets. Currently rust-analyzer doesn't work because it always returns snippets on completion. I wanted to try Sending |
@bstaletic at the moment, rust-analyzer doesn't support non-snippet based completion. Strictly speaking, this is a violation of the LSP protocol, which requires to consult the corresponding client capability before sending completion. However, at the moment we deliberately target "the latest" version of the protocol (more discussion here). I've opened #2518 to add proper support here. What I think the problem is that you need to nest |
I guess no one wants to implement this yet; I'll bite the bullet and attempt to implement this as my first issue, anything I should know? |
I believe #1705 (comment) still lists the most relevant things. |
I see, thank you. |
3432: Feature/snippet completions r=matklad a=iTZAvishay This PR implements #1705 and is based on #3430 to avoid future conflicts. The completions are placing default values with the names of the parameters, demo:  Co-authored-by: Avishay Matayev <[email protected]>
Having #3432 merged, what is left to fully support snippets? |
Hmm I beleive RLS supports a |
Yeah, I belive the original issue is fixed. For code snippets, which is a different feature from completion, my general stance is that they are often (but not always) a work-around for a missing feature in and IDE. For derive specifically, see #4015 |
currently, rls supports presenting completions for associated functions as snippets where you can jump through the various args.
rust-analyzer does not yet have this feature. Instead it will insert a pair of parens, and place the cursor between them if the function has 1 or more args, and after if the function has no args.
We should add support for snippets and do our best to at least support all the features that rls does with snippets and function completions.
The text was updated successfully, but these errors were encountered: