mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Future proof completion scores
This commit is contained in:
parent
73b9937e4e
commit
b2764a6641
4 changed files with 96 additions and 72 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue