aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion/test_utils.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/completion/test_utils.rs')
-rw-r--r--crates/ra_ide/src/completion/test_utils.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/ra_ide/src/completion/test_utils.rs b/crates/ra_ide/src/completion/test_utils.rs
index 5c01654cc..5938415b3 100644
--- a/crates/ra_ide/src/completion/test_utils.rs
+++ b/crates/ra_ide/src/completion/test_utils.rs
@@ -2,6 +2,7 @@
2 2
3use hir::Semantics; 3use hir::Semantics;
4use ra_syntax::{AstNode, NodeOrToken, SyntaxElement}; 4use ra_syntax::{AstNode, NodeOrToken, SyntaxElement};
5use stdx::format_to;
5 6
6use crate::{ 7use crate::{
7 completion::{completion_item::CompletionKind, CompletionConfig}, 8 completion::{completion_item::CompletionKind, CompletionConfig},
@@ -42,7 +43,14 @@ pub(crate) fn completion_list_with_options(
42 kind_completions.sort_by_key(|c| c.label().to_owned()); 43 kind_completions.sort_by_key(|c| c.label().to_owned());
43 kind_completions 44 kind_completions
44 .into_iter() 45 .into_iter()
45 .map(|it| format!("{} {}\n", it.kind().unwrap().tag(), it.label())) 46 .map(|it| {
47 let mut buf = format!("{} {}", it.kind().unwrap().tag(), it.label());
48 if let Some(detail) = it.detail() {
49 format_to!(buf, " {}", detail);
50 }
51 format_to!(buf, "\n");
52 buf
53 })
46 .collect() 54 .collect()
47} 55}
48 56