Using a language other than typescript / javascript to build vs code extensions..?? #64
-
I read the vscode extension building documentation and its focused towards building vs code extension with either typescript or javascript... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Hi @ninetynin , The extension itself must be either TypeScript or JavaScript, at least the portion that will work with the VS Code API. On the other hand, you can use any other language to build your logic and you could use any technology to talk to it. For instance, let's say you want to build a new Language Server for Dart. You can build it using Dart, C++, Rust and any other language, and access it using the Language Server Protocol (https://code.visualstudio.com/api/language-extensions/language-server-extension-guide#why-language-server). You can use a similar approach for any other logic you want to build, on any language, and you decide how your extension (written in TS/JS) will talk to your service. You can use regular HTTP, RPC, or any other communication technology, either locally or remotely. It's up to you. Hope this helps |
Beta Was this translation helpful? Give feedback.
-
You can write language servers in any language you want but that may require considerably more effort than in TS, where you already have a lot code already written and well maintained. Keep in mind that distributing binaries will make the building and installation an order of magnitude more complex than using node. At least 3 operating systems multiplied by at least two CPU architectures (amd64 and arm64) and you can easily hate your decision to not use node. Ansible DevTeam did consider this more than an year ago as we are mostly a Python shop and still, we decided that to take the safe path and have it written in TS. Now we are looking to hire someone with TS and ext development experience to help us move faster. Also keep in mind the vscode also works in browser! I doubt you will run these other binaries in browser any time soon. Probably something compiled to WASM may work but I am not sure. |
Beta Was this translation helpful? Give feedback.
Hi @ninetynin ,
The extension itself must be either TypeScript or JavaScript, at least the portion that will work with the VS Code API. On the other hand, you can use any other language to build your logic and you could use any technology to talk to it.
For instance, let's say you want to build a new Language Server for Dart. You can build it using Dart, C++, Rust and any other language, and access it using the Language Server Protocol (https://code.visualstudio.com/api/language-extensions/language-server-extension-guide#why-language-server).
You can use a similar approach for any other logic you want to build, on any language, and you decide how your extension (written in TS/JS) will talk …