pico8-ls icon indicating copy to clipboard operation
pico8-ls copied to clipboard

Magic comments for disabling a warning on the next line, or for the whole file

Open japhib opened this issue 2 years ago • 3 comments

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)

japhib avatar May 27 '22 21:05 japhib

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.)

japhib avatar May 27 '22 21:05 japhib

Something like that would be nice. I use pico-build and split the code over multiple files. So I get "undefined variable" everywhere xD

freaky-m0 avatar Aug 14 '22 09:08 freaky-m0

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)

gcoulby avatar Mar 07 '23 14:03 gcoulby