-
Notifications
You must be signed in to change notification settings - Fork 23
update #404
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
base: main
Are you sure you want to change the base?
update #404
Conversation
cba0680
to
774acdb
Compare
651160d
to
0672d6b
Compare
diagnostic_code, | ||
), | ||
); | ||
diagnostic_index.add_file_diagnostic_disabled(analyzer.file_id, DiagnosticCode::All); |
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.
不要添加all字段
signature.resolve_return = SignatureReturnStatus::InferResolve; | ||
|
||
if returns.len() == 1 && returns[0].type_ref.is_nil() { |
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.
改变这里的写法
for ty in types.iter() { | ||
if ty.is_nil() { | ||
if (!is_hover && !ty.is_function() && ty.is_nil()) || (is_hover && ty.is_nil()) { |
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.
这是什么奇妙逻辑
把goto implement单列一项PR出来 |
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.
Pull Request Overview
This PR updates type operation APIs to pass a database reference (db) into TypeOps functions and updates test cases accordingly, while also refining type‐removal, union formatting, and some alias resolution behaviors.
- Updated TypeOps API to consistently require a DbIndex parameter.
- Refactored tests to use temporary type variables.
- Improved handling for alias types and diagnostic disabling.
Reviewed Changes
Copilot reviewed 65 out of 66 changed files in this pull request and generated no comments.
File | Description |
---|---|
crates/emmylua_code_analysis/src/db_index/type/type_ops/test.rs | Refactored tests to use local variables and updated TypeOps::apply calls. |
crates/emmylua_code_analysis/src/db_index/type/type_ops/remove_type.rs | Updated remove_type signature with db parameter and modified union‐removal behavior. |
crates/emmylua_code_analysis/src/db_index/type/humanize_type.rs | Adjusted union type formatting and added new handling for function types. |
Other files (various analyzer and diagnostic modules) | Updated calls to TypeOps functions to pass db; overall API consistency improvements. |
Files not reviewed (1)
- crates/emmylua_code_analysis/resources/schema.json: Language not supported
Comments suppressed due to low confidence (3)
crates/emmylua_code_analysis/src/db_index/type/humanize_type.rs:218
- [nitpick] The formatting branch for union types when both functions and nil are present is not immediately clear. Consider adding an inline comment explaining the rationale behind wrapping the type string in parentheses and appending a '?' in this case.
if has_function && has_nil {
crates/emmylua_code_analysis/src/compilation/analyzer/unresolve/resolve_closure.rs:303
- [nitpick] The new branch for handling a union of function types in closure resolution is complex. It would be beneficial to include an inline comment clarifying the purpose of merging doc function overloads and how the final parameter types are determined.
LuaType::Union(union_types) => {
crates/emmylua_code_analysis/src/db_index/type/type_ops/remove_type.rs:141
- Changing the behavior to return Some(LuaType::Nil) when no removed types remain may affect downstream type inference logic. Please confirm that this change in union removal behavior is intentional and that all affected code paths have been updated accordingly.
match types.len() {
拆不出来, 依赖于之前的提交 |
optimize searcher member implementation
fixes #406
fixes #407
fixes #393
fixes #330
fixes #369
fixes #373
fixes #374