pit-of-success API for unresolved code actions

This commit is contained in:
Aleksey Kladov 2020-12-24 15:32:29 +03:00
parent 1487f2f10e
commit 33384d289e
2 changed files with 14 additions and 14 deletions

View file

@ -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<Vec<Assist>> {
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<Vec<Assist>> {
self.with_db(|db| Assist::unresolved(db, config, frange))
}
/// Computes the set of diagnostics for the given file.
pub fn diagnostics(
&self,