I am using VSCode to edit Lua, and am trying to avoid Lua Diagnostic warnings.
It appears that VSCode depends on PlaydateSDK/CoreLibs/__stub.lua.
I believe that this uses the Lua LSP.
In my code so far, I have warnings about the following undefined fields:
playdate.graphics.image.new
playdate.graphics.kColorWhite
playdate.graphics.kDrawModeNXOR
playdate.geometry.point.new
playdate.graphics.sprite.new
These are all valid and documented.
I think that the solution is to add them to __stub.lua.
Hi Matt
I've attached the complete code. The console is giving me:
main.lua 12: assertion failed
Hopefully, you're able to point me in the right direction!
Another, related issue I've found is that the stub file has function playdate.file.readLine() end. This meant that I got an autocomplete for readLine, but it should be readline (lowercase).
Hi Matt
There was an image at the location but when I tried a different image it worked. I can only assume the original PNG was corrupted or something!
Anyway, thanks for the direction. It's going to be a while before I release anything if the tooltips are causing me a headache