aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion/completion_item.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-27 21:54:34 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-27 21:54:34 +0000
commit6e36d3f6537f80071e7ed8ff45ca2271a9ffe7a7 (patch)
tree49bb3da6d354604cd375acac105ee14ff5a38b23 /crates/ra_ide_api/src/completion/completion_item.rs
parent19f77603c0aed92ec70a836dae4d447b8fcab922 (diff)
parentcf5c99271d79e98332d6e7d35f885b7c79177238 (diff)
Merge #694
694: Sort completions in tests r=matklad a=flodiebold Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/completion/completion_item.rs')
-rw-r--r--crates/ra_ide_api/src/completion/completion_item.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/completion/completion_item.rs b/crates/ra_ide_api/src/completion/completion_item.rs
index b16ac2b28..49bd636a5 100644
--- a/crates/ra_ide_api/src/completion/completion_item.rs
+++ b/crates/ra_ide_api/src/completion/completion_item.rs
@@ -324,10 +324,11 @@ pub(crate) fn check_completion(test_name: &str, code: &str, kind: CompletionKind
324 }; 324 };
325 let completions = completions(&analysis.db, position).unwrap(); 325 let completions = completions(&analysis.db, position).unwrap();
326 let completion_items: Vec<CompletionItem> = completions.into(); 326 let completion_items: Vec<CompletionItem> = completions.into();
327 let kind_completions: Vec<CompletionItem> = completion_items 327 let mut kind_completions: Vec<CompletionItem> = completion_items
328 .into_iter() 328 .into_iter()
329 .filter(|c| c.completion_kind == kind) 329 .filter(|c| c.completion_kind == kind)
330 .collect(); 330 .collect();
331 kind_completions.sort_by_key(|c| c.label.clone());
331 assert_debug_snapshot_matches!(test_name, kind_completions); 332 assert_debug_snapshot_matches!(test_name, kind_completions);
332} 333}
333 334