Use snippets.nvim to handle LSP snippets#172
Use snippets.nvim to handle LSP snippets#172haorenW1025 merged 2 commits intonvim-lua:masterfrom runiq:snippets.nvim+completion-nvim
Conversation
|
Sorry for the noise, I forgot I already opened a PR for this branch and kept pushing WIP stuff to it. :( I have converted this to a draft PR for now. |
|
@runiq Would it make sense to wrap the LSP snippets in a |
|
I would have expected the LSP to handle that itself – can you give me an example where the inserted snippet results in wrong indentation? |
|
I would not have expected that ;) If you say that this already works out of the box, all the better! |
|
@clason @mfussenegger, regarding this: Actually, now that I reread the spec, I believe it might be prudent to add a Thoughts? |
|
I think VSCode does indentation in both cases. VSCode always applies accepting completion as a snippet. (If the item is not |
|
I haven't looked super closely at this, but I think it might make sense to instead have a PR that allows for "subscribing" to the completion items or something similar, and then you could have a separate plugin ( Does that seem reasonable? I could maybe do that at some point if @haorenW1025 is too busy these days. |
I'm not sure. In my use-case it's eclipse.jdt.ls which uses |
|
I think What do you think @runiq ? |
|
Sure, will do. Edit: I'll leave this PR as the "LSP integration" PR since all the discussion on that is in this PR anyways; the other one will be the "Support snippets.nvim's own snippets" PR. |
|
@tjdevries The non-LSP stuff is now in #180. |
|
Sorry for the long wait and thanks @runiq for this PR and others for keeping the discussion going. I'm quite busy for the past several weeks but I'm getting back into |
|
Glad to have you back :) Yes, exactly, only LSP handling. I think it's ready for review, at least. |
|
I've tested it and it seems good for me. However I kind of like the LSP snippets to work "out of the box" instead of setting |
I agree that the correct approach would be to automatically enable snippets (and set the corresponding client capability) if a supported snippet plugin is detected. |

I think snippets.nvim supports pretty much all of the LSP snippets syntax.