提交 37209a83 编写于 作者: M Matt Bierner

Don't include non-resource entries in history quick pick

Makes sure webviews don't show up in the history quick pick. We already do this filtering properly when there is a query, just not when there is no query
上级 627d4596
...@@ -1075,17 +1075,7 @@ class EditorHistoryHandler { ...@@ -1075,17 +1075,7 @@ class EditorHistoryHandler {
// Massage search for scoring // Massage search for scoring
const query = prepareQuery(searchValue); const query = prepareQuery(searchValue);
// Just return all if we are not searching const history = this.historyService.getHistory()
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 // For now, only support to match on inputs that provide resource information
.filter(input => { .filter(input => {
let resource: URI; let resource: URI;
...@@ -1099,8 +1089,17 @@ class EditorHistoryHandler { ...@@ -1099,8 +1089,17 @@ class EditorHistoryHandler {
}) })
// Conver to quick open entries // Conver to quick open entries
.map(input => this.instantiationService.createInstance(EditorHistoryEntry, input)) .map(input => this.instantiationService.createInstance(EditorHistoryEntry, input));
// Just return all if we are not searching
if (!query.value) {
return history;
}
// 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 // Make sure the search value is matching
.filter(e => { .filter(e => {
const itemScore = scoreItem(e, query, false, accessor, this.scorerCache); const itemScore = scoreItem(e, query, false, accessor, this.scorerCache);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册