提交 f5022a50 编写于 作者: B Benjamin Pasero

revert fuzzy scoring for commands

上级 c42c8643
......@@ -228,15 +228,8 @@ export class CommandsHandler extends QuickOpenHandler {
// Remove duplicates
entries = arrays.distinct(entries, (entry) => entry.getLabel() + entry.getGroupLabel());
// Sort by name if there is no search running
if (!searchValue) {
entries = entries.sort((elementA, elementB) => strings.localeCompare(elementA.getLabel().toLowerCase(), elementB.getLabel().toLowerCase()));
}
// Otherwise sort by score
else {
entries = entries.sort((elementA, elementB) => QuickOpenEntry.compareByScore(elementA, elementB, searchValue));
}
// Sort by name
entries = entries.sort((elementA, elementB) => strings.localeCompare(elementA.getLabel().toLowerCase(), elementB.getLabel().toLowerCase()));
return TPromise.as(new QuickOpenModel(entries));
}
......@@ -256,7 +249,7 @@ export class CommandsHandler extends QuickOpenHandler {
label = nls.localize('commandLabel', "{0}: {1}", category, label);
}
let highlights = filters.matchesFuzzy(searchValue, label, true /* separate substring matching */);
let highlights = filters.matchesFuzzy(searchValue, label);
if (highlights) {
entries.push(this.instantiationService.createInstance(CommandEntry, keys.length > 0 ? keys.join(', ') : '', label, highlights, actionDescriptor));
}
......@@ -281,7 +274,7 @@ export class CommandsHandler extends QuickOpenHandler {
let keys = this.keybindingService.lookupKeybindings(editorAction.id).map(k => this.keybindingService.getLabelFor(k));
if (action.label) {
let highlights = filters.matchesFuzzy(searchValue, action.label, true /* separate substring matching */);
let highlights = filters.matchesFuzzy(searchValue, action.label);
if (highlights) {
entries.push(this.instantiationService.createInstance(EditorActionCommandEntry, keys.length > 0 ? keys.join(', ') : '', action.label, highlights, action));
}
......@@ -296,7 +289,7 @@ export class CommandsHandler extends QuickOpenHandler {
for (let action of actions) {
let keys = this.keybindingService.lookupKeybindings(action.id).map(k => this.keybindingService.getLabelFor(k));
let highlights = filters.matchesFuzzy(searchValue, action.label, true /* separate substring matching */);
let highlights = filters.matchesFuzzy(searchValue, action.label);
if (highlights) {
entries.push(this.instantiationService.createInstance(ActionCommandEntry, keys.join(', '), action.label, highlights, action));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册