aboutsummaryrefslogtreecommitdiff
path: root/crates/completion
diff options
context:
space:
mode:
Diffstat (limited to 'crates/completion')
-rw-r--r--crates/completion/src/lib.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/completion/src/lib.rs b/crates/completion/src/lib.rs
index 938c92dbb..066d589af 100644
--- a/crates/completion/src/lib.rs
+++ b/crates/completion/src/lib.rs
@@ -141,7 +141,7 @@ pub fn resolve_completion_edits(
141 position: FilePosition, 141 position: FilePosition,
142 full_import_path: &str, 142 full_import_path: &str,
143 imported_name: &str, 143 imported_name: &str,
144) -> Option<TextEdit> { 144) -> Option<Vec<TextEdit>> {
145 let ctx = CompletionContext::new(db, position, config)?; 145 let ctx = CompletionContext::new(db, position, config)?;
146 let anchor = ctx.name_ref_syntax.as_ref()?; 146 let anchor = ctx.name_ref_syntax.as_ref()?;
147 let import_scope = ImportScope::find_insert_use_container(anchor.syntax(), &ctx.sema)?; 147 let import_scope = ImportScope::find_insert_use_container(anchor.syntax(), &ctx.sema)?;
@@ -156,7 +156,9 @@ pub fn resolve_completion_edits(
156 }) 156 })
157 .find(|mod_path| mod_path.to_string() == full_import_path)?; 157 .find(|mod_path| mod_path.to_string() == full_import_path)?;
158 158
159 ImportEdit { import_path, import_scope, merge_behaviour: config.merge }.to_text_edit() 159 ImportEdit { import_path, import_scope, merge_behaviour: config.merge }
160 .to_text_edit()
161 .map(|edit| vec![edit])
160} 162}
161 163
162#[cfg(test)] 164#[cfg(test)]