mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Use stateless completion resolve
This commit is contained in:
parent
93bc009a59
commit
deda74edd8
6 changed files with 123 additions and 70 deletions
|
@ -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<Vec<TextEdit>> {
|
||||
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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue