aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Aleksanov <[email protected]>2020-10-04 07:12:00 +0100
committerIgor Aleksanov <[email protected]>2020-10-12 09:05:00 +0100
commit50a147dcdfd0df462f0c24e5d7bcfe60abadac32 (patch)
tree2780778ac997df6bef7ad6072bbad8d75675d550
parent2a72f876d655da086e436838fdbc797a2ef71ece (diff)
Apply case check diagnostic to impl items
-rw-r--r--crates/hir/src/code_model.rs3
-rw-r--r--crates/ide/src/diagnostics.rs24
2 files changed, 26 insertions, 1 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index c134356ef..fb85041fd 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -781,7 +781,8 @@ impl Function {
781 } 781 }
782 782
783 pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) { 783 pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) {
784 hir_ty::diagnostics::validate_body(db, self.id.into(), sink) 784 hir_ty::diagnostics::validate_module_item(db, self.id.into(), sink);
785 hir_ty::diagnostics::validate_body(db, self.id.into(), sink);
785 } 786 }
786 787
787 /// Whether this function declaration has a definition. 788 /// Whether this function declaration has a definition.
diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs
index 70d5cbd38..8e508639b 100644
--- a/crates/ide/src/diagnostics.rs
+++ b/crates/ide/src/diagnostics.rs
@@ -906,4 +906,28 @@ fn foo() {
906"#, 906"#,
907 ); 907 );
908 } 908 }
909
910 #[test]
911 fn test_rename_incorrect_case_struct_method() {
912 check_fixes(
913 r#"
914pub struct TestStruct;
915
916impl TestStruct {
917 pub fn SomeFn<|>() -> TestStruct {
918 TestStruct
919 }
920}
921"#,
922 r#"
923pub struct TestStruct;
924
925impl TestStruct {
926 pub fn some_fn() -> TestStruct {
927 TestStruct
928 }
929}
930"#,
931 );
932 }
909} 933}