Skip to content

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

Merged
merged 30 commits into from
Apr 25, 2025
Merged

update #381

merged 30 commits into from
Apr 25, 2025

Conversation

xuhuanzy
Copy link
Member

@xuhuanzy xuhuanzy commented Apr 19, 2025

fixes #382

@@ -23,7 +23,7 @@ impl Default for EmmyrcStrict {
Self {
require_path: false,
type_call: false,
array_index: true,
array_index: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why disable by default?

Copy link
Member Author

@xuhuanzy xuhuanzy Apr 21, 2025

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.

image

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改回去, 有需要的改配置

@xuhuanzy
Copy link
Member Author

@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...
Copy link
Member

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,
Copy link
Member

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> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

和存在的一个函数重复功能

Copy link
Member Author

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,
Copy link
Member

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));
Copy link
Member

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())
Copy link
Member

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()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同理

@xuhuanzy xuhuanzy requested a review from CppCXY April 25, 2025 09:40
@CppCXY CppCXY merged commit 885833e into EmmyLuaLs:main Apr 25, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flow 分析异常
3 participants