Incorrect type on string-key fields when combined with `[string]`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Không có tệp hoặc bài kiểm thử nào trong repository được nêu tên. Hãy bắt đầu bằng cách tái hiện việc tra cứu GlobalModSettings có chú thích trong Lua language server thông qua Visual Studio Code extension, sau đó lần theo quá trình phân giải kiểu của các trường được lập chỉ mục. Được xem là hoàn thành khi một trường có khóa chuỗi chính xác nhận được kiểu hẹp hơn của nó thay vì kiểu trường [string] rộng hơn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Type Checking
Expected Behaviour
we have a (generated) class like
---@class GlobalModSettings
---@field ["heat-visualizer-updates-per-surface-per-tick"] ModSetting<int32>
---@field ["nixie-tube-update-speed-alpha"] ModSetting<int32>
---@field ["nixie-tube-update-speed-numeric"] ModSetting<int32>
---@field [string] ModSetting<(int32)|(double)|(boolean)|(string)|(Color)>
which has narrower types for the known entries and a general type for the "everything else" field, but when i then use this type like
local x = settings.global["heat-visualizer-updates-per-surface-per-tick"]
x is given the type from the [string] field, rather than the one that is an exact match for that specific string
Actual Behaviour
(this template is always off screen and i've written the whole thing in the first box...)
Reproduction steps
(this template is always off screen and i've written the whole thing in the first box...)
Additional Notes
No response
Log File
No response
- Ngôn ngữ chính
- Lua
- Star
- 4.4k
- Fork
- 442
- Merge trung bình
- 8 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 1
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.
Issue khác của LuaLS/lua-language-server
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
LuaLS/lua-language-server#1776 ·
-
泛型for迭代器的类型推导漏掉了带__call的类 Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
LuaLS/lua-language-server#3463 · 5 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
LuaLS/lua-language-server#3461 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
LuaLS/lua-language-server#3460 · 1 bình luận · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
LuaLS/lua-language-server#3459 · 1 reaction ·
Tất cả issue của LuaLS/lua-language-server
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
LandSandBoat/server#11579 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ArchiveTeam/sinavideo-grab#7 · 3 reaction ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mailcow/mailcow-dockerized#7480 ·
-
Mapper: a failed area image export crashes Mudlet if the profile closed while it was running Đang mởmapper bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
documentation feature-request mini.completion
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100