aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/lib.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-10 17:47:09 +0000
committerAleksey Kladov <[email protected]>2020-03-10 17:47:09 +0000
commitbf582e77d6e5603149b355a5650cd4d15318f776 (patch)
treefd655f5e42cd720e11c067c43449f7bcf6311ccd /crates/ra_ide/src/lib.rs
parent2347c03dcd717fbc0648c1e4e3d64a886217de5d (diff)
Pull completion options up to the rust-analyzer
Diffstat (limited to 'crates/ra_ide/src/lib.rs')
-rw-r--r--crates/ra_ide/src/lib.rs17
1 files changed, 6 insertions, 11 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs
index 0d91ea749..d888bb745 100644
--- a/crates/ra_ide/src/lib.rs
+++ b/crates/ra_ide/src/lib.rs
@@ -450,17 +450,12 @@ impl Analysis {
450 } 450 }
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(
454 let opts = CompletionOptions { 454 &self,
455 enable_postfix_completions: self.feature_flags().get("completion.enable-postfix"), 455 position: FilePosition,
456 add_call_parenthesis: self 456 options: &CompletionOptions,
457 .feature_flags() 457 ) -> Cancelable<Option<Vec<CompletionItem>>> {
458 .get("completion.insertion.add-call-parenthesis"), 458 self.with_db(|db| completion::completions(db, position, options).map(Into::into))
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))
464 } 459 }
465 460
466 /// Computes assists (aka code actions aka intentions) for the given 461 /// Computes assists (aka code actions aka intentions) for the given