aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src/helpers/insert_use
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-06-08 21:14:30 +0100
committerLukas Wirth <[email protected]>2021-06-08 21:14:30 +0100
commit31aad2528f53349e9a0601c756d3c9f86ca9154c (patch)
treed2250c8e6ccb80eb236e1731db9f4e5c80e48e54 /crates/ide_db/src/helpers/insert_use
parent590472607c9629fdd37e3f6f33dacfdc2a3f56cc (diff)
Fix edge case for ImportGranularity guessing
Diffstat (limited to 'crates/ide_db/src/helpers/insert_use')
-rw-r--r--crates/ide_db/src/helpers/insert_use/tests.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ide_db/src/helpers/insert_use/tests.rs b/crates/ide_db/src/helpers/insert_use/tests.rs
index 78a2a87b3..70b11bf81 100644
--- a/crates/ide_db/src/helpers/insert_use/tests.rs
+++ b/crates/ide_db/src/helpers/insert_use/tests.rs
@@ -663,6 +663,13 @@ use foo::bar::qux;
663", 663",
664 ImportGranularityGuess::Item, 664 ImportGranularityGuess::Item,
665 ); 665 );
666 check_guess(
667 r"
668use foo::bar::Bar;
669use foo::baz;
670",
671 ImportGranularityGuess::Item,
672 );
666} 673}
667 674
668#[test] 675#[test]
@@ -682,6 +689,14 @@ use foo::{baz::{qux, quux}, bar};
682", 689",
683 ImportGranularityGuess::Module, 690 ImportGranularityGuess::Module,
684 ); 691 );
692 check_guess(
693 r"
694use foo::bar::Bar;
695use foo::baz::Baz;
696use foo::{Foo, Qux};
697",
698 ImportGranularityGuess::Module,
699 );
685} 700}
686 701
687#[test] 702#[test]