aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/item.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/completion/src/item.rs')
-rw-r--r--crates/completion/src/item.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/completion/src/item.rs b/crates/completion/src/item.rs
index 83166df4e..65f8353e7 100644
--- a/crates/completion/src/item.rs
+++ b/crates/completion/src/item.rs
@@ -271,19 +271,18 @@ impl CompletionItem {
271pub struct ImportEdit { 271pub struct ImportEdit {
272 pub import_path: ModPath, 272 pub import_path: ModPath,
273 pub import_scope: ImportScope, 273 pub import_scope: ImportScope,
274 pub merge_behavior: Option<MergeBehavior>,
275} 274}
276 275
277impl ImportEdit { 276impl ImportEdit {
278 /// Attempts to insert the import to the given scope, producing a text edit. 277 /// Attempts to insert the import to the given scope, producing a text edit.
279 /// May return no edit in edge cases, such as scope already containing the import. 278 /// May return no edit in edge cases, such as scope already containing the import.
280 pub fn to_text_edit(&self) -> Option<TextEdit> { 279 pub fn to_text_edit(&self, merge_behavior: Option<MergeBehavior>) -> Option<TextEdit> {
281 let _p = profile::span("ImportEdit::to_text_edit"); 280 let _p = profile::span("ImportEdit::to_text_edit");
282 281
283 let rewriter = insert_use::insert_use( 282 let rewriter = insert_use::insert_use(
284 &self.import_scope, 283 &self.import_scope,
285 mod_path_to_ast(&self.import_path), 284 mod_path_to_ast(&self.import_path),
286 self.merge_behavior, 285 merge_behavior,
287 ); 286 );
288 let old_ast = rewriter.rewrite_root()?; 287 let old_ast = rewriter.rewrite_root()?;
289 let mut import_insert = TextEdit::builder(); 288 let mut import_insert = TextEdit::builder();