Skip to content

Commit f5bfeb7

Browse files
committed
1 parent 5e12e53 commit f5bfeb7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/vs/editor/contrib/documentSymbols/outlineModel.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ export class OutlineGroup extends TreeElement {
133133
}
134134

135135
private _updateMatches(pattern: string, item: OutlineElement, topMatch: OutlineElement): OutlineElement {
136-
item.score = fuzzyScore(pattern, pattern.toLowerCase(), 0, item.symbol.name, item.symbol.name.toLowerCase(), 0, true);
136+
137+
item.score = pattern
138+
? fuzzyScore(pattern, pattern.toLowerCase(), 0, item.symbol.name, item.symbol.name.toLowerCase(), 0, true)
139+
: [-100, []];
140+
137141
if (item.score && (!topMatch || item.score[0] > topMatch.score[0])) {
138142
topMatch = item;
139143
}
@@ -142,7 +146,7 @@ export class OutlineGroup extends TreeElement {
142146
topMatch = this._updateMatches(pattern, child, topMatch);
143147
if (!item.score && child.score) {
144148
// don't filter parents with unfiltered children
145-
item.score = [0, []];
149+
item.score = [-100, []];
146150
}
147151
}
148152
return topMatch;

0 commit comments

Comments
 (0)