LuaLS / LuaLS/lua-language-server
Feature Request: Missing Field Diagnostic on Non-Class Table Types
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Lua
- Star
- 4.4k
- Fork
- 442
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
(Split from: https://github.com/LuaLS/lua-language-server/issues/2279)
Currently the missing-field diagnostic only works for classes. I sometimes use tables directly instead of classes and it would be nice to still be able to get missing-field warnings:
Ex:
```
---@param audience { [0]: "SELECT", ["peer_ids"]: string | string[] } who to send event to
function Events.send_event(audience, event, ...)
end
Events.send_event({})
```
and
```
---@param audience { [0]: "SELECT", peer_ids: string | string[] } who to send event to
function Events.send_event(audience, event, ...)
end
Events.send_event({})
```
gives no errors
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Start by reproducing the two Events.send_event examples from the issue and inspect the existing missing-field diagnostic behavior for classes. Trace how the table parameter types in those examples are analyzed, then verify that calls passing {} report the required fields without changing the existing class behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- lua
- Lĩnh vực
- devtools
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100