fix: disregard exclude and ignore settings for workspaceContains glob searches - #327347
Open
di3go04 wants to merge 1 commit into
Open
fix: disregard exclude and ignore settings for workspaceContains glob searches#327347di3go04 wants to merge 1 commit into
di3go04 wants to merge 1 commit into
Conversation
Comment on lines
+126
to
+127
| disregardExcludeSettings: true, | ||
| disregardIgnoreFiles: true, |
- Add shouldIgnoreExcludesForPattern() to detect if a glob explicitly targets directories like .git, .svn, .hg, or node_modules. - Only apply disregardExcludeSettings and disregardIgnoreFiles when the pattern matches these directories. - Preserve performance for broad patterns like **/*.ts by continuing to respect files.exclude. Related to microsoft#326423 Ref: microsoft#327347
di3go04
force-pushed
the
fix/workspaceContains-disregard-excludes-clean
branch
from
July 24, 2026 18:14
28ae99a to
8a06172
Compare
Author
|
I've refined the solution based on the performance concern raised by Copilot. Now,
This ensures:
Please review again. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
workspaceContainsactivation events with glob patterns (*,?) are routed through file search incheckGlobFileExists. That search appliesfiles.excludedefaults (**/.git,**/.svn,**/.hg), so an extension declaring"activationEvents": ["workspaceContains:**/.svn/wc.db"]can never activate — even when the file exists — because.svn/is excluded by default.Exact patterns (no glob) use
host.exists()which never consults excludes and work correctly. Only the glob search path is affected.Solution
Add
disregardExcludeSettings: trueanddisregardIgnoreFiles: trueto the file search query incheckGlobFileExists. This tells the search engine to ignore bothfiles.excludeand search ignore files, matching the semantics of the exact-path branch.Verification
npm run compile) — no errors.host.exists().Fixes: #326423