diff options
Diffstat (limited to 'crates/ra_analysis/src/completion.rs')
-rw-r--r-- | crates/ra_analysis/src/completion.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/completion.rs b/crates/ra_analysis/src/completion.rs index a0fd6828d..04bb82c18 100644 --- a/crates/ra_analysis/src/completion.rs +++ b/crates/ra_analysis/src/completion.rs | |||
@@ -6,13 +6,14 @@ use ra_syntax::{ | |||
6 | 6 | ||
7 | use crate::{ | 7 | use crate::{ |
8 | FileId, Cancelable, | 8 | FileId, Cancelable, |
9 | db::{self, SyntaxDatabase}, | 9 | db::{self, SyntaxDatabase, input::FilesDatabase}, |
10 | descriptors::module::{ModulesDatabase, ModuleTree, ModuleId}, | 10 | descriptors::module::{ModulesDatabase, ModuleTree, ModuleId}, |
11 | }; | 11 | }; |
12 | 12 | ||
13 | pub(crate) fn resolve_based_completion(db: &db::RootDatabase, file_id: FileId, offset: TextUnit) -> Cancelable<Option<Vec<CompletionItem>>> { | 13 | pub(crate) fn resolve_based_completion(db: &db::RootDatabase, file_id: FileId, offset: TextUnit) -> Cancelable<Option<Vec<CompletionItem>>> { |
14 | let source_root_id = db.file_source_root(file_id); | ||
14 | let file = db.file_syntax(file_id); | 15 | let file = db.file_syntax(file_id); |
15 | let module_tree = db.module_tree()?; | 16 | let module_tree = db.module_tree(source_root_id)?; |
16 | let file = { | 17 | let file = { |
17 | let edit = AtomEdit::insert(offset, "intellijRulezz".to_string()); | 18 | let edit = AtomEdit::insert(offset, "intellijRulezz".to_string()); |
18 | file.reparse(&edit) | 19 | file.reparse(&edit) |