pico8-ls
pico8-ls copied to clipboard
Magic comments for disabling a warning on the next line, or for the whole file
Something like:
-- pico8-ls disable
-- pico8-ls disable-line
-- pico8-ls disable-function
Since we don't have any auto corrections for warnings/errors, it'd be nice if adding these showed up as a code correction for warnings/errors. (like they do for eslint)
Maybe also a magic comment to disable "unknown global" for a specific variable -- although, maybe a better answer is just setting something like my_var = nil
at the top of the file. (that does take tokens, though, and a magic comment would not.)
Something like that would be nice. I use pico-build and split the code over multiple files. So I get "undefined variable" everywhere xD
Something like that would be nice. I use pico-build and split the code over multiple files. So I get "undefined variable" everywhere xD
A quick workaround (though not ideal) is to add
"Lua.diagnostics.disable": ["undefined-global", "lowercase-global"]
to you workspace settings.lua or globally if you don't want to worry about it for every project (but then you loose those errors on normal lua files)