Visual Studio Code 远程扩展不是开源的

版权声明:所有博客文章除特殊声明外均为原创,允许转载,但要求注明出处。

Visual Studio Code 这个新锐编辑器最近的发展势头很猛,而目前的主要卖点则是远程开发(Remote Development)以及在线版本(Visual Studio Online)。过去我在看代码的时候就发现,Remote Development 扩展的源码并未开源出来,但当时并未在意,只是猜想可能是对 VSCode 的核心改动比较大、或者网络部分的设计尚未稳定,因此暂时封闭,以后应该会逐步释放出来。直到最近看到一些资料,才发现这是一个有意的决定,而 Remote Development 部分可能永远都不会开源了。

在 Visual Studio Code 官方文档的 Remote Development 部分,对此问题有一个专门的解释:

Q: Why aren't the Remote Development extensions or their components open source?

A: The Visual Studio Code Remote Development extensions and their related components use an open planning, issue, and feature request process, but are not currently open source. The extensions share source code which is also used in fully managed remote development services like Visual Studio Online and their related extensions. Given that these services also will support other proprietary products (for example Visual Studio IDE), the extensions are available under a Microsoft pre-release license like other service-based, cross-product extensions such as Visual Studio IntelliCode and Visual Studio Live Share were during their preview periods.

虽然内容有点打官腔的味道,大概意思还是看得出来的。这意味着微软把 Remote Development 提供的功能是为自己的服务网络的一部分,而这个服务是仅供微软自己使用的,并不打算开放出来。很显然,微软也不希望其他人用 VSCode 来构建类似的产品,并用来和自己竞争。

文档下面还有其他几个问题,进一步说明了 Remote Development 的限制,即允许用于自己私人使用,但

  • 禁止在其基础之上构建公开或商用的服务;
  • 禁止通过其他扩展来修改 Remote Development 提供的功能;
  • 禁止打包作为自己产品或应用的一部分

这意味着,我以前介绍过的 Code Server 以及其他一些类似的产品,严格意义上讲恐怕都是非法的:微软随时有理由封杀它们。还记得当微软放出 Visual Studio Online 的时候,社区一片叫好的声音,不过也有一个热度很高的问题是:“我们什么时候能自己部署 On Promise 版本?” 现在看来,或许答案是 never impossible。因为文档里也提到了,Visual Studio Online 是一个 Premium Feature,微软打算用它来赚钱!

在 Hacker News 上面也有关于该题的一个讨论(https://news.ycombinator.com/item?id=19841089),跟帖群众普遍的反应比较不满,还有人称微软“邪恶”。

在知道这个结果以后,我个人的感觉有一点失望,主要是我对主导 Visual Studio Code 开发的那位老先生有很高的敬意。或许,我该去关注一些类似 VSCode 但更加开放的实现,比如 Eclipse 开发的一系列云端 IDE 产品。