Skip to content

Commit 0089cad

Browse files
committed
整理配置项
1 parent 868fa79 commit 0089cad

File tree

4 files changed

+8
-29
lines changed

4 files changed

+8
-29
lines changed

crates/emmylua_code_analysis/resources/schema.json

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
"strict": {
160160
"default": {
161161
"arrayIndex": true,
162-
"docIntegerMatchInt": true,
162+
"docIntegerConstMatchInt": true,
163163
"metaOverrideFileDefine": true,
164164
"requirePath": false,
165165
"typeCall": false
@@ -267,13 +267,6 @@
267267
"redundant-parameter"
268268
]
269269
},
270-
{
271-
"description": "Inject field fail",
272-
"type": "string",
273-
"enum": [
274-
"inject-field-fail"
275-
]
276-
},
277270
{
278271
"description": "Unreachable code",
279272
"type": "string",
@@ -316,13 +309,6 @@
316309
"discard-returns"
317310
]
318311
},
319-
{
320-
"description": "Disable global define",
321-
"type": "string",
322-
"enum": [
323-
"disable-global-define"
324-
]
325-
},
326312
{
327313
"description": "Undefined field",
328314
"type": "string",
@@ -365,13 +351,6 @@
365351
"redefined-label"
366352
]
367353
},
368-
{
369-
"description": "Name Style check",
370-
"type": "string",
371-
"enum": [
372-
"name-style-check"
373-
]
374-
},
375354
{
376355
"description": "Code style check",
377356
"type": "string",
@@ -946,8 +925,8 @@
946925
"default": true,
947926
"type": "boolean"
948927
},
949-
"docIntegerMatchInt": {
950-
"description": "`doc_integer` type can match `int` type.",
928+
"docIntegerConstMatchInt": {
929+
"description": "`doc_integer_const` type can match `int` type.",
951930
"default": false,
952931
"type": "boolean"
953932
},

crates/emmylua_code_analysis/src/config/configs/strict.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ pub struct EmmyrcStrict {
2424
/// meta define overrides file define
2525
#[serde(default = "default_true")]
2626
pub meta_override_file_define: bool,
27-
/// `doc_integer` type can match `int` type.
27+
/// `doc_integer_const` type can match `int` type.
2828
#[serde(default = "default_false")]
29-
pub doc_integer_match_int: bool,
29+
pub doc_integer_const_match_int: bool,
3030
}
3131

3232
impl Default for EmmyrcStrict {
@@ -36,7 +36,7 @@ impl Default for EmmyrcStrict {
3636
type_call: false,
3737
array_index: true,
3838
meta_override_file_define: true,
39-
doc_integer_match_int: true,
39+
doc_integer_const_match_int: true,
4040
}
4141
}
4242
}

crates/emmylua_code_analysis/src/diagnostic/test/param_type_check_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ mod test {
10241024
fn test_int_to_alias() {
10251025
let mut ws = VirtualWorkspace::new();
10261026
let mut emmyrc = ws.analysis.get_emmyrc().deref().clone();
1027-
emmyrc.strict.doc_integer_match_int = true;
1027+
emmyrc.strict.doc_integer_const_match_int = true;
10281028
ws.analysis.update_config(Arc::new(emmyrc));
10291029

10301030
assert!(ws.check_code_for(

crates/emmylua_code_analysis/src/semantic/type_check/simple_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub fn check_simple_type_compact(
131131
return Err(TypeCheckFailReason::TypeNotMatch);
132132
}
133133
LuaType::Integer => {
134-
if db.get_emmyrc().strict.doc_integer_match_int {
134+
if db.get_emmyrc().strict.doc_integer_const_match_int {
135135
return Ok(());
136136
}
137137
return Err(TypeCheckFailReason::TypeNotMatch);

0 commit comments

Comments
 (0)