在已编译的 VSCode 中使用扩展
Using extensions in compiled VSCode
我在 mac 上编译了 VSCode 并且能够 运行 应用程序,但发现扩展不起作用。
导航到扩展窗格显示 - 'No extensions found.'
所以我对 'marketplace' 的源代码进行了 grep 并找到了 - "build/lib/extensions.js: base: 'https://marketplace.visualstudio.com/_apis/public/gallery',
我假设那是市场的 URL,并尝试对其进行卷曲以验证 API 是否发回可用扩展列表。我得到的只是一个 404。
所以,如果我想让扩展在我的编译版本上工作,我是否必须更改 URL?
如何让扩展程序正常工作?
见
您需要打开叉子上的文件 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"
}
另见问题:
不清楚 product.json
文件在哪里 ...
如果您在 Mac 上使用 VSCodium
,则 product.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 之后,如果我们打开扩展市场:
如果您搜索自己喜欢的扩展程序或编程语言,您将看到全部:
如果你想解决 archlinux 的问题,请看这里 => https://wiki.archlinux.org/index.php/Visual_Studio_Code,你有多种可能的选择来解决问题。
Vscode 开源版本(Code -OSS、Vscodium)似乎默认不使用 Microsoft 扩展库。因此,一些扩展不会出现在扩展选项卡中,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"
}
我在 mac 上编译了 VSCode 并且能够 运行 应用程序,但发现扩展不起作用。 导航到扩展窗格显示 - 'No extensions found.'
所以我对 'marketplace' 的源代码进行了 grep 并找到了 - "build/lib/extensions.js: base: 'https://marketplace.visualstudio.com/_apis/public/gallery',
我假设那是市场的 URL,并尝试对其进行卷曲以验证 API 是否发回可用扩展列表。我得到的只是一个 404。
所以,如果我想让扩展在我的编译版本上工作,我是否必须更改 URL? 如何让扩展程序正常工作?
见
您需要打开叉子上的文件 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"
}
另见问题:
不清楚 product.json
文件在哪里 ...
如果您在 Mac 上使用 VSCodium
,则 product.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 之后,如果我们打开扩展市场:
如果您搜索自己喜欢的扩展程序或编程语言,您将看到全部:
如果你想解决 archlinux 的问题,请看这里 => https://wiki.archlinux.org/index.php/Visual_Studio_Code,你有多种可能的选择来解决问题。
Vscode 开源版本(Code -OSS、Vscodium)似乎默认不使用 Microsoft 扩展库。因此,一些扩展不会出现在扩展选项卡中,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"
}