aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/to_proto.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-03-09 17:24:09 +0000
committerAleksey Kladov <[email protected]>2021-03-09 17:24:09 +0000
commitb2764a6641be5caef3d62dfb80c836e4976194f3 (patch)
treeeed8266943c9c2e7d172b598077fbf1514068e0d /crates/rust-analyzer/src/to_proto.rs
parent73b9937e4eea2633005e7d2814cb7990e5f20e8f (diff)
Future proof completion scores
Diffstat (limited to 'crates/rust-analyzer/src/to_proto.rs')
-rw-r--r--crates/rust-analyzer/src/to_proto.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index 2380e021a..a9846fa70 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -213,7 +213,7 @@ pub(crate) fn completion_item(
213 ..Default::default() 213 ..Default::default()
214 }; 214 };
215 215
216 if item.score().is_some() { 216 if item.relevance().is_relevant() {
217 lsp_item.preselect = Some(true); 217 lsp_item.preselect = Some(true);
218 // HACK: sort preselect items first 218 // HACK: sort preselect items first
219 lsp_item.sort_text = Some(format!(" {}", item.label())); 219 lsp_item.sort_text = Some(format!(" {}", item.label()));
@@ -1106,7 +1106,9 @@ mod tests {
1106 [ 1106 [
1107 ( 1107 (
1108 "&arg", 1108 "&arg",
1109 None, 1109 Some(
1110 " arg",
1111 ),
1110 ), 1112 ),
1111 ( 1113 (
1112 "arg", 1114 "arg",