Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 064fcfa

Browse files
committed
Sort and truncate final response
1 parent 2ea703c commit 064fcfa

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

crates/rust-analyzer/src/to_proto.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,10 @@ pub(crate) fn completion_items(
216216
let mut res = Vec::with_capacity(items.len());
217217
for item in items {
218218
completion_item(&mut res, config, line_index, &tdpp, max_relevance, item);
219-
220-
if let Some(limit) = config.completion().limit {
221-
if res.len() >= limit {
222-
break;
223-
}
224-
}
225219
}
226220

227221
if let Some(limit) = config.completion().limit {
222+
res.sort_by(|item1, item2| item1.sort_text.cmp(&item2.sort_text));
228223
res.truncate(limit);
229224
}
230225

0 commit comments

Comments
 (0)