Open suo opened 6 years ago
Maybe, I'm not sure it's worth it. I use https://github.com/garbas/vim-snipmate
and there are a few other similar Vim snippet plugins. I think snippets are better written in Vim, because then you can control where the cursor lands in multiple places, and you can evaluate Vim expressions. One area where an LSP snippet might be better is for overriding a method defined in a superclass or something, though I think filling in methods might work better as a "quick fix" action.
I would just like to note that I think the LSP snippets are a different use-case from a typical snippets plugin.
(at least with coc.vim
plugin) LSP automatically generates a custom "snippet" for ALL functions, so when you trigger the completion of the function name, you get a snippet with the arguments -- including multiple cursor spots as you say. It is like completion, but turbocharged (you can cycle through the function arguments easily, like a snippet!).
I use a snippet plugin also, but for a different use-case (the kind you write yourself to save typing).
Personally I think ALE should support the LSP provided snippets, and consider it an "improved completion experience" ("snippets" is confusing, although the completion flow is the same).
@w0rp
Here is an example of the flow from coc.vim
:
https://user-images.githubusercontent.com/251450/52922829-23614e00-335f-11e9-8d33-3dae30ea4a9a.gif
Okay, someone else can implement this.
Correct me if I'm wrong, but with neosnippet.vim
active it should already work; at least with texlab
I can just use
The Language Server Protocol supports snippets for function arguments (among other things). Is there any plan to add support for this to the LSP completion in ALE?