Skip to content

Commit

Permalink
Use * (non-coalescing wildcard) to match multiple dots
Browse files Browse the repository at this point in the history
This commit brings consistency with `vscode.GlobPattern` API.
Refs: microsoft#174286 @aeschli review
  • Loading branch information
zm-cttae committed Mar 9, 2023
1 parent d0ec167 commit 89bf34d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vs/editor/common/services/getIconClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ function pushGlobIconClassesForName(name: string, classes: string[], segments: s
}
const glob = buffer.join('.');

// Globs with chained * filename segments coaelesced into **
// Globs with chained * filename segments coaelesced into *
if (glob.match(fileIconWildcardChainRegex)) {
const coaelescedGlob = glob.replace(fileIconWildcardChainRegex, '**');
const coaelescedGlob = glob.replace(fileIconWildcardChainRegex, '*');
classes.push(`${coaelescedGlob}-glob-${kind}-icon`);
}

Expand All @@ -117,7 +117,7 @@ function pushGlobIconClassesForName(name: string, classes: string[], segments: s
for (let i = 0; i < lastDotIndex; i++) {
// Prefix-matching coalescing globs
const suffixSegments = segments.slice(0, i + 1);
suffixSegments.push(i < lastDotIndex - 1 ? '**' : '*');
suffixSegments.push('*');
const suffixGlob = suffixSegments.join('.');
classes.push(`${suffixGlob}-glob-${kind}-icon`);

Expand Down

0 comments on commit 89bf34d

Please sign in to comment.