diff options
author | Igor Aleksanov <[email protected]> | 2020-10-04 05:39:35 +0100 |
---|---|---|
committer | Igor Aleksanov <[email protected]> | 2020-10-12 09:05:00 +0100 |
commit | b42562b5dee4f4ce23094c7bab6406e3b00f90ad (patch) | |
tree | 8711713d749b19f22a534bb3dd1925063d1baade /crates/ide | |
parent | 9ec1741b651bd13e4e5e6224f2e2c5c503846a6b (diff) |
Make incorrect case diagnostic work inside of functions
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/diagnostics.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index ad1b265fd..70d5cbd38 100644 --- a/crates/ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs | |||
@@ -879,5 +879,31 @@ pub fn some_fn(val: u8) -> u8 { | |||
879 | } | 879 | } |
880 | "#, | 880 | "#, |
881 | ); | 881 | ); |
882 | |||
883 | check_fixes( | ||
884 | r#" | ||
885 | fn some_fn() { | ||
886 | let whatAWeird_Formatting<|> = 10; | ||
887 | another_func(whatAWeird_Formatting); | ||
888 | } | ||
889 | "#, | ||
890 | r#" | ||
891 | fn some_fn() { | ||
892 | let what_a_weird_formatting = 10; | ||
893 | another_func(what_a_weird_formatting); | ||
894 | } | ||
895 | "#, | ||
896 | ); | ||
897 | } | ||
898 | |||
899 | #[test] | ||
900 | fn test_uppercase_const_no_diagnostics() { | ||
901 | check_no_diagnostics( | ||
902 | r#" | ||
903 | fn foo() { | ||
904 | const ANOTHER_ITEM<|>: &str = "some_item"; | ||
905 | } | ||
906 | "#, | ||
907 | ); | ||
882 | } | 908 | } |
883 | } | 909 | } |