You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enum attributes can be access either via the key or the value of the corresponding enum, right now we are only using the value. This results in some annoying behaviour:
---@typetiletypelocalttype=dfhack.maps.getTileType(engraving.pos)
localtileattrs=df.tiletype.attrs[ttype] -- Cast as `unknown` even though this is a valid index.
The biggest issue is going to be figuring out how to do this without doubling the size of enums (again):
Even more annoyingly, it looks like accessing known class fields by a known integer variable is unsupported in LuaLS:
---@classFoo---@field[0]"I am a string"localfoolocalbar=0localtest=foo[bar] -- This _should_ result in test being known, but it is marked as "unknown" instead.
Enum attributes can be access either via the key or the value of the corresponding enum, right now we are only using the value. This results in some annoying behaviour:
The biggest issue is going to be figuring out how to do this without doubling the size of enums (again):
---@field FrozenRampTrackNEW { caption: "ice ramp track NEW", shape: "RAMP", material: "FROZEN_LIQUID", variant: "NONE", special: "TRACK", direction: "NEW" }```
Would change into:
For enums with hundreds of attributes, it is less than ideal.
The text was updated successfully, but these errors were encountered: