aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-05-14 14:29:40 +0100
committerAleksey Kladov <[email protected]>2020-05-14 14:33:56 +0100
commitfc0c5dfcd1c021d7e9662b20c7d394db65bf3388 (patch)
tree9b743283da314121c7bfe4efb6e49d2a549f0401
parent90c62bcee9d1950d0e4b642fc2bd3ae5374e40cb (diff)
Put preselect items on top
-rw-r--r--crates/rust-analyzer/src/to_proto.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index 33c2fd595..2696ecac4 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -178,7 +178,9 @@ pub(crate) fn completion_item(
178 }; 178 };
179 179
180 if completion_item.score().is_some() { 180 if completion_item.score().is_some() {
181 res.preselect = Some(true) 181 res.preselect = Some(true);
182 // HACK: sort preselect items first
183 res.sort_text = Some(format!(" {}", completion_item.label()));
182 } 184 }
183 185
184 if completion_item.deprecated() { 186 if completion_item.deprecated() {