简体   繁体   English

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

[英]How do I put multiple unrelated folders into a Visual Studio Code workspace?

I have a tree of more than 100GB of sources I work in that looks like this: 我有一棵超过100GB的源代码树,看起来像这样:

$/unrelated $ /无关
$/tests/my-team/tests.config $ / tests / my-team / tests.config
$/tests/my-team/tests/test/test.cpp $ / tests / my-team / tests / test / test.cpp
$/tests/my-team/tests/test2/test.cpp $ / tests / my-team / tests / test2 / test.cpp
$/tests/unrelated $ /测试/无关
$/unrelated $ /无关
$/product/my-team/product.config $ /产品/my-team/product.config
$/product/my-team/foobar.h $ /产品/我的团队/foobar.h
$/product/my-team/foobar.cpp $ /产品/我的团队/foobar.cpp

My team only works with a very small subset of these. 我的团队只使用其中很小的一部分。 I would like Visual Studio Code to show only these: 我希望Visual Studio Code仅显示以下内容:

$/tests/my-team/* $ /测试/我的团队/ *
$/product/my-team/* $ /产品/我的团队/ *

and not index / search other directories. 而不是索引/搜索其他目录。 Is this possible? 这可能吗?

You could add a .vscode/settings.json (File - Preferences - Workspace Settings) to your workspace and add: 您可以在工作区中添加.vscode/settings.json (文件-首选项-工作区设置),然后添加:

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

This will (I believe) also exclude from... but you can specify that directly (我相信)这也将排除在...之外,但您可以直接指定

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Visual Studio Code中搜索文件夹? - How do you search for folders in Visual Studio Code? 如何在Visual Studio 2008中使用C#为其他窗口创建工作区窗口? - How do I create a workspace window for other windows using c# in visual studio 2008? 并发修改Roslyn工作区? Visual Studio如何做到这一点? - Concurrency of modifying a Roslyn workspace? How does Visual studio do it? 如何清除Visual Studio工作区 - How to clear Visual Studio workspace 如何使用 Visual Studio 2019 为解决方案中的多个项目指定自定义代码分析规则集? - How do I specify a custom code analysis ruleset for multiple projects in a solution using Visual Studio 2019? Visual Studio项目包含多个文件夹 - Visual Studio projects with multiple folders 如何防止 Visual Studio 在我的源目录中创建 obj 文件夹? - How do I prevent Visual Studio from creating obj folders in my source directory? 如何在 Visual Studio 的部署项目中自动包含文件夹和文件? - How do I automatically include folders and files to the deployment project in visual studio? 如何从 Visual Studio 2017 的构建中排除文件和文件夹? - How do I exclude files and folders from the build in Visual Studio 2017? 如何阻止Visual Studio创建pdb调试文件夹? - How do I stop Visual Studio from creating pdb debug folders?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM