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.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide/src/completion/test_utils.rs b/crates/ra_ide/src/completion/test_utils.rs
index 1e16a43ca..a1b7c1193 100644
--- a/crates/ra_ide/src/completion/test_utils.rs
+++ b/crates/ra_ide/src/completion/test_utils.rs
@@ -2,7 +2,7 @@
2 2
3use crate::{ 3use crate::{
4 completion::{completion_item::CompletionKind, CompletionConfig}, 4 completion::{completion_item::CompletionKind, CompletionConfig},
5 mock_analysis::{analysis_and_position, single_file_with_position}, 5 mock_analysis::analysis_and_position,
6 CompletionItem, 6 CompletionItem,
7}; 7};
8use hir::Semantics; 8use hir::Semantics;
@@ -33,7 +33,7 @@ fn get_all_completion_items(code: &str, options: &CompletionConfig) -> Vec<Compl
33 let (analysis, position) = if code.contains("//-") { 33 let (analysis, position) = if code.contains("//-") {
34 analysis_and_position(code) 34 analysis_and_position(code)
35 } else { 35 } else {
36 single_file_with_position(code) 36 analysis_and_position(code)
37 }; 37 };
38 analysis.completions(options, position).unwrap().unwrap().into() 38 analysis.completions(options, position).unwrap().unwrap().into()
39} 39}
@@ -55,7 +55,7 @@ pub(crate) fn completion_list_with_options(
55} 55}
56 56
57pub(crate) fn check_pattern_is_applicable(code: &str, check: fn(SyntaxElement) -> bool) { 57pub(crate) fn check_pattern_is_applicable(code: &str, check: fn(SyntaxElement) -> bool) {
58 let (analysis, pos) = single_file_with_position(code); 58 let (analysis, pos) = analysis_and_position(code);
59 analysis 59 analysis
60 .with_db(|db| { 60 .with_db(|db| {
61 let sema = Semantics::new(db); 61 let sema = Semantics::new(db);