提交 9b74d12c 编写于 作者: J Johannes Rieken

also take number of highlight ranges into account, fixes #14660

上级 099b686c
......@@ -231,12 +231,13 @@ export class CompletionModel {
}
}
// combine the four scoring values into one
// combine the five scoring values into one
// value using base_100. Values further left
// are more important
return (CompletionModel._base ** 4) * caseSensitiveMatches
+ (CompletionModel._base ** 3) * caseInsensitiveMatches
+ (CompletionModel._base ** 2) * (CompletionModel._base - firstMatchStart)
+ (CompletionModel._base ** 1) * (CompletionModel._base - notMatching);
+ (CompletionModel._base ** 1) * (CompletionModel._base - highlights.length)
+ (CompletionModel._base ** 0) * (CompletionModel._base - notMatching);
}
}
......@@ -144,5 +144,6 @@ suite('CompletionModel', function () {
assertTopScore('editor.R', 1, 'diffEditor.renderSideBySide', 'editor.overviewRulerlanes', 'editor.renderControlCharacter', 'editor.renderWhitespace');
assertTopScore('Editor.r', 0, 'diffEditor.renderSideBySide', 'editor.overviewRulerlanes', 'editor.renderControlCharacter', 'editor.renderWhitespace');
assertTopScore('-mo', 1, '-ms-ime-mode', '-moz-columns');
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册