0

I am developing a free software code coverage tool that leverages LSP. I do not want to reinvent the wheel in order to specify and launch a particular language server. What seems to make sense is to use VSCode to obtain the LS extension from the marketplace which will establish an entry in ~/.vscode/extensions. Once I have the extension on my computer I would use it to launch the LS much as VSCode does.

So now I need to grok this extension format to develop a launcher inside my tool. I am looking for specs, examples, tutorials, code or other material that will help, especially from other developers who have done this already.

I am already quite familiar with the LSP spec and some Microsoft VSCode sites and articles, fwiw.

Perhaps a link to the VSCode source where it leverages an extension to launch a language server would be helpful.

pajato0
  • 3,628
  • 3
  • 31
  • 37
  • The acquisition of the language server executable is done by each language extensions, not VSCode. It varies quite a lot, so I don't think there is a standard way. – Lex Li May 04 '21 at 16:34
  • @Lex Li, thanks for responding. Yes, I understand that the extension is the key, not VSCode. VSCode is simply a means to access the key. Once I have the key, I need to know how to use it in the same way that VSCode does (to launch a LS) but apart from VSCode (in the tool I am developing). If you know how to help me in doing that, I will be grateful to you forever. :-) – pajato0 May 04 '21 at 17:42
  • Each extensions initialize its own `LanguageClient` instance (like [this](https://github.com/vscode-restructuredtext/vscode-restructuredtext/blob/master/src/language-server/extension.ts#L94)) and then register to VSCode. The whole process is private to that extension, so you won't be able to know any detail from outside. Thus, I don't think what you wished can be done. – Lex Li May 04 '21 at 19:06
  • @Lex Li, you could well be correct in which case that is valuable information, so thanks for that. – pajato0 May 05 '21 at 03:37
  • 1
    BTW, you might want to discuss with VSCode team via GitHub https://github.com/microsoft/vscode/issues so that they might determine if in the future to expose the necessary API for your scenario. – Lex Li May 05 '21 at 03:40

0 Answers0