【问题标题】:Using extensions in compiled VSCode在编译的 VSCode 中使用扩展
【发布时间】:2017-10-18 20:05:58
【问题描述】:

我在 mac 上编译了 VSCode 并能够运行应用程序,但注意到扩展不起作用。 导航到扩展窗格显示 - '未找到扩展。'

所以我对 'marketplace' 的源代码进行了 grep,发现 - "build/lib/extensions.js: base: 'https://marketplace.visualstudio.com/_apis/public/gallery',

我假设这是市场的 URL,并尝试对其进行 curl 以验证 API 是否发回可用扩展的列表。我得到的只是一个 404。

那么,如果我想让扩展程序在我的编译版本上工作,我是否必须更改 URL? 如何让扩展程序正常工作?

【问题讨论】:

标签: visual-studio-code vscode-extensions


【解决方案1】:

似乎 Vscode 开源版本(Code -OSS,Vscodium)默认不使用微软扩展库。因此,某些扩展将不会显示在扩展选项卡中,ext 命令将不起作用

正如@nelsonic 所说,在 Mac 中解决此问题的正确方法是编辑 /Applications/VSCodium.app/Contents/Resources/app/product.json 文件。

在 Linux 中,情况完全不同。如果您使用Code -OSS,请编辑以下文件:/usr/lib/code/product.json

如果你使用VsCodium,你编辑:/usr/lib/codium/product.json

您必须将密钥 extensionsGallery 从:

    "extensionsGallery": {
        "serviceUrl": "https://open-vsx.org/vscode/gallery",
        "itemUrl": "https://open-vsx.org/vscode/item"
    },

收件人:

"extensionsGallery": {
    "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
    "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
    "itemUrl": "https://marketplace.visualstudio.com/items"
}

【讨论】:

    【解决方案2】:

    如果您想解决 archlinux 的问题,请看这里 => https://wiki.archlinux.org/index.php/Visual_Studio_Code,您有多种可能的选择来解决问题。

    【讨论】:

      【解决方案3】:

      "No extensions found" when running Visual Studio Code from source

      您需要在 fork 上打开文件 https://github.com/Microsoft/vscode/blob/master/product.json 并附加密钥:

      "extensionsGallery": {
          "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
          "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
          "itemUrl": "https://marketplace.visualstudio.com/items"
      }
      

      另见问题:

      1. How do I enable extensions in the extensions dir in OSS Dev mode
      2. Can I put the extensionsGallery on my vscode fork?

      【讨论】:

        【解决方案4】:

        不清楚product.json文件在哪里……

        如果您在 Mac 上使用 VSCodiumproduct.json 文件位于:
        /Applications/VSCodium.app/Contents/Resources/app

        使用 VSCodium 编辑文件:

        code /Applications/VSCodium.app/Contents/Resources/app/product.json
        

        如果您搜索“extensionsGallery”,您应该会看到:

        替换:

          "extensionsGallery": {
            "serviceUrl": "https://open-vsx.org/vscode/gallery",
            "itemUrl": "https://open-vsx.org/vscode/item"
          },
        

        与:

        "extensionsGallery": {
            "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
            "itemUrl": "https://marketplace.visualstudio.com/items"
        },
        

        所以你现在有了这个:

        重新启动 VSCodium 之后,如果我们打开扩展市场:

        如果您搜索自己喜欢的扩展程序或编程语言,您会看到所有

        【讨论】:

        • 感谢您的回复。 Linux 的路径是什么?
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-07-29
        • 1970-01-01
        • 1970-01-01
        • 2020-04-12
        • 1970-01-01
        • 2019-01-12
        相关资源
        最近更新 更多