Apply case check diagnostic to impl items

This commit is contained in:
Igor Aleksanov 2020-10-04 09:12:00 +03:00
parent 2a72f876d6
commit 50a147dcdf
2 changed files with 26 additions and 1 deletions

View File

@ -781,7 +781,8 @@ pub fn is_unsafe(self, db: &dyn HirDatabase) -> bool {
}
pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) {
hir_ty::diagnostics::validate_body(db, self.id.into(), sink)
hir_ty::diagnostics::validate_module_item(db, self.id.into(), sink);
hir_ty::diagnostics::validate_body(db, self.id.into(), sink);
}
/// Whether this function declaration has a definition.

View File

@ -903,6 +903,30 @@ fn test_uppercase_const_no_diagnostics() {
fn foo() {
const ANOTHER_ITEM<|>: &str = "some_item";
}
"#,
);
}
#[test]
fn test_rename_incorrect_case_struct_method() {
check_fixes(
r#"
pub struct TestStruct;
impl TestStruct {
pub fn SomeFn<|>() -> TestStruct {
TestStruct
}
}
"#,
r#"
pub struct TestStruct;
impl TestStruct {
pub fn some_fn() -> TestStruct {
TestStruct
}
}
"#,
);
}