File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -374,8 +374,6 @@ impl Module {
374374 let crate_def_map = db. crate_def_map ( self . id . krate ) ;
375375 crate_def_map. add_diagnostics ( db. upcast ( ) , self . id . local_id , sink) ;
376376 for decl in self . declarations ( db) {
377- decl. diagnostics ( db, sink) ;
378-
379377 match decl {
380378 crate :: ModuleDef :: Function ( f) => f. diagnostics ( db, sink) ,
381379 crate :: ModuleDef :: Module ( m) => {
@@ -384,7 +382,9 @@ impl Module {
384382 m. diagnostics ( db, sink)
385383 }
386384 }
387- _ => ( ) ,
385+ _ => {
386+ decl. diagnostics ( db, sink) ;
387+ }
388388 }
389389 }
390390
Original file line number Diff line number Diff line change @@ -895,4 +895,17 @@ impl TestStruct {
895895"# ,
896896 ) ;
897897 }
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+ }
898911}
You can’t perform that action at this time.
0 commit comments