aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-23 19:44:27 +0000
committerGitHub <[email protected]>2020-12-23 19:44:27 +0000
commit01a3fd960089d562dac328221c93875cabad1d51 (patch)
treed8be03a88428d644eb845ccec2959aab86d47d58 /crates/ide/src
parent3d5d21b60253e94bf1a96a4fdb2d23d7c52d1480 (diff)
parentbfae2634b496caa54f38f4c22d285c5fc1dad190 (diff)
Merge #7022
7022: Prevent multiple incorrect case diagnostics in functions r=lnicola a=unexge Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6970 Co-authored-by: unexge <[email protected]>
Diffstat (limited to 'crates/ide/src')
-rw-r--r--crates/ide/src/diagnostics.rs13
1 files changed, 13 insertions, 0 deletions
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 {
895"#, 895"#,
896 ); 896 );
897 } 897 }
898
899 #[test]
900 fn test_single_incorrect_case_diagnostic_in_function_name_issue_6970() {
901 let input = r#"fn FOO<|>() {}"#;
902 let expected = r#"fn foo() {}"#;
903
904 let (analysis, file_position) = fixture::position(input);
905 let diagnostics =
906 analysis.diagnostics(&DiagnosticsConfig::default(), file_position.file_id).unwrap();
907 assert_eq!(diagnostics.len(), 1);
908
909 check_fixes(input, expected);
910 }
898} 911}