diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-24 12:50:30 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-24 12:50:30 +0000 |
commit | aebf7ee2b65fdb51e125fc1461554cd9f673c60e (patch) | |
tree | 7b7ee3cecfe87f4a7a939687b72e7aaef0db06df /crates/ide/src/lib.rs | |
parent | 06320015af0c966df3deef9994b535fb110d303e (diff) | |
parent | 33384d289e246ea29c8e8103fef3099a6781e23b (diff) |
Merge #7028
7028: pit-of-success API for unresolved code actions r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ide/src/lib.rs')
-rw-r--r-- | crates/ide/src/lib.rs | 22 |
1 files changed, 11 insertions, 11 deletions
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 { | |||
490 | .unwrap_or_default()) | 490 | .unwrap_or_default()) |
491 | } | 491 | } |
492 | 492 | ||
493 | /// Computes assists (aka code actions aka intentions) for the given | ||
494 | /// position. Computes enough info to show the lightbulb list in the editor, | ||
495 | /// but doesn't compute actual edits, to improve performance. | ||
496 | /// | ||
497 | /// When the user clicks on the assist, call `resolve_assists` to get the | ||
498 | /// edit. | ||
499 | pub fn assists(&self, config: &AssistConfig, frange: FileRange) -> Cancelable<Vec<Assist>> { | ||
500 | self.with_db(|db| Assist::unresolved(db, config, frange)) | ||
501 | } | ||
502 | |||
493 | /// Computes resolved assists with source changes for the given position. | 503 | /// Computes resolved assists with source changes for the given position. |
494 | pub fn resolved_assists( | 504 | pub fn resolve_assists( |
495 | &self, | 505 | &self, |
496 | config: &AssistConfig, | 506 | config: &AssistConfig, |
497 | frange: FileRange, | 507 | frange: FileRange, |
@@ -499,16 +509,6 @@ impl Analysis { | |||
499 | self.with_db(|db| assists::Assist::resolved(db, config, frange)) | 509 | self.with_db(|db| assists::Assist::resolved(db, config, frange)) |
500 | } | 510 | } |
501 | 511 | ||
502 | /// Computes unresolved assists (aka code actions aka intentions) for the given | ||
503 | /// position. | ||
504 | pub fn unresolved_assists( | ||
505 | &self, | ||
506 | config: &AssistConfig, | ||
507 | frange: FileRange, | ||
508 | ) -> Cancelable<Vec<Assist>> { | ||
509 | self.with_db(|db| Assist::unresolved(db, config, frange)) | ||
510 | } | ||
511 | |||
512 | /// Computes the set of diagnostics for the given file. | 512 | /// Computes the set of diagnostics for the given file. |
513 | pub fn diagnostics( | 513 | pub fn diagnostics( |
514 | &self, | 514 | &self, |