Honor sort_text when language server provides completions

This commit is contained in:
Antonio Scandurra 2022-07-26 10:41:39 +02:00
parent 7f6b83d8cc
commit f775cb2947

View file

@ -755,9 +755,11 @@ impl CompletionsMenu {
.collect()
};
matches.sort_unstable_by_key(|mat| {
let completion = &self.completions[mat.candidate_id];
(
completion.lsp_completion.sort_text.as_ref(),
Reverse(OrderedFloat(mat.score)),
self.completions[mat.candidate_id].sort_key(),
completion.sort_key(),
)
});