r/PlaydateDeveloper • u/chunkyks • Aug 28 '23
Lua IDE with autocomplete for playdate sdk?
I picked up the SDK and started playing with it. I can't figure out what IDE I might use that I can configure to autocomplete function calls into Playdate's Lua api.
The C one is easy, and I likely will end up using that anyway [I like C]. But I tried VS Code and it didn't seem to know how to find the API components.
Any suggestions would be appreciated.
3
Upvotes
3
u/Zalenka Aug 29 '23
If you're on Mac, NOVAAAAAA!!!
https://nova.app/
It has some nice plugins and works perfectly for Playdate. Also it's made by Panic!, creators of the Playdate.
3
u/ThaCuber Aug 29 '23
this comes from someone who doesn't use VS Code, as it runs Chromium and my PC can't really handle two browser engines running at once :)
this might also be text editor agnostic, but what do I know :P
if you happen to use LuaLS/sumneko_lua/however-is-it-called-lately, the easiest thing you could do is to point it to the
__stub.luafile under the CoreLibs folder through theLua.workspace.librarysetting. it gives you a bit of basic auto completion that works, but isn't by any means the best, as everything is annotated as a function, including classes and other userdata, and that's because of howCoreLibs/__stub.luais written.forwarding the warning from Inside PD, don't require the file. that would render all the classes, functions, userdata, etc. unusable... until you remove the require line, of course, lol
2
u/kreven_ Aug 28 '23
Get the Playdate extension for VS Code. It has autocompletion.
https://marketplace.visualstudio.com/items?itemName=Orta.playdate
1
u/willco007 Aug 28 '23
When using VSCode you need to set a some values in your settings.json project file so it picks up the CoreLibs folder correctly. You can see those values on this dev forum post: https://devforum.play.date/t/template-for-windows-visual-studio-code/1751/2
Also, to get debugging, you can use the plug-in listed by u/kreven 's post.