Default files.watcherExclude patterns cause CPU stall on large repos due to pathological regex (fix #305923) (#306224)

This commit is contained in:
Benjamin Pasero
2026-03-30 19:03:46 +02:00
committed by GitHub
parent 002f2d99e8
commit 33741c2647
2 changed files with 10 additions and 7 deletions

View File

@@ -29,12 +29,6 @@ Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerDefaultCon
'extensions.ignoreRecommendations': true,
'files.autoSave': 'afterDelay',
'files.watcherExclude': {
'**/.git/objects/**': true,
'**/.git/subtree-cache/**': true,
'**/node_modules/*/**': true,
'**/.hg/store/**': true
},
'git.autofetch': true,
'git.branchRandomName.enable': true,

View File

@@ -295,7 +295,16 @@ configurationRegistry.registerConfiguration({
'patternProperties': {
'.*': { 'type': 'boolean' }
},
'default': { '**/.git/objects/**': true, '**/.git/subtree-cache/**': true, '**/.hg/store/**': true },
'default': {
// Avoiding a '**' pattern here which results in a very complex
// RegExp that can slow things down significantly in large workspaces
'.git/objects/**': true,
'.git/subtree-cache/**': true,
'.hg/store/**': true,
'*/.git/objects/**': true,
'*/.git/subtree-cache/**': true,
'*/.hg/store/**': true
},
'markdownDescription': nls.localize('watcherExclude', "Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from file watching. Paths can either be relative to the watched folder or absolute. Glob patterns are matched relative from the watched folder. When you experience the file watcher process consuming a lot of CPU, make sure to exclude large folders that are of less interest (such as build output folders)."),
'scope': ConfigurationScope.RESOURCE
},