We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Visual Studio Code Extension (sumneko.lua)
Windows
Type Checking, Hover
Consider:
local enum = { a = 1, b = 2 } local t = { [enum.a] = true, [enum.b] = 2, [3] = {} }
When hovering over the table t, I see:
t
local t: { ["a"]: boolean = true, ["b"]: integer = 2, [3]: table }
It's not only about hovering though, for example:
---@type { [integer] : boolean } local t = { [enum.a] = true, [enum.b] = 2, [3] = {} }
I only get a type warning for the index [3] = {}, and no warnings for [enum.b] = 2.
[3] = {}
[enum.b] = 2
The hover should show:
local t: { [1]: boolean = true, [2]: integer = 2, [3]: table }
And in the example with @type { [integer] : boolean }, I should get a warning about incorrect values.
@type { [integer] : boolean }
See the examples in the Expected Behavior section.
No response
The text was updated successfully, but these errors were encountered:
fix wrong infer of tableindex
02f6831
#1831
c69e65f
No branches or pull requests
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, Hover
Expected Behaviour
Consider:
When hovering over the table
t
, I see:It's not only about hovering though, for example:
I only get a type warning for the index
[3] = {}
, and no warnings for[enum.b] = 2
.Actual Behaviour
The hover should show:
And in the example with
@type { [integer] : boolean }
, I should get a warning about incorrect values.Reproduction steps
See the examples in the Expected Behavior section.
Additional Notes
No response
Log File
No response
The text was updated successfully, but these errors were encountered: