本文介绍了“未找到扩展程序"从源代码运行 Visual Studio Code 时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在 Visual Studio Code 中安装任何扩展时(即,通过按 Ctrl+P 然后运行 ​​ext install RustyCode),我收到一条消息 未找到扩展程序.

When I try to install any extension in Visual Studio Code (i.e., by pressing Ctrl+P and then running ext install RustyCode), I get a message that No extensions found.

然而,这只发生在我直接从源代码库运行 VS Code 时.即,之后:

However, this only happens when I run VS Code directly from source repository. I.e., after:

git clone https://github.com/Microsoft/vscode.git
cd vscode
git checkout 1.0.0
scripts/code.sh

但是,如果我从 官方版本 运行 VS Code,那么我可以安装扩展.

But, if I run VS Code from official builds, then I'm able to install extensions.

那么,当我直接从源存储库运行 VS Code 时,如何启用从 Visual Studio Marketplace 下载和安装扩展?(Visual Studio Marketplace 集成是否单独捆绑在官方版本中?)

So, how can I enable downloading and installing extensions from Visual Studio Marketplace when I run VS Code directly from source repository? (Is Visual Studio Marketplace integration bundled separately in official builds?)

我使用的是 Ubuntu/Linux.

I'm on Ubuntu/Linux.

推荐答案

这可以通过在 product.json 中添加以下内容来解决:

This can be fixed by adding following to 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(在 .zip archvieproduct.json 位于 resources/app 下),其中包含以上几行).

(This is can also be fixed by copying product.json from an official build (in the .zip archvie, product.json is under resources/app) which contains above lines).

更多信息:https://github.com/Microsoft/vscode/issues/1557

这篇关于“未找到扩展程序"从源代码运行 Visual Studio Code 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!