diff options
Diffstat (limited to 'crates/ra_ide/src/completion/completion_context.rs')
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index 40535c09e..3646fb8dc 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs | |||
@@ -11,7 +11,7 @@ use ra_syntax::{ | |||
11 | }; | 11 | }; |
12 | use ra_text_edit::AtomTextEdit; | 12 | use ra_text_edit::AtomTextEdit; |
13 | 13 | ||
14 | use crate::FilePosition; | 14 | use crate::{completion::CompletionOptions, FilePosition}; |
15 | 15 | ||
16 | /// `CompletionContext` is created early during completion to figure out, where | 16 | /// `CompletionContext` is created early during completion to figure out, where |
17 | /// exactly is the cursor, syntax-wise. | 17 | /// exactly is the cursor, syntax-wise. |
@@ -19,6 +19,7 @@ use crate::FilePosition; | |||
19 | pub(crate) struct CompletionContext<'a> { | 19 | pub(crate) struct CompletionContext<'a> { |
20 | pub(super) sema: Semantics<'a, RootDatabase>, | 20 | pub(super) sema: Semantics<'a, RootDatabase>, |
21 | pub(super) db: &'a RootDatabase, | 21 | pub(super) db: &'a RootDatabase, |
22 | pub(super) options: &'a CompletionOptions, | ||
22 | pub(super) offset: TextUnit, | 23 | pub(super) offset: TextUnit, |
23 | /// The token before the cursor, in the original file. | 24 | /// The token before the cursor, in the original file. |
24 | pub(super) original_token: SyntaxToken, | 25 | pub(super) original_token: SyntaxToken, |
@@ -57,6 +58,7 @@ impl<'a> CompletionContext<'a> { | |||
57 | pub(super) fn new( | 58 | pub(super) fn new( |
58 | db: &'a RootDatabase, | 59 | db: &'a RootDatabase, |
59 | position: FilePosition, | 60 | position: FilePosition, |
61 | options: &'a CompletionOptions, | ||
60 | ) -> Option<CompletionContext<'a>> { | 62 | ) -> Option<CompletionContext<'a>> { |
61 | let sema = Semantics::new(db); | 63 | let sema = Semantics::new(db); |
62 | 64 | ||
@@ -80,6 +82,7 @@ impl<'a> CompletionContext<'a> { | |||
80 | let mut ctx = CompletionContext { | 82 | let mut ctx = CompletionContext { |
81 | sema, | 83 | sema, |
82 | db, | 84 | db, |
85 | options, | ||
83 | original_token, | 86 | original_token, |
84 | token, | 87 | token, |
85 | offset: position.offset, | 88 | offset: position.offset, |