aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-04-22 13:56:28 +0100
committerAleksey Kladov <[email protected]>2019-04-22 13:56:28 +0100
commite01052d1f0b8bf70a418a10538528923c5f400d5 (patch)
tree18ed1c151e7782b791214df4c4a2966c617ae1c6 /crates/ra_assists/src
parent200032852be0c66b978c875a8edf0eca1f08b901 (diff)
move auto-imoprter into IDE
auto-import is purely an IDE concern, so it should be done outside of HIR
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r--crates/ra_assists/src/auto_import.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/crates/ra_assists/src/auto_import.rs b/crates/ra_assists/src/auto_import.rs
index b002d0e4d..7c856c19b 100644
--- a/crates/ra_assists/src/auto_import.rs
+++ b/crates/ra_assists/src/auto_import.rs
@@ -492,7 +492,6 @@ fn apply_auto_import(
492 } 492 }
493} 493}
494 494
495#[allow(unused)]
496pub fn collect_hir_path_segments(path: &hir::Path) -> Vec<SmolStr> { 495pub fn collect_hir_path_segments(path: &hir::Path) -> Vec<SmolStr> {
497 let mut ps = Vec::<SmolStr>::with_capacity(10); 496 let mut ps = Vec::<SmolStr>::with_capacity(10);
498 match path.kind { 497 match path.kind {
@@ -503,7 +502,7 @@ pub fn collect_hir_path_segments(path: &hir::Path) -> Vec<SmolStr> {
503 hir::PathKind::Super => ps.push("super".into()), 502 hir::PathKind::Super => ps.push("super".into()),
504 } 503 }
505 for s in path.segments.iter() { 504 for s in path.segments.iter() {
506 ps.push(s.name.to_smolstr()); 505 ps.push(s.name.to_string().into());
507 } 506 }
508 ps 507 ps
509} 508}
@@ -511,7 +510,6 @@ pub fn collect_hir_path_segments(path: &hir::Path) -> Vec<SmolStr> {
511// This function produces sequence of text edits into edit 510// This function produces sequence of text edits into edit
512// to import the target path in the most appropriate scope given 511// to import the target path in the most appropriate scope given
513// the cursor position 512// the cursor position
514#[allow(unused)]
515pub fn auto_import_text_edit( 513pub fn auto_import_text_edit(
516 // Ideally the position of the cursor, used to 514 // Ideally the position of the cursor, used to
517 position: &SyntaxNode, 515 position: &SyntaxNode,