Closed beetrootpaul closed 1 year ago
just in case:
new_static_sprite
definition: https://github.com/beetrootpaul/dart-07/blob/d1089fca72437a6fc052f2cddcfd81c0a8756eaa/src/common/sprites/static_sprite.lua#L5-L9_color_15_peach
definition: https://github.com/beetrootpaul/dart-07/blob/d1089fca72437a6fc052f2cddcfd81c0a8756eaa/src/common/colors.lua#L7p8
files which #include
those files: https://github.com/beetrootpaul/dart-07/blob/05661ff015ab10cdf348b5bafd6b4f815762fa63/dart-07.p8#L7-L42It should be aware of globals as long as they're all #include
'ed into the same .p8 file. I'll mark this as a bug.
just a random thought: what if having 4 different p8 files (with different sets of includes) messes things up?
ah, I think I have a lead! See, my p8 files do NOT include from src/
(where my code lives) but from build/
(where minified code ends in result of a npm start
script).
If this is the culprit, then probably this is not a bug, just might be good to have a way to disable those warnings in plugin settings? 🤔 (OFC I would love for pico8-ls to take care of my globals, but if this cannot be easily done in my setup, then I prefer to turn off those particular warnings)
That would do it!
How can I make pico8-ls aware of globals I have defined in another file and use across my codebase?
Here you can see on the screenshot how files within my
src
are marked orange due to warnings. When I look into some file, it seems like for examplenew_static_sprite
and_color_15_peach
are marked as "undefined variable".Those variables come from other files. All files of my game are included in the
.p8
file (and order of includes doesn't matter for most of files, since those usages are within functions… or at least I haven't stumble on any error in PICO-8 so far)