-
Notifications
You must be signed in to change notification settings - Fork 112
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
Snippet support #678
Comments
What you've linked are snippets built into VSCode, while language servers are extensions. Unless the snippets are actually emitted as regular completion items by a language server, they would not exist in kak-lsp. |
I see. So what exactly are the snippets alluded to in kak-lsp's documentation then? It's a little unclear to me what functionality kak-lsp's snippet capabilites are supposed to provide, if not the type of completions referred to in vscode's docs. |
yeah snippets are supported (see 22b0602 for how they usually work) but we don't have VSCode's extra user-defined snippets. They need to come from the language server. With rust-analyzer there are lots of snippets. user-defined snippets could go into a dedicated snippets plugin |
I see. So I guess then that the typescript language server just doesn't ship with a lot of snippets (as I don't think I've encountered any so far).
So you mean a plugin like https://github.com/occivink/kakoune-snippets for example? I'm assuming there's no way to supply user defined snippets that would somehow be picked up by kak-lsp (or the underlying language servers) right, you'd have to just use a separate plugin? |
Ideally the the language server supplies snippets, then it works for all editors. it's possible to add a new completer option that works like lsp_completions. |
Ok cool. Yeah then I'll just add snippets through the kakoune-snippets plugin. That sounds like the most ergonomic solution. Thanks for explaining! |
I have been looking into kak-lsp's snippet support. From the docs it seems like there should be support for snippets: https://github.com/kak-lsp/kak-lsp#snippets. In my configuration I've enabled snippet support with
snippet_support = true
.Now I've tested this with the typescript language server in a javascript file. The ts language server is working as expected. I would expect common patterns like a for loop to be completed as a snippet, as can be seen in the vscode docs here for example: https://code.visualstudio.com/docs/editor/userdefinedsnippets#_builtin-snippets. But that does not work with kak-lsp out of the box, all that happens is that the language server in kakoune suggests completing the
for
keyword.The documentation on kak-lsp's snippet support is a little sparse. Should there be autocompletion via snippets for common language features like a for loop, a switch, etcetera? Does the user need to install these snippets themselves?
The text was updated successfully, but these errors were encountered: