Use stateless completion resolve

This commit is contained in:
Kirill Bulatov 2020-12-04 16:03:22 +02:00
parent 93bc009a59
commit deda74edd8
6 changed files with 123 additions and 70 deletions

View file

@ -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,