diff options
Diffstat (limited to 'crates/ide_completion/src/tests.rs')
-rw-r--r-- | crates/ide_completion/src/tests.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/crates/ide_completion/src/tests.rs b/crates/ide_completion/src/tests.rs index 211c89c40..97298ff27 100644 --- a/crates/ide_completion/src/tests.rs +++ b/crates/ide_completion/src/tests.rs | |||
@@ -7,6 +7,10 @@ | |||
7 | mod item_list; | 7 | mod item_list; |
8 | mod use_tree; | 8 | mod use_tree; |
9 | mod items; | 9 | mod items; |
10 | mod pattern; | ||
11 | mod type_pos; | ||
12 | |||
13 | use std::mem; | ||
10 | 14 | ||
11 | use hir::{PrefixKind, Semantics}; | 15 | use hir::{PrefixKind, Semantics}; |
12 | use ide_db::{ | 16 | use ide_db::{ |
@@ -45,7 +49,16 @@ pub(crate) fn completion_list(code: &str) -> String { | |||
45 | } | 49 | } |
46 | 50 | ||
47 | fn completion_list_with_config(config: CompletionConfig, code: &str) -> String { | 51 | fn completion_list_with_config(config: CompletionConfig, code: &str) -> String { |
48 | render_completion_list(get_all_items(config, code)) | 52 | // filter out all but one builtintype completion for smaller test outputs |
53 | let items = get_all_items(config, code); | ||
54 | let mut bt_seen = false; | ||
55 | let items = items | ||
56 | .into_iter() | ||
57 | .filter(|it| { | ||
58 | it.completion_kind != CompletionKind::BuiltinType || !mem::replace(&mut bt_seen, true) | ||
59 | }) | ||
60 | .collect(); | ||
61 | render_completion_list(items) | ||
49 | } | 62 | } |
50 | 63 | ||
51 | /// Creates analysis from a multi-file fixture, returns positions marked with $0. | 64 | /// Creates analysis from a multi-file fixture, returns positions marked with $0. |