-
Notifications
You must be signed in to change notification settings - Fork 40
update #381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update #381
Conversation
@@ -23,7 +23,7 @@ impl Default for EmmyrcStrict { | |||
Self { | |||
require_path: false, | |||
type_call: false, | |||
array_index: true, | |||
array_index: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why disable by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because arrays in almost all languages do not return nullable values when accessing elements, whether the index is out of bounds should be handled by the user.
Moreover, we currently lack an effective way to suppress this warning individually. I think we can enable it by default after implementing the ---@as -?
syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改回去, 有需要的改配置
严格模式不应该默认启用
default `true`. 为`true`时在`meta`文件内定义的签名会覆盖`file`内的真实签名
@CppCXY 啥时候合并? 这么多提交等下冲突不好解决 |
@@ -304,9 +316,10 @@ function debug.traceback(thread, message, level) end | |||
--- access a same external local variable) will return identical ids for those | |||
--- upvalue indices. | |||
---@version >5.2, JIT | |||
---@param f fun():integer | |||
---@param f async fun(...):any... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改为function
@@ -23,7 +23,7 @@ impl Default for EmmyrcStrict { | |||
Self { | |||
require_path: false, | |||
type_call: false, | |||
array_index: true, | |||
array_index: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改回去, 有需要的改配置
@@ -145,6 +147,13 @@ impl LuaTypeDecl { | |||
} | |||
} | |||
|
|||
pub fn get_alias(&self) -> Option<&LuaType> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
和存在的一个函数重复功能
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没重复, 这个取得引用
@@ -109,7 +109,6 @@ pub fn get_default_severity(code: DiagnosticCode) -> DiagnosticSeverity { | |||
DiagnosticCode::InjectFieldFail => DiagnosticSeverity::ERROR, | |||
DiagnosticCode::UnreachableCode => DiagnosticSeverity::HINT, | |||
DiagnosticCode::Unused => DiagnosticSeverity::HINT, | |||
DiagnosticCode::UndefinedGlobal => DiagnosticSeverity::ERROR, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不准删
} else { | ||
let trace_info = UnResolveTraceInfo::Trace(trace_info); | ||
self.unresolve_traces.insert(trace_id, trace_info); | ||
self.unresolve_traces | ||
.insert(trace_id, (self.current_flow_id.unwrap(), trace_info)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
禁止新增unwrap
if next_guard.is_err() { | ||
return false; | ||
} | ||
check_general_type_compact(db, &source, field, next_guard.unwrap()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
禁止新增unwrap
if next_guard.is_err() { | ||
return false; | ||
} | ||
check_general_type_compact(db, source, t, next_guard.unwrap()).is_ok() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同理
fixes #382