mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
minor: it's Parameter, not Argument
This commit is contained in:
parent
341f8bb200
commit
159922de93
2 changed files with 5 additions and 5 deletions
|
@ -349,11 +349,11 @@ impl fmt::Display for CaseType {
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum IdentType {
|
pub enum IdentType {
|
||||||
Argument,
|
|
||||||
Constant,
|
Constant,
|
||||||
Enum,
|
Enum,
|
||||||
Field,
|
Field,
|
||||||
Function,
|
Function,
|
||||||
|
Parameter,
|
||||||
StaticVariable,
|
StaticVariable,
|
||||||
Structure,
|
Structure,
|
||||||
Variable,
|
Variable,
|
||||||
|
@ -363,11 +363,11 @@ pub enum IdentType {
|
||||||
impl fmt::Display for IdentType {
|
impl fmt::Display for IdentType {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
let repr = match self {
|
let repr = match self {
|
||||||
IdentType::Argument => "Argument",
|
|
||||||
IdentType::Constant => "Constant",
|
IdentType::Constant => "Constant",
|
||||||
IdentType::Enum => "Enum",
|
IdentType::Enum => "Enum",
|
||||||
IdentType::Field => "Field",
|
IdentType::Field => "Field",
|
||||||
IdentType::Function => "Function",
|
IdentType::Function => "Function",
|
||||||
|
IdentType::Parameter => "Parameter",
|
||||||
IdentType::StaticVariable => "Static variable",
|
IdentType::StaticVariable => "Static variable",
|
||||||
IdentType::Structure => "Structure",
|
IdentType::Structure => "Structure",
|
||||||
IdentType::Variable => "Variable",
|
IdentType::Variable => "Variable",
|
||||||
|
|
|
@ -256,7 +256,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let ident_type =
|
let ident_type =
|
||||||
if is_param { IdentType::Argument } else { IdentType::Variable };
|
if is_param { IdentType::Parameter } else { IdentType::Variable };
|
||||||
|
|
||||||
let diagnostic = IncorrectCase {
|
let diagnostic = IncorrectCase {
|
||||||
file: source_ptr.file_id,
|
file: source_ptr.file_id,
|
||||||
|
@ -643,10 +643,10 @@ fn NonSnakeCaseName() {}
|
||||||
check_diagnostics(
|
check_diagnostics(
|
||||||
r#"
|
r#"
|
||||||
fn foo(SomeParam: u8) {}
|
fn foo(SomeParam: u8) {}
|
||||||
// ^^^^^^^^^ Argument `SomeParam` should have snake_case name, e.g. `some_param`
|
// ^^^^^^^^^ Parameter `SomeParam` should have snake_case name, e.g. `some_param`
|
||||||
|
|
||||||
fn foo2(ok_param: &str, CAPS_PARAM: u8) {}
|
fn foo2(ok_param: &str, CAPS_PARAM: u8) {}
|
||||||
// ^^^^^^^^^^ Argument `CAPS_PARAM` should have snake_case name, e.g. `caps_param`
|
// ^^^^^^^^^^ Parameter `CAPS_PARAM` should have snake_case name, e.g. `caps_param`
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue