diff options
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 614a6e9be..74c248a96 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -17,7 +17,7 @@ use rustc_hash::FxHashSet; | |||
17 | use salsa::{Database, ParallelDatabase}; | 17 | use salsa::{Database, ParallelDatabase}; |
18 | 18 | ||
19 | use crate::{ | 19 | use crate::{ |
20 | completion::{resolve_based_completion, scope_completion, CompletionItem}, | 20 | completion::{completions, CompletionItem}, |
21 | db::{self, FileSyntaxQuery, SyntaxDatabase}, | 21 | db::{self, FileSyntaxQuery, SyntaxDatabase}, |
22 | descriptors::{ | 22 | descriptors::{ |
23 | function::{FnDescriptor, FnId}, | 23 | function::{FnDescriptor, FnId}, |
@@ -267,18 +267,7 @@ impl AnalysisImpl { | |||
267 | self.db.crate_graph().crate_roots[&crate_id] | 267 | self.db.crate_graph().crate_roots[&crate_id] |
268 | } | 268 | } |
269 | pub fn completions(&self, position: FilePosition) -> Cancelable<Option<Vec<CompletionItem>>> { | 269 | pub fn completions(&self, position: FilePosition) -> Cancelable<Option<Vec<CompletionItem>>> { |
270 | let mut res = Vec::new(); | 270 | completions(&self.db, position) |
271 | let mut has_completions = false; | ||
272 | if let Some(scope_based) = scope_completion(&self.db, position) { | ||
273 | res.extend(scope_based); | ||
274 | has_completions = true; | ||
275 | } | ||
276 | if let Some(scope_based) = resolve_based_completion(&self.db, position)? { | ||
277 | res.extend(scope_based); | ||
278 | has_completions = true; | ||
279 | } | ||
280 | let res = if has_completions { Some(res) } else { None }; | ||
281 | Ok(res) | ||
282 | } | 271 | } |
283 | pub fn approximately_resolve_symbol( | 272 | pub fn approximately_resolve_symbol( |
284 | &self, | 273 | &self, |