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.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_ide/src/completion/test_utils.rs b/crates/ra_ide/src/completion/test_utils.rs
index f25190241..145d36c98 100644
--- a/crates/ra_ide/src/completion/test_utils.rs
+++ b/crates/ra_ide/src/completion/test_utils.rs
@@ -57,10 +57,19 @@ pub(crate) fn completion_list_with_options(
57} 57}
58 58
59pub(crate) fn check_edit(what: &str, ra_fixture_before: &str, ra_fixture_after: &str) { 59pub(crate) fn check_edit(what: &str, ra_fixture_before: &str, ra_fixture_after: &str) {
60 check_edit_with_config(what, ra_fixture_before, ra_fixture_after, &CompletionConfig::default())
61}
62
63pub(crate) fn check_edit_with_config(
64 what: &str,
65 ra_fixture_before: &str,
66 ra_fixture_after: &str,
67 config: &CompletionConfig,
68) {
60 let ra_fixture_after = trim_indent(ra_fixture_after); 69 let ra_fixture_after = trim_indent(ra_fixture_after);
61 let (analysis, position) = analysis_and_position(ra_fixture_before); 70 let (analysis, position) = analysis_and_position(ra_fixture_before);
62 let completions: Vec<CompletionItem> = 71 let completions: Vec<CompletionItem> =
63 analysis.completions(&CompletionConfig::default(), position).unwrap().unwrap().into(); 72 analysis.completions(config, position).unwrap().unwrap().into();
64 let (completion,) = completions 73 let (completion,) = completions
65 .iter() 74 .iter()
66 .filter(|it| it.lookup() == what) 75 .filter(|it| it.lookup() == what)