From 09f125d59f6f6e77e532855212d679292b61e95f Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 4 Sep 2019 17:33:51 +0200 Subject: [PATCH] actually call the `compareByKindAndRank`-function --- .../contrib/quickopen/browser/gotoSymbolHandler.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts b/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts index 85362cb1aa935..60a0a3da38311 100644 --- a/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts +++ b/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts @@ -97,9 +97,11 @@ class OutlineModel extends QuickOpenModel { } }); - this.entries.sort(SymbolEntry.compareByRank); - - + // select comparator based on the presence of the colon-prefix + this.entries.sort(searchValuePos === 0 + ? SymbolEntry.compareByRank + : SymbolEntry.compareByKindAndRank + ); // Mark all type groups const visibleResults = this.getEntries(true); @@ -297,7 +299,7 @@ class SymbolEntry extends EditorQuickOpenEntryGroup { const kindB = NLS_SYMBOL_KIND_CACHE[b.getKind()] || FALLBACK_NLS_SYMBOL_KIND; let r = kindA.localeCompare(kindB); if (r === 0) { - r = this.compareByRank(a, b); + r = SymbolEntry.compareByRank(a, b); } return r; }