针对不同编程语言使用不同扩展的单独 Visual Studio Code 工作区 [英] Separate Visual Studio Code workspace with different extensions for different programming languages

查看:29
本文介绍了针对不同编程语言使用不同扩展的单独 Visual Studio Code 工作区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用扩展分别创建不同的 Visual Studio Code 工作区?例如,workspace_1 带有 C++ 扩展,workspace_2 带有 Python 扩展.

解决方案

您可以安装扩展,然后在特定工作区启用/禁用它们.

  1. 打开工作区
  2. 在扩展面板中,点击每个扩展的齿轮图标

    • 如果启用,您可以在此工作区禁用它

    • 如果它被禁用,你可以为这个工作区启用它

  3. 点击右上角的三个点以列出所有启用或禁用

遗憾的是,无法从 settings.json 文件(用户、工作区或文件夹)中进行配置,因为

  • 当用户第一次打开工作区时,他们会收到建议安装扩展的通知.

  • Is it possible to create different Visual Studio Code workspaces separately with extensions? For example, workspace_1 with C++ extension, workspace_2 with Python extension.

    解决方案

    You can install extensions and then enable/disable them on specific workspaces.

    1. Open a workspace
    2. From the Extensions panel, click on the gear icon of each extension

      • If it's enabled, you can disable it on this workspace

      • If it's disabled, you can enable it for this workspace

    3. Click on the three dots at the top-right to list either all enabled or disabled

    There is unfortunately no way to configure this from settings.json file (user, workspace, or folder), as the extensions info does not seem to be stored there:

    Enabled/Disabled extensions are not stored in workspace settings. Instead it is stored in local storage cache. You can manage them from the extensions view.

    More information on Managing Extensions can be found in the VS Code docs.

    If you want to create a shareable list of extensions for specific workspaces (ex. perhaps to commit to source control or sharing with teammates), you can specify a list of recommended extensions per workspace.

    1. Open the command palette
    2. Enter Extensions: Configure Recommended Extensions (Workspace)
    3. Enter a list of extensions IDs
      • For example, you want to recommend the "VSCode Ruby" extension

        "extensions": {
            "recommendations": [
                "wingrunr21.vscode-ruby"
            ]
        }
        

      • The format is {publisherName}.{extensionName}
      • You can get this from the extension's page in VS Code
    4. When the user opens the workspace for the 1st time, they will be notified of recommended extensions to install.

    这篇关于针对不同编程语言使用不同扩展的单独 Visual Studio Code 工作区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆