-
-
Notifications
You must be signed in to change notification settings - Fork 414
Open
Labels
feat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)Related to Lua Language Server Annotations (LuaCats)feat/type checkRelated to the type checking featureRelated to the type checking feature
Description
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?
Completion
Expected Behaviour
Using ---@type table<KeyType, ValueType> on a table should always keep auto-complete available for keys within the table.
Actual Behaviour
Auto-complete breaks if the table that ---@type was used on is global or within a class.
Reproduction steps
Scenario where auto-complete works:
---@class MyClass
---@field MyThings any
---@type table<string, MyClass>
local SomeTable = {
SomeKey = {MyField = 1},
SomeKey2 = {MyField = 1},
}Scenario where auto-complete does not work:
---@class MyClass
---@field MyThings any
---@type table<string, MyClass>
SomeTable = {
SomeKey = {MyField = 1},
SomeKey2 = {MyField = 1},
}No auto-complete will be available for SomeTable there. This also occurs if SomeTable is within a table marked with ---@class.
Additional Notes
No response
Log File
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)Related to Lua Language Server Annotations (LuaCats)feat/type checkRelated to the type checking featureRelated to the type checking feature
