midouest / vscode-playdate-debug

Unofficial Playdate debug extension for Visual Studio Code on macOS, Windows and Ubuntu
https://marketplace.visualstudio.com/items?itemName=midouest.playdate-debug
MIT License
38 stars 4 forks source link

set the entry point manually instead of using currently opened file for run/debug #14

Closed jkozniewski closed 1 year ago

jkozniewski commented 1 year ago

Is there any option to launch a particular lua file (for example main.lua) instead of the one currently opened in editor ? That would be super convenient when working in multiple file projects, since now the Run command launches the one that's currently opened in the editor and it's kind of cumbersome to always manually switch to the main file (containing playdate.update loop). Not sure if it's possible to configure somehow now or it's more like a feature request, anyway any feedback would be much appreciated :) !

midouest commented 1 year ago

Sort of! The best way to achieve what you want is to use the task + debug launcher configuration in the README. This method requires that you have a folder called source/ that contains main.lua and pdxinfo files as described in the Inside Playdate.

You will start the game from the Run and Debug view accessible from the toolbar instead of using the "Run/debug file in Playdate Simulator" button. See Debugging in Visual Studio Code for more info on the "Run and Debug" view.

jkozniewski commented 1 year ago

ok, thanks, seems I got it as I wanted - used the taks.json and launch.json file and just added convenient shortcut to Debug commands (both launching and refreshing) so now works pretty conveniently regardless of which file I'm currently editing and it's uploading latest version to the simulator - thanks a lot for your effort in making this extension !