Is it possible to generate a Visual Studio Code ex

2019-08-07 07:48发布

问题:

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.