Just released a new feature for my VSCode plugin PICO-8 LS: Code formatting! (Link to install VSCode extension)
IMO it's most useful for making minified code from e.g. a tweetcart more readable. Example:
(The code snippet above is the excellent TweetTweetJam entry XTRIS, by Fletch: https://fletchmakesstuff.itch.io/xtris)
Note that it's accessible in multiple ways:
- The regular
Format Document
command in VSCode (alt+shift+F is the default keyboard shortcut) Command Palette
->PICO-8 LS: Format File
for regular code formattingCommand Palette
->PICO-8 LS: Format File: Each Statement on Separate Line
which will put each statement on a separate line. (By default, the formatter lets multiple statements be on the same line, preserving your cart structure.) This is the command used in the GIF above.
Please be careful when using this tool, and save a backup of your cart before formatting it! Since this is the first time it's being released, there may still be issues to work through.
Big thanks to beetrootpaul for help implementing this feature!
Report any issues here: https://github.com/japhib/pico8-ls/issues
Thanks for your work!
There's an issue with format and export.
When exporting to png file, the very first 2 lines of comment are displayed on the cover of the cart.
But the formatting will leave an empty line after __lua__
which makes the cover only displays the first 1 line on it.
[Please log in to post a comment]