Repository navigation
fix: let a middle ** in skipFiles match zero directories - #2424
Merged
Connor Peet (connor4312) merged 1 commit intoOct 5, 2026
Merged
Connor Peet (connor4312) merged 1 commit into
Connor Peet (connor4312) merged 1 commit into
Conversation
A `**` segment in the middle of a skipFiles glob compiled to `.*/`,
which needs at least one extra directory. So `${workspaceFolder}/lib/**/*.js`
did not skip `lib/index.js`, and a negation like `!**/foo/**/bar/**` did
not un-skip `foo/bar/...`. Make that part optional so it matches zero or
more directories, like the leading `**` already does.
Connor Peet (connor4312)
approved these changes
Oct 2, 2026
Connor Peet (connor4312)
enabled auto-merge (squash)
October 2, 2026 15:48
Dmitriy Vasyura (dmitrivMS)
approved these changes
Oct 5, 2026
Martin Aeschlimann (aeschli)
approved these changes
Oct 5, 2026
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.
A
**in the middle of a skipFiles glob currently has to match at least one directory.globToReturns it into.*/, and the segment before it already ends with\/. So with"skipFiles": ["${workspaceFolder}/lib/**/*.js"],lib/sub/index.jsis skipped butlib/index.jsis not, and${workspaceFolder}/**/node_modules/**misses the top-levelnode_modules. Negations are affected the same way: with["**/foo/**", "!**/foo/**/bar/**"],foo/bar/bazstays skipped. This came in with #1470. Before that, a middle**could match zero directories.This change makes the middle case
(.*/)?, the same shape as the leading(.+/)?, so it matches zero or more directories without bringing back a nested quantifier. Possibly related: microsoft/vscode#204173 (!**/webpack-internal:///**/packages/**not un-skippingwebpack-internal:///packages/...).simpleGlobToRe.test.ts. Both fail on main and pass with this change, and their "is not catastrophic" checks pass.npm run test:unit. The only difference from main is the 4 new passing tests.npm run test:types,dprint checkandeslint --max-warnings=0on the touched files, all clean.