From 297712dce9b03daf8b628716a62407a0514d98e3 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 9 Aug 2018 12:18:07 +0200 Subject: [PATCH] Revert "Don't include non-resource entries in history quick pick" This reverts commit 37209a838e9f7e9abe6dc53ed73cdf1e03b72060. --- .../parts/quickopen/quickOpenController.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index a63062b1035..e35dd586dd8 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -1074,7 +1074,17 @@ class EditorHistoryHandler { // Massage search for scoring const query = prepareQuery(searchValue); - const history = this.historyService.getHistory() + // Just return all if we are not searching + const history = this.historyService.getHistory(); + if (!query.value) { + return history.map(input => this.instantiationService.createInstance(EditorHistoryEntry, input)); + } + + // Otherwise filter by search value and sort by score. Include matches on description + // in case the user is explicitly including path separators. + const accessor = query.containsPathSeparator ? MatchOnDescription : DoNotMatchOnDescription; + return history + // For now, only support to match on inputs that provide resource information .filter(input => { let resource: URI; @@ -1088,17 +1098,8 @@ class EditorHistoryHandler { }) // Conver to quick open entries - .map(input => this.instantiationService.createInstance(EditorHistoryEntry, input)); - - // Just return all if we are not searching - if (!query.value) { - return history; - } + .map(input => this.instantiationService.createInstance(EditorHistoryEntry, input)) - // Otherwise filter by search value and sort by score. Include matches on description - // in case the user is explicitly including path separators. - const accessor = query.containsPathSeparator ? MatchOnDescription : DoNotMatchOnDescription; - return history // Make sure the search value is matching .filter(e => { const itemScore = scoreItem(e, query, false, accessor, this.scorerCache); -- GitLab