aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion/completion_context.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-10 17:39:17 +0000
committerAleksey Kladov <[email protected]>2020-03-10 17:40:22 +0000
commit2347c03dcd717fbc0648c1e4e3d64a886217de5d (patch)
treec778877ddc5e17ee7adca15324fe3f5a417f062a /crates/ra_ide/src/completion/completion_context.rs
parent6b9d66bbee865bd4337366f1540f8e5aa8d82c18 (diff)
Introduce CompletionOptions
Diffstat (limited to 'crates/ra_ide/src/completion/completion_context.rs')
-rw-r--r--crates/ra_ide/src/completion/completion_context.rs5
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};
12use ra_text_edit::AtomTextEdit; 12use ra_text_edit::AtomTextEdit;
13 13
14use crate::FilePosition; 14use 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;
19pub(crate) struct CompletionContext<'a> { 19pub(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,