Skip to content
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

Support for LSP Snippets #96

Closed
nathanblair opened this issue Jan 14, 2019 · 4 comments
Closed

Support for LSP Snippets #96

nathanblair opened this issue Jan 14, 2019 · 4 comments

Comments

@nathanblair
Copy link

There are a couple issues floating around GitHub for the different LSP clients for vim/nvim, their completion engines, and various snippet integration engines.

An issue does not seem to be filed with asyncomplete.vim yet for this support (correct me and close this if I'm wrong!) so I wanted to start that thread.

For any that are unaware, it appears that clangd broadcasts support for c++ snippets and those broadcasts appropriately show up in the omni popup menu.

I can navigate through those "completion" options that are sourced as "snippets" from clangd, but I can't invoke the snippet.

Now, maybe this isn't a job for the completion engine? Should this fall onto a snippet engine instead? If that's the case, I feel it may be time to write a vim-lsp-snippet project for that very reason, as LSP snippets (I don't think) don't belong in the hands of something like UltiSnips/neosnippet/etc. Or at least, if they do, this vim-lsp/asyncomplete.vim/etc. toolset would be best not to rely on them for fear of "getting more than you bargained for". But I am not familiar with snippet engines in general so I could be very wrong about this.

Nonetheless, there's my two cents. Is expanding LSP snippets something the asyncomplete project feels it should handle? Should that fall into the hands of something like UltiSnips? Should another tool for this vim-lsp chain be added explicitly for LSP snippet expansion?

P.S. I apologize for this being mildly incoherent. I'm up way past my bedtime and far too tired to be very coherent ATM 😆

@prabirshrestha
Copy link
Owner

By default vim-lsp never exposes snippet support as client capabilities so servers shouldn't be sending it.

Snippets is quite a big project so I don't see it happening anytime soon in asyncomplete or vim-lsp since I'm still working on making those awesome 😄 .

I think it is still easy to make a patch to make it easily work with neosnippet using user_data https://github.com/Shougo/neosnippet.vim/blob/f7755084699db69ce9ff51c87baf8e639b7e543a/autoload/neosnippet/mappings.vim#L166-L175.

Utils snips also supports similar syntax so it should be possible.

@nathanblair
Copy link
Author

nathanblair commented Jan 14, 2019

I totally understand. Your work has been nothing short of fantastic and I'll be keeping a close eye on its progression.

I did find neoclide/coc.nvim

It looks like it has LSP snippet support. I haven't had the chance to download and build it yet to test it but I'll report on how successful I was.

Thanks for the reply though. Consider this issue resolved, unless you consider it worth it to keep around as a TODO of implementing LSP Snippet support?

@prabirshrestha
Copy link
Owner

WIP but you can see some initial PR at prabirshrestha/vim-lsp#247

@prabirshrestha
Copy link
Owner

Please give prabirshrestha/vim-lsp#306 a try and let us know if it satisfies your need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants