From f835279b3ae41644e9568187b4468cd9d9e84eca Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 21 Jun 2021 13:48:25 +0200 Subject: Move out completion pattern tests --- crates/ide_completion/src/tests.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/ide_completion/src/tests.rs') diff --git a/crates/ide_completion/src/tests.rs b/crates/ide_completion/src/tests.rs index 211c89c40..7af8c903b 100644 --- a/crates/ide_completion/src/tests.rs +++ b/crates/ide_completion/src/tests.rs @@ -7,6 +7,7 @@ mod item_list; mod use_tree; mod items; +mod pattern; use hir::{PrefixKind, Semantics}; use ide_db::{ -- cgit v1.2.3 From b9d85f55b7a0a2159971b42bb5dae71efbfeada4 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 21 Jun 2021 14:59:49 +0200 Subject: Move out completion type position tests --- crates/ide_completion/src/tests.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'crates/ide_completion/src/tests.rs') diff --git a/crates/ide_completion/src/tests.rs b/crates/ide_completion/src/tests.rs index 7af8c903b..97298ff27 100644 --- a/crates/ide_completion/src/tests.rs +++ b/crates/ide_completion/src/tests.rs @@ -8,6 +8,9 @@ mod item_list; mod use_tree; mod items; mod pattern; +mod type_pos; + +use std::mem; use hir::{PrefixKind, Semantics}; use ide_db::{ @@ -46,7 +49,16 @@ pub(crate) fn completion_list(code: &str) -> String { } fn completion_list_with_config(config: CompletionConfig, code: &str) -> String { - render_completion_list(get_all_items(config, code)) + // filter out all but one builtintype completion for smaller test outputs + let items = get_all_items(config, code); + let mut bt_seen = false; + let items = items + .into_iter() + .filter(|it| { + it.completion_kind != CompletionKind::BuiltinType || !mem::replace(&mut bt_seen, true) + }) + .collect(); + render_completion_list(items) } /// Creates analysis from a multi-file fixture, returns positions marked with $0. -- cgit v1.2.3