Use stateless completion resolve
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user