VS Code lets you to install a Language Server like ccls or clang as another extension. But how do I connect it to my new custom extension? I can see information how to write your own language server, but not how to leverage existing ones.
Asked
Active
Viewed 884 times
4
-
Can you explain in a bit more detail what you try to achieve. The VS Code extensions are only the client part to connect to a language server. Do you want to extend existing language servers (ccls or clangd) with new features? Or do you want to ship the client with your extensions? – havogt Mar 06 '20 at 07:29
-
@havogt, Thank you for reply. I want to build my own extension around existing language server. For example I want to use ccls to get hover information or to get code structure of a document. Is it possible? – Vladk Mar 06 '20 at 10:30
-
1It is certainly possible, however your question is still too broad to give a concrete answer. Did you have a look at the [clangd](https://github.com/llvm/llvm-project/blob/master/clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts) vscode extension? It is rather straight-forward how to setup communication with the language server. – havogt Mar 06 '20 at 21:57
-
@havogt Thank you, I'll look at clangd. But do I understand it correctly that I have to install it localy as usual application? I thought I can install it inside of VS Code as extention and reference from my code, does it work like this? – Vladk Mar 09 '20 at 06:41
-
clangd and ccls are both c++ applications. You have to install them separately (clangd is usually packaged with clang, so you can probably assume many c++ developers already have it). – havogt Mar 09 '20 at 12:52
-
@Vladk Hi, I have the same question with you, do you have any further information? – K. Symbol Mar 21 '21 at 15:24
-
@K.Symbol Hi, unfortunately project was closed, so I had no chance to get through this issue! – Vladk Apr 01 '21 at 08:30