我有一个超过 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 仅显示这些:
$/测试/我的团队/*
$/产品/我的团队/*
并且不索引/搜索其他目录。这可能吗?
您可以将
.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
},
创建多根代码工作区文件并启动 VSCode 有了它:
您可以直接执行此操作:
{
"folders": [
{"path": "/tests/my-team"},
{"path": "/product/my-team"}]
}
或者间接地,通过创建一个带有指向感兴趣文件夹的符号链接的文件夹并在该文件夹中启动 VSCode。