I am working on adding a new language support to vscode, and I have finished a debugger with C#, but this is modified from the mono-debugger sample provided in vscode document. Now I would like to make a language service, so I would like to know if it is possible to do it with C#?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
This is possible if you use an abstraction layer called the Language Server Protocol. Theoretically, it gives you the freedom to implement language support in any language that supports socket communication. You will still need a VSCode extension in JS that starts the language server, but it doesn't need to do much beyond that.
A few examples:
- Java Language Server implemented in Java
- Python Language Server implemented in Python
- C/C++ Language Server implemented in C++
- etc.
When writing a language server, you will also need a library that actually implements the protocol part of it. Looks like for C# one already exists.