mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Make incorrect case diagnostic work inside of functions
This commit is contained in:
parent
9ec1741b65
commit
b42562b5de
4 changed files with 280 additions and 33 deletions
|
@ -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";
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue