From deda74edd89affb3f77d274776d2a672bc11db90 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 4 Dec 2020 16:03:22 +0200 Subject: Use stateless completion resolve --- crates/ide/src/lib.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'crates/ide') diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index 9e38d6506..4a274f5ba 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs @@ -469,6 +469,28 @@ impl Analysis { self.with_db(|db| completion::completions(db, config, position).map(Into::into)) } + /// Resolves additional completion data at the position given. + pub fn resolve_completion_edits( + &self, + config: &CompletionConfig, + position: FilePosition, + full_import_path: &str, + imported_name: &str, + ) -> Cancelable> { + Ok(self + .with_db(|db| { + completion::resolve_completion_edits( + db, + config, + position, + full_import_path, + imported_name, + ) + })? + .map(|edit| vec![edit]) + .unwrap_or_default()) + } + /// Computes resolved assists with source changes for the given position. pub fn resolved_assists( &self, -- cgit v1.2.3