Errors
Some function parameter names are invalid identifiers (such as end
, function
and containing .
). In parseParameter()
those need to be converted into valid identifiers, most likely by replacing all invalid characters with _
and appending an _
to keywords. Valid identifiers match the regex ^[a-zA-Z_][a-zA-Z0-9_]*$
, so basically replace everything that isn't [a-zA-Z0-9_]
and prepend with an _
if the first char is a number.
Warnings
All defines are getting the undefined global number
assigned to them. Even if that is currently a placeholder, it either needs to be a defined global or local or (imo preferably) just 0
.
All the basic types generate undefined-doc-name
warnings. Aliases seem to just replace the name you actually want, but we either have to take that compromise or we try out this and see how it goes:
---@class float : number
---@class double : number
---@class int : number
---@class int8 : number
---@class uint : number
---@class uint8 : number
---@class uint16 : number
---@class uint64 : number
(deriving from integer
doesn't work because that's apparently just an alias for number
but i know it's at least a bit more special than that. just how the class number
is more special than just deriving from the class any
which doesn't have anything defined. Just language server internals looking weird i guess.)
Infos
If no-implicit-any
is enabled:
"Lua.diagnostics.neededFileStatus": {
"no-implicit-any": "Any",
},
Lots of those warnings get generated. it most likely makes the most sense to disable this completely for all files by adding ---@diagnostic disable: no-implicit-any
at the top, though it might be useful for finding issues during development.
The Rest
Once those are all fixed you should be left with 9 errors and 28 warnings (with just lowercase-global
warnings disabled in Lua.diagnostics.disable
). All of those are luadoc-miss-type-name
and undefined-doc-name
and looking through them they are all things that also need special treatment.
(How do i know? I hack fixed all of these issues. Initially to see if performance (being diagnostic speed) would be better with all of them fixed and it was noticably better, but still not great.)
Edit 1: you'd probably have a few more warnings than 28, because i have the defines.foo
classes defined.
Edit 2: oh you'd have way more than that. about 100 or so. In order to reduce warnings for performance testing i did add
---@class CustomDictionary
---@class CustomArray