Open Cyrik opened 2 years ago
I think it would be good if you did this when you find some time, @Cyrik. Rationale is that it is good that more people know stuff about how the integration to lsp works. And you in particular, since you are looking at many different aspects Calva.
We could do it together, of course. I happen to have some time tomorrow during CET work hours. Don't know how that suits you.
The place to look (for whoever is interested) is in lsp/main.ts
.
Puh found it, only took me forever! Turns out that for some reason vscode really likes getting the snippet info twice.
textDocument/completion
already returns the snippets and provides the snippet part in insertText
. Once you select the completion vscode sends completionItem/resolve
to the server to get the info again and this time LSP doesn't provide the snippet part. We could fix this in Calva, but that would be more complicated and would move us away from a default implementation.
@ericdallo Could you provide the full CompletionItem in the completionResolve response? I can create an issue if you want or try to build a PR.
Yes @Cyrik, this probably should be solved on clojure-lsp side, we should return the completion item receive with extra info that we should add, not remove anything. Please open an issue on clojure-lsp side and feel free to give a try on the PR if you want, LMK if any questions
clojure-lsp already has snippet support, but they aren't showing up in Calva. The code for them is here. Apparently, Calva still has to register those per the docs
I haven't looked at the Calva -> LSP integration yet, so someone else would probably get this done faster.