aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-06-10 15:04:55 +0100
committerJonas Schievink <[email protected]>2020-06-10 15:04:55 +0100
commit7e83ed99a887f959bd4cf97357faf373a09f9269 (patch)
tree31e55b5e2c28b71b5ebc9549da45e84e1c0ec701 /crates/ra_assists/src
parented2817e599a9c0e812af26587badad6da7a4d949 (diff)
Respect casing when searching for imports
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r--crates/ra_assists/src/handlers/auto_import.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/ra_assists/src/handlers/auto_import.rs b/crates/ra_assists/src/handlers/auto_import.rs
index 86a173ff5..5092bf336 100644
--- a/crates/ra_assists/src/handlers/auto_import.rs
+++ b/crates/ra_assists/src/handlers/auto_import.rs
@@ -917,4 +917,29 @@ fn main() {
917", 917",
918 ); 918 );
919 } 919 }
920
921 #[test]
922 fn casing() {
923 // Tests that differently cased names don't interfere and we only suggest the matching one.
924 check_assist(
925 auto_import,
926 r"
927 //- /lib.rs crate:dep
928
929 pub struct FMT;
930 pub struct fmt;
931
932 //- /main.rs crate:main deps:dep
933
934 fn main() {
935 FMT<|>;
936 }",
937 r"use dep::FMT;
938
939fn main() {
940 FMT;
941}
942",
943 );
944 }
920} 945}