Future proof completion scores

This commit is contained in:
Aleksey Kladov 2021-03-09 20:24:09 +03:00
parent 73b9937e4e
commit b2764a6641
4 changed files with 96 additions and 72 deletions

View file

@ -213,7 +213,7 @@ pub(crate) fn completion_item(
..Default::default()
};
if item.score().is_some() {
if item.relevance().is_relevant() {
lsp_item.preselect = Some(true);
// HACK: sort preselect items first
lsp_item.sort_text = Some(format!(" {}", item.label()));
@ -1106,7 +1106,9 @@ mod tests {
[
(
"&arg",
None,
Some(
" arg",
),
),
(
"arg",