diff options
Diffstat (limited to 'crates/ra_analysis/src/completion.rs')
-rw-r--r-- | crates/ra_analysis/src/completion.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/ra_analysis/src/completion.rs b/crates/ra_analysis/src/completion.rs index ea15f239c..6fd30aaee 100644 --- a/crates/ra_analysis/src/completion.rs +++ b/crates/ra_analysis/src/completion.rs | |||
@@ -34,10 +34,11 @@ pub(crate) fn resolve_based_completion( | |||
34 | let source_root_id = db.file_source_root(position.file_id); | 34 | let source_root_id = db.file_source_root(position.file_id); |
35 | let file = db.file_syntax(position.file_id); | 35 | let file = db.file_syntax(position.file_id); |
36 | let module_tree = db.module_tree(source_root_id)?; | 36 | let module_tree = db.module_tree(source_root_id)?; |
37 | let module_id = match module_tree.any_module_for_source(ModuleSource::File(position.file_id)) { | 37 | let module_id = |
38 | None => return Ok(None), | 38 | match module_tree.any_module_for_source(ModuleSource::SourceFile(position.file_id)) { |
39 | Some(it) => it, | 39 | None => return Ok(None), |
40 | }; | 40 | Some(it) => it, |
41 | }; | ||
41 | let file = { | 42 | let file = { |
42 | let edit = AtomEdit::insert(position.offset, "intellijRulezz".to_string()); | 43 | let edit = AtomEdit::insert(position.offset, "intellijRulezz".to_string()); |
43 | file.reparse(&edit) | 44 | file.reparse(&edit) |