mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Make incorrect case diagnostic work inside of functions
This commit is contained in:
parent
9ec1741b65
commit
b42562b5de
4 changed files with 280 additions and 33 deletions
|
@ -281,7 +281,7 @@ impl Diagnostic for IncorrectCase {
|
|||
|
||||
fn message(&self) -> String {
|
||||
format!(
|
||||
"{} `{}` should have a {} name, e.g. `{}`",
|
||||
"{} `{}` should have {} name, e.g. `{}`",
|
||||
self.ident_type,
|
||||
self.ident_text,
|
||||
self.expected_case.to_string(),
|
||||
|
@ -339,6 +339,8 @@ mod tests {
|
|||
let impl_data = self.impl_data(impl_id);
|
||||
for item in impl_data.items.iter() {
|
||||
if let AssocItemId::FunctionId(f) = item {
|
||||
let mut sink = DiagnosticSinkBuilder::new().build(&mut cb);
|
||||
validate_module_item(self, ModuleDefId::FunctionId(*f), &mut sink);
|
||||
fns.push(*f)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue