Skip to content

Commit b4e89c5

Browse files
committed
rename ParamTypeNotMatch to ParamTypeMismatch
1 parent 0989890 commit b4e89c5

File tree

12 files changed

+81
-81
lines changed

12 files changed

+81
-81
lines changed

crates/emmylua_code_analysis/resources/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
{
190190
"description": "Param Type not match",
191191
"type": "string",
192-
"const": "param-type-not-match"
192+
"const": "param-type-mismatch"
193193
},
194194
{
195195
"description": "Missing parameter",

crates/emmylua_code_analysis/src/compilation/test/decl_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ mod test {
4242
fn test_3() {
4343
let mut ws = VirtualWorkspace::new();
4444
assert!(ws.check_code_for(
45-
DiagnosticCode::ParamTypeNotMatch,
45+
DiagnosticCode::ParamTypeMismatch,
4646
r#"
4747
---@return any ...
4848
---@return integer offset

crates/emmylua_code_analysis/src/compilation/test/flow.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ mod test {
121121
fn test_issue_93() {
122122
let mut ws = VirtualWorkspace::new_with_init_std_lib();
123123
assert!(ws.check_code_for(
124-
DiagnosticCode::ParamTypeNotMatch,
124+
DiagnosticCode::ParamTypeMismatch,
125125
r#"
126126
local text --- @type string[]?
127127
if staged then
@@ -167,7 +167,7 @@ mod test {
167167
fn test_issue_162() {
168168
let mut ws = VirtualWorkspace::new();
169169
assert!(ws.check_code_for(
170-
DiagnosticCode::ParamTypeNotMatch,
170+
DiagnosticCode::ParamTypeMismatch,
171171
r#"
172172
--- @class Foo
173173
--- @field a? fun()
@@ -240,7 +240,7 @@ print(a.field)
240240
let mut ws = VirtualWorkspace::new();
241241

242242
assert!(ws.check_code_for(
243-
DiagnosticCode::ParamTypeNotMatch,
243+
DiagnosticCode::ParamTypeMismatch,
244244
r#"
245245
--- @class A
246246
--- @field b integer
@@ -1089,7 +1089,7 @@ end
10891089
"#,
10901090
);
10911091
assert!(ws.check_code_for(
1092-
DiagnosticCode::ParamTypeNotMatch,
1092+
DiagnosticCode::ParamTypeMismatch,
10931093
r#"
10941094
---@param target A | B
10951095
function test(target)

crates/emmylua_code_analysis/src/compilation/test/metatable_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ mod test {
2222
);
2323

2424
assert!(!ws.check_code_for(
25-
DiagnosticCode::ParamTypeNotMatch,
25+
DiagnosticCode::ParamTypeMismatch,
2626
r#"
2727
cmd(1)
2828
"#
2929
));
3030

3131
assert!(ws.check_code_for(
32-
DiagnosticCode::ParamTypeNotMatch,
32+
DiagnosticCode::ParamTypeMismatch,
3333
r#"
3434
cmd("hello)
3535
"#
3636
));
3737

3838
assert!(ws.check_code_for(
39-
DiagnosticCode::ParamTypeNotMatch,
39+
DiagnosticCode::ParamTypeMismatch,
4040
r#"
4141
cmd({ "hello", "world" })
4242
"#

crates/emmylua_code_analysis/src/compilation/test/overload_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mod test {
88
let mut ws = VirtualWorkspace::new_with_init_std_lib();
99

1010
assert!(ws.check_code_for(
11-
DiagnosticCode::ParamTypeNotMatch,
11+
DiagnosticCode::ParamTypeMismatch,
1212
r#"
1313
table.concat({'', ''}, ' ')
1414
"#

crates/emmylua_code_analysis/src/compilation/test/pcall_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mod test {
2727
let mut ws = VirtualWorkspace::new_with_init_std_lib();
2828

2929
assert!(ws.check_code_for(
30-
DiagnosticCode::ParamTypeNotMatch,
30+
DiagnosticCode::ParamTypeMismatch,
3131
r#"
3232
---@class D11.AAA
3333
local AAA = {}

crates/emmylua_code_analysis/src/compilation/test/return_unwrap_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ mod test {
3030
let mut ws = VirtualWorkspace::new_with_init_std_lib();
3131

3232
assert!(ws.check_code_for(
33-
crate::DiagnosticCode::ParamTypeNotMatch,
33+
crate::DiagnosticCode::ParamTypeMismatch,
3434
r#"
3535
---Converts hex to char
3636
---@param hex string

crates/emmylua_code_analysis/src/compilation/test/type_check_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mod test {
2323
let mut ws = VirtualWorkspace::new();
2424

2525
assert!(ws.check_code_for(
26-
DiagnosticCode::ParamTypeNotMatch,
26+
DiagnosticCode::ParamTypeMismatch,
2727
r#"
2828
--- @alias Dir -1|1
2929

crates/emmylua_code_analysis/src/diagnostic/checker/param_type_check.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct ParamTypeCheckChecker;
1313

1414
impl Checker for ParamTypeCheckChecker {
1515
const CODES: &[DiagnosticCode] = &[
16-
DiagnosticCode::ParamTypeNotMatch,
16+
DiagnosticCode::ParamTypeMismatch,
1717
DiagnosticCode::AssignTypeMismatch,
1818
];
1919

@@ -196,7 +196,7 @@ fn add_type_check_diagnostic(
196196
TypeCheckFailReason::TypeRecursion => "type recursion".to_string(),
197197
};
198198
context.add_diagnostic(
199-
DiagnosticCode::ParamTypeNotMatch,
199+
DiagnosticCode::ParamTypeMismatch,
200200
range,
201201
t!(
202202
"expected `%{source}` but found `%{found}`. %{reason}",

crates/emmylua_code_analysis/src/diagnostic/lua_diagnostic_code.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub enum DiagnosticCode {
1818
/// Missing return statement
1919
MissingReturn,
2020
/// Param Type not match
21-
ParamTypeNotMatch,
21+
ParamTypeMismatch,
2222
/// Missing parameter
2323
MissingParameter,
2424
/// Redundant parameter
@@ -125,7 +125,7 @@ pub fn get_default_severity(code: DiagnosticCode) -> DiagnosticSeverity {
125125
DiagnosticCode::DocSyntaxError => DiagnosticSeverity::ERROR,
126126
DiagnosticCode::TypeNotFound => DiagnosticSeverity::WARNING,
127127
DiagnosticCode::MissingReturn => DiagnosticSeverity::WARNING,
128-
DiagnosticCode::ParamTypeNotMatch => DiagnosticSeverity::WARNING,
128+
DiagnosticCode::ParamTypeMismatch => DiagnosticSeverity::WARNING,
129129
DiagnosticCode::MissingParameter => DiagnosticSeverity::WARNING,
130130
DiagnosticCode::UnreachableCode => DiagnosticSeverity::HINT,
131131
DiagnosticCode::Unused => DiagnosticSeverity::HINT,

0 commit comments

Comments
 (0)