aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/auto_import.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-29 13:44:14 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-29 13:44:14 +0100
commit9e2925f340bfd109ce31e8e454187df30e609a60 (patch)
tree5681a25e5efc84697c55d4b7ef47b012a711304a /crates/ra_assists/src/auto_import.rs
parentbf1369cdef1b11ce7ba3a289ae6c4187b6fa5854 (diff)
parent61739b0c177ea96c9ad253e41ee2c1a620d98b47 (diff)
Merge #1621
1621: Document AssistBuilder r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/auto_import.rs')
-rw-r--r--crates/ra_assists/src/auto_import.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/crates/ra_assists/src/auto_import.rs b/crates/ra_assists/src/auto_import.rs
index 43e75eee1..a32e2f9b6 100644
--- a/crates/ra_assists/src/auto_import.rs
+++ b/crates/ra_assists/src/auto_import.rs
@@ -562,9 +562,12 @@ pub(crate) fn auto_import(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist
562 AssistId("auto_import"), 562 AssistId("auto_import"),
563 format!("import {} in mod {}", fmt_segments(&segments), name.text()), 563 format!("import {} in mod {}", fmt_segments(&segments), name.text()),
564 |edit| { 564 |edit| {
565 let mut text_edit = TextEditBuilder::default(); 565 apply_auto_import(
566 apply_auto_import(item_list.syntax(), &path, &segments, &mut text_edit); 566 item_list.syntax(),
567 edit.set_edit_builder(text_edit); 567 &path,
568 &segments,
569 edit.text_edit_builder(),
570 );
568 }, 571 },
569 ); 572 );
570 } 573 }
@@ -574,9 +577,12 @@ pub(crate) fn auto_import(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist
574 AssistId("auto_import"), 577 AssistId("auto_import"),
575 format!("import {} in the current file", fmt_segments(&segments)), 578 format!("import {} in the current file", fmt_segments(&segments)),
576 |edit| { 579 |edit| {
577 let mut text_edit = TextEditBuilder::default(); 580 apply_auto_import(
578 apply_auto_import(current_file.syntax(), &path, &segments, &mut text_edit); 581 current_file.syntax(),
579 edit.set_edit_builder(text_edit); 582 &path,
583 &segments,
584 edit.text_edit_builder(),
585 );
580 }, 586 },
581 ); 587 );
582 } 588 }