diff options
Diffstat (limited to 'crates/ra_ide/src/lib.rs')
-rw-r--r-- | crates/ra_ide/src/lib.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index c60e86aea..0d91ea749 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs | |||
@@ -62,7 +62,7 @@ use crate::display::ToNav; | |||
62 | pub use crate::{ | 62 | pub use crate::{ |
63 | assists::{Assist, AssistId}, | 63 | assists::{Assist, AssistId}, |
64 | call_hierarchy::CallItem, | 64 | call_hierarchy::CallItem, |
65 | completion::{CompletionItem, CompletionItemKind, InsertTextFormat}, | 65 | completion::{CompletionItem, CompletionItemKind, CompletionOptions, InsertTextFormat}, |
66 | diagnostics::Severity, | 66 | diagnostics::Severity, |
67 | display::{file_structure, FunctionSignature, NavigationTarget, StructureNode}, | 67 | display::{file_structure, FunctionSignature, NavigationTarget, StructureNode}, |
68 | expand_macro::ExpandedMacro, | 68 | expand_macro::ExpandedMacro, |
@@ -451,7 +451,16 @@ impl Analysis { | |||
451 | 451 | ||
452 | /// Computes completions at the given position. | 452 | /// Computes completions at the given position. |
453 | pub fn completions(&self, position: FilePosition) -> Cancelable<Option<Vec<CompletionItem>>> { | 453 | pub fn completions(&self, position: FilePosition) -> Cancelable<Option<Vec<CompletionItem>>> { |
454 | self.with_db(|db| completion::completions(db, position).map(Into::into)) | 454 | let opts = CompletionOptions { |
455 | enable_postfix_completions: self.feature_flags().get("completion.enable-postfix"), | ||
456 | add_call_parenthesis: self | ||
457 | .feature_flags() | ||
458 | .get("completion.insertion.add-call-parenthesis"), | ||
459 | add_call_argument_snippets: self | ||
460 | .feature_flags() | ||
461 | .get("completion.insertion.add-argument-snippets"), | ||
462 | }; | ||
463 | self.with_db(|db| completion::completions(db, position, &opts).map(Into::into)) | ||
455 | } | 464 | } |
456 | 465 | ||
457 | /// Computes assists (aka code actions aka intentions) for the given | 466 | /// Computes assists (aka code actions aka intentions) for the given |