diff options
author | Kirill Bulatov <[email protected]> | 2020-12-04 14:03:22 +0000 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2020-12-07 21:41:08 +0000 |
commit | deda74edd89affb3f77d274776d2a672bc11db90 (patch) | |
tree | e9c7dac6df4fd06012ca6b6e628223e925998f1e /crates/ide/src/lib.rs | |
parent | 93bc009a5968c964693299263689b50b2efe9abc (diff) |
Use stateless completion resolve
Diffstat (limited to 'crates/ide/src/lib.rs')
-rw-r--r-- | crates/ide/src/lib.rs | 22 |
1 files changed, 22 insertions, 0 deletions
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 { | |||
469 | self.with_db(|db| completion::completions(db, config, position).map(Into::into)) | 469 | self.with_db(|db| completion::completions(db, config, position).map(Into::into)) |
470 | } | 470 | } |
471 | 471 | ||
472 | /// Resolves additional completion data at the position given. | ||
473 | pub fn resolve_completion_edits( | ||
474 | &self, | ||
475 | config: &CompletionConfig, | ||
476 | position: FilePosition, | ||
477 | full_import_path: &str, | ||
478 | imported_name: &str, | ||
479 | ) -> Cancelable<Vec<TextEdit>> { | ||
480 | Ok(self | ||
481 | .with_db(|db| { | ||
482 | completion::resolve_completion_edits( | ||
483 | db, | ||
484 | config, | ||
485 | position, | ||
486 | full_import_path, | ||
487 | imported_name, | ||
488 | ) | ||
489 | })? | ||
490 | .map(|edit| vec![edit]) | ||
491 | .unwrap_or_default()) | ||
492 | } | ||
493 | |||
472 | /// Computes resolved assists with source changes for the given position. | 494 | /// Computes resolved assists with source changes for the given position. |
473 | pub fn resolved_assists( | 495 | pub fn resolved_assists( |
474 | &self, | 496 | &self, |