From b42562b5dee4f4ce23094c7bab6406e3b00f90ad Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Sun, 4 Oct 2020 07:39:35 +0300 Subject: Make incorrect case diagnostic work inside of functions --- crates/ide/src/diagnostics.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'crates/ide/src/diagnostics.rs') 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 @@ -877,6 +877,32 @@ pub fn SomeFn<|>(val: u8) -> u8 { pub fn some_fn(val: u8) -> u8 { if val != 0 { some_fn(val - 1) } else { val } } +"#, + ); + + check_fixes( + r#" +fn some_fn() { + let whatAWeird_Formatting<|> = 10; + another_func(whatAWeird_Formatting); +} +"#, + r#" +fn some_fn() { + let what_a_weird_formatting = 10; + another_func(what_a_weird_formatting); +} +"#, + ); + } + + #[test] + fn test_uppercase_const_no_diagnostics() { + check_no_diagnostics( + r#" +fn foo() { + const ANOTHER_ITEM<|>: &str = "some_item"; +} "#, ); } -- cgit v1.2.3