From 2347c03dcd717fbc0648c1e4e3d64a886217de5d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 10 Mar 2020 18:39:17 +0100 Subject: Introduce CompletionOptions --- crates/ra_ide/src/completion/completion_context.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide/src/completion/completion_context.rs') 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::{ }; use ra_text_edit::AtomTextEdit; -use crate::FilePosition; +use crate::{completion::CompletionOptions, FilePosition}; /// `CompletionContext` is created early during completion to figure out, where /// exactly is the cursor, syntax-wise. @@ -19,6 +19,7 @@ use crate::FilePosition; pub(crate) struct CompletionContext<'a> { pub(super) sema: Semantics<'a, RootDatabase>, pub(super) db: &'a RootDatabase, + pub(super) options: &'a CompletionOptions, pub(super) offset: TextUnit, /// The token before the cursor, in the original file. pub(super) original_token: SyntaxToken, @@ -57,6 +58,7 @@ impl<'a> CompletionContext<'a> { pub(super) fn new( db: &'a RootDatabase, position: FilePosition, + options: &'a CompletionOptions, ) -> Option> { let sema = Semantics::new(db); @@ -80,6 +82,7 @@ impl<'a> CompletionContext<'a> { let mut ctx = CompletionContext { sema, db, + options, original_token, token, offset: position.offset, -- cgit v1.2.3