diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion/completion_context.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/completion_context.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide_api/src/completion/completion_context.rs index 65dffa470..ce21fca9b 100644 --- a/crates/ra_ide_api/src/completion/completion_context.rs +++ b/crates/ra_ide_api/src/completion/completion_context.rs | |||
@@ -14,6 +14,7 @@ use crate::{db, FilePosition}; | |||
14 | #[derive(Debug)] | 14 | #[derive(Debug)] |
15 | pub(crate) struct CompletionContext<'a> { | 15 | pub(crate) struct CompletionContext<'a> { |
16 | pub(super) db: &'a db::RootDatabase, | 16 | pub(super) db: &'a db::RootDatabase, |
17 | pub(super) analyzer: hir::SourceAnalyser, | ||
17 | pub(super) offset: TextUnit, | 18 | pub(super) offset: TextUnit, |
18 | pub(super) token: SyntaxToken<'a>, | 19 | pub(super) token: SyntaxToken<'a>, |
19 | pub(super) resolver: Resolver, | 20 | pub(super) resolver: Resolver, |
@@ -50,8 +51,10 @@ impl<'a> CompletionContext<'a> { | |||
50 | let resolver = source_binder::resolver_for_position(db, position); | 51 | let resolver = source_binder::resolver_for_position(db, position); |
51 | let module = source_binder::module_from_position(db, position); | 52 | let module = source_binder::module_from_position(db, position); |
52 | let token = find_token_at_offset(original_file.syntax(), position.offset).left_biased()?; | 53 | let token = find_token_at_offset(original_file.syntax(), position.offset).left_biased()?; |
54 | let analyzer = hir::SourceAnalyser::new(db, position.file_id, token.parent()); | ||
53 | let mut ctx = CompletionContext { | 55 | let mut ctx = CompletionContext { |
54 | db, | 56 | db, |
57 | analyzer, | ||
55 | token, | 58 | token, |
56 | offset: position.offset, | 59 | offset: position.offset, |
57 | resolver, | 60 | resolver, |