visual-studio-code - 如何排除多根工作区文件夹之一中的所有文件以在 Visual Studio 代码中进行搜索?

标签 visual-studio-code

我设置了一个多根工作区,其中四个文件夹中有两个是外部文件夹,因此我无法向该文件夹添加特定设置。我想禁用对这些文件夹的搜索,最好是在工作区设置中。

我找不到合适的模式来完成这项工作:(

以下是我的工作区设置,我正在尝试过滤 out 文件夹中的文件:

"folders": [
    {
        "name": "Application"
        "path": "./application"
    },
    {
        "name": "Device"
        "path": "./device"
    },
    {
        "name": "Out"
        "path": "./out"
    }],
"settings": {
    // Configure glob patterns for excluding files and folders in searches. Inherits all glob patterns from the files.exclude setting.
    "search.exclude": {
        "out": true,
        "**/tests": true,
        ".tags": true
    },

最佳答案

正如 https://stackoverflow.com/a/33418660/6225923 中提出的,您可以使用工作区设置并为要排除的文件夹添加模式,如下所示:

"search.excludeFolders": [
    "folder1",
    "folder2",
    "folder3",
    "path/to/other/folder4"
],

此外,确保搜索排除仍然处于事件状态是设置。

关于visual-studio-code - 如何排除多根工作区文件夹之一中的所有文件以在 Visual Studio 代码中进行搜索?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50970779/

相关文章:

visual-studio-code - 自定义shebang的VSCode语法高亮

python - 如何将VS代码工作目录更改为运行文件目录

typescript - 安装 typings 后刷新 VSC 中的错误

git - 如何使用带密码的 SSH key 让 Visual Studio Code 访问 Bitbucket

python - 将 .py 文件作为模块导入时,文档字符串未显示?

debugging - 使用 VS Code 和 MSVC 工具链调试 Rust 程序时,如何在 `panic` 处设置断点?

visual-studio-code - 如何更改 VS Code 设置以使用 JetBrains Mono 字体

windows - Windows 中的 Visual Studio Code 命令无法正常工作

visual-studio-code - 如何在 vs-code 中为其 python 插件设置 setup.cfg 的路径?

typescript - 带有 Typescript 导入 Assets 错误的 Gatsby (ts2307)