aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/completion/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/completion/mod.rs')
-rw-r--r--crates/ra_analysis/src/completion/mod.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ra_analysis/src/completion/mod.rs b/crates/ra_analysis/src/completion/mod.rs
index 5ef278127..e5ba92acd 100644
--- a/crates/ra_analysis/src/completion/mod.rs
+++ b/crates/ra_analysis/src/completion/mod.rs
@@ -7,13 +7,11 @@ use ra_syntax::{
7 AstNode, AtomEdit, 7 AstNode, AtomEdit,
8 SyntaxNodeRef, 8 SyntaxNodeRef,
9}; 9};
10use ra_db::SyntaxDatabase;
10use rustc_hash::{FxHashMap}; 11use rustc_hash::{FxHashMap};
11 12
12use crate::{ 13use crate::{
13 db::{self, SyntaxDatabase}, 14 db,
14 descriptors::{
15 module::{ModuleDescriptor}
16 },
17 Cancelable, FilePosition 15 Cancelable, FilePosition
18}; 16};
19 17
@@ -31,14 +29,14 @@ pub(crate) fn completions(
31 db: &db::RootDatabase, 29 db: &db::RootDatabase,
32 position: FilePosition, 30 position: FilePosition,
33) -> Cancelable<Option<Vec<CompletionItem>>> { 31) -> Cancelable<Option<Vec<CompletionItem>>> {
34 let original_file = db.file_syntax(position.file_id); 32 let original_file = db.source_file(position.file_id);
35 // Insert a fake ident to get a valid parse tree 33 // Insert a fake ident to get a valid parse tree
36 let file = { 34 let file = {
37 let edit = AtomEdit::insert(position.offset, "intellijRulezz".to_string()); 35 let edit = AtomEdit::insert(position.offset, "intellijRulezz".to_string());
38 original_file.reparse(&edit) 36 original_file.reparse(&edit)
39 }; 37 };
40 38
41 let module = ctry!(ModuleDescriptor::guess_from_position(db, position)?); 39 let module = ctry!(hir::Module::guess_from_position(db, position)?);
42 40
43 let mut res = Vec::new(); 41 let mut res = Vec::new();
44 let mut has_completions = false; 42 let mut has_completions = false;