-
-
Notifications
You must be signed in to change notification settings - Fork 384
Open
Description
How are you using the lua-language-server?
Other
Which OS are you using?
Windows
What is the issue affecting?
Diagnostics/Syntax Checking
Expected Behaviour
I might be wrong here, but I assume this should work?
Language server should detect the types from the defined tuple:
---@alias my_tuple { [1]: integer, [2]: boolean }
---@type my_tuple
local tuple = {1, true}
--- This works!
local a, b = tuple[1], tuple[2]
--- This gets "integer" for "c", but "unknown" for "d:
local c, d = table.unpack(tuple)
Actual Behaviour
---@alias my_tuple { [1]: integer, [2]: boolean }
---@type my_tuple
local tuple = {1, true}
--- "c" should be "integer" and "d" "boolean":
local c, d = table.unpack(tuple)
Reproduction steps
- Define tuple like I did
- Create such tuple
unpack
to two variables
Additional Notes
I'm not sure if this is a feature that is even considered, but since I do use unpack sometimes to destructure tuples into their distinct variables, I feel this would be a good feature to have.
Log File
No response
Metadata
Metadata
Assignees
Labels
No labels