Add checks for function parameters

This commit is contained in:
Igor Aleksanov 2020-10-03 13:39:10 +03:00
parent 4039176ec6
commit f5cea35986
2 changed files with 94 additions and 7 deletions

View file

@ -269,6 +269,7 @@ pub struct IncorrectCase {
pub file: HirFileId,
pub ident: SyntaxNodePtr,
pub expected_case: CaseType,
pub ident_type: String,
pub ident_text: String,
pub suggested_text: String,
}
@ -280,7 +281,8 @@ impl Diagnostic for IncorrectCase {
fn message(&self) -> String {
format!(
"Argument `{}` should have a {} name, e.g. `{}`",
"{} `{}` should have a {} name, e.g. `{}`",
self.ident_type,
self.ident_text,
self.expected_case.to_string(),
self.suggested_text