Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I exclude files from one of a multi-root workspace's root folders from search in VS Code?

This is my configuration in .code-workspace:

"folders": [
    {
        "path": "."
    },
    {
        "path": "../html/ROOT"
    }
],

I'm trying to get all files out of the ROOT folder when I search with ctrl+p (Quick Open). I can't in any way. This is the last attempt:

"files.exclude": {
    "**/ROOT/**": true
},    
"search.exclude": {
    "**/ROOT/**": true
}

I also tried with:

"files.exclude": {
    "**/ROOT": true
},    
"search.exclude": {
    "**/ROOT": true
}

and

"files.exclude": {
    "ROOT/**": true
},    
"search.exclude": {
    "ROOT/**": true
}

without success.

Some idea?

like image 239
Roberto Avatar asked Aug 31 '25 01:08

Roberto


1 Answers

I googled "github vscode issues exclude workspace root from search" and found the following:

So, to achieve what you want, you can put the following in the .vscode/settings.json of the workspace root folder that you want to exclude from searches:

"search.exclude": {
   "**": true,
}
like image 107
starball Avatar answered Sep 02 '25 13:09

starball