From 33384d289e246ea29c8e8103fef3099a6781e23b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 24 Dec 2020 15:32:29 +0300 Subject: pit-of-success API for unresolved code actions --- crates/ide/src/lib.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'crates/ide') diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index 52c7f9775..a75cc85b6 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs @@ -490,8 +490,18 @@ impl Analysis { .unwrap_or_default()) } + /// Computes assists (aka code actions aka intentions) for the given + /// position. Computes enough info to show the lightbulb list in the editor, + /// but doesn't compute actual edits, to improve performance. + /// + /// When the user clicks on the assist, call `resolve_assists` to get the + /// edit. + pub fn assists(&self, config: &AssistConfig, frange: FileRange) -> Cancelable> { + self.with_db(|db| Assist::unresolved(db, config, frange)) + } + /// Computes resolved assists with source changes for the given position. - pub fn resolved_assists( + pub fn resolve_assists( &self, config: &AssistConfig, frange: FileRange, @@ -499,16 +509,6 @@ impl Analysis { self.with_db(|db| assists::Assist::resolved(db, config, frange)) } - /// Computes unresolved assists (aka code actions aka intentions) for the given - /// position. - pub fn unresolved_assists( - &self, - config: &AssistConfig, - frange: FileRange, - ) -> Cancelable> { - self.with_db(|db| Assist::unresolved(db, config, frange)) - } - /// Computes the set of diagnostics for the given file. pub fn diagnostics( &self, -- cgit v1.2.3