diff options
author | Aleksey Kladov <[email protected]> | 2020-07-03 10:48:48 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-03 10:48:48 +0100 |
commit | 0e23175a077de5183a34696490848b47e4198f56 (patch) | |
tree | 8bdde6b7793c9aa077fd06ba64bb262a77235fc8 /crates/ra_ide/src/completion/test_utils.rs | |
parent | 4cb8bf03c588dcf244d25785de3878b6ef3f7958 (diff) |
Cleanup record completion tests
Diffstat (limited to 'crates/ra_ide/src/completion/test_utils.rs')
-rw-r--r-- | crates/ra_ide/src/completion/test_utils.rs | 10 |
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 | ||
3 | use hir::Semantics; | 3 | use hir::Semantics; |
4 | use ra_syntax::{AstNode, NodeOrToken, SyntaxElement}; | 4 | use ra_syntax::{AstNode, NodeOrToken, SyntaxElement}; |
5 | use stdx::format_to; | ||
5 | 6 | ||
6 | use crate::{ | 7 | use 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 | ||