如何将多个不相关的文件夹放入 Visual Studio Code 工作区?

问题描述 投票:0回答:2

我有一个超过 100GB 的源树,看起来像这样:

$/不相关
$/tests/my-team/tests.config
$/tests/my-team/tests/test/test.cpp
$/tests/my-team/tests/test2/test.cpp
$/测试/无关
$/不相关
$/product/my-team/product.config
$/product/my-team/foobar.h
$/product/my-team/foobar.cpp

我的团队只处理其中的一小部分。我希望 Visual Studio Code 仅显示这些:

$/测试/我的团队/*
$/产品/我的团队/*

并且不索引/搜索其他目录。这可能吗?

visual-studio visual-studio-code
2个回答
1
投票

您可以将

.vscode/settings.json
(文件 - 首选项 - 工作区设置)添加到您的工作区并添加:

// Place your settings in this file to overwrite default and user settings.
{
    "files.exclude": {
        "**/.git": true,
        "**/.DS_Store": true
        "unrelated/**" : true
    },
}

这(我相信)也会排除...,但你可以直接指定

"search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true,
    "unrelated/**" : true
},

0
投票

创建多根代码工作区文件并启动 VSCode 有了它:

您可以直接执行此操作:

{
    "folders": [
        {"path": "/tests/my-team"},
        {"path": "/product/my-team"}]
}

或者间接地,通过创建一个带有指向感兴趣文件夹的符号链接的文件夹并在该文件夹中启动 VSCode。

© www.soinside.com 2019 - 2024. All rights reserved.