且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 Visual Studio 中使用 VSCode 扩展

更新时间:2022-03-14 10:18:53

平台是否完全不同[...]

Are the platforms entirely different [...]

是的,它们是 - VSCode 扩展在 JavaScript 引擎中运行(通常用 TypeScript 编写),而 Visual Studio 扩展似乎在 .NET(通常是 C#)上运行.它们还有不同的扩展 API:

Yes, they are - VSCode extensions run in a JavaScript engine (and are usually written with TypeScript), while Visual Studio extensions seem to run on .NET (usually C#). They also have different extension APIs:

这并不意味着扩展当然不能移植,只要 Visual Studio 具有所有必需 API 的等效项,但它本质上是重写.

That doesn't mean that extension couldn't be ported over of course, provided Visual Studio has equivalents for all the required APIs, but it would essentially be a rewrite.

现在,语言服务器有一个例外,使用微软的语言服务器协议一>.它被设计为独立于 IDE,并且服务器基本上可以用您喜欢的任何语言编写.VSCode(内置)和 Visual Studio 都有 LSP 客户端实现.不过,您链接的扩展程序不属于此范围.

Now, there's an exception to this with language servers, using Microsoft's Language Server Protocol. It is designed to be IDE-independent and servers can be written in basically whatever language you prefer. There's LSP clients implementations for both VSCode (built-in) and Visual Studio. The extension you linked doesn't fall under that though.