From bfae2634b496caa54f38f4c22d285c5fc1dad190 Mon Sep 17 00:00:00 2001 From: unexge Date: Wed, 23 Dec 2020 22:18:31 +0300 Subject: Prevent multiple incorrect case diagnostics in functions --- crates/ide/src/diagnostics.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crates/ide/src') diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index 3ad30f0c9..b2714cb69 100644 --- a/crates/ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs @@ -895,4 +895,17 @@ impl TestStruct { "#, ); } + + #[test] + fn test_single_incorrect_case_diagnostic_in_function_name_issue_6970() { + let input = r#"fn FOO<|>() {}"#; + let expected = r#"fn foo() {}"#; + + let (analysis, file_position) = fixture::position(input); + let diagnostics = + analysis.diagnostics(&DiagnosticsConfig::default(), file_position.file_id).unwrap(); + assert_eq!(diagnostics.len(), 1); + + check_fixes(input, expected); + } } -- cgit v1.2.3