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 Documentcommand in VSCode (alt+shift+F is the default keyboard shortcut)
PICO-8 LS: Format Filefor regular code formatting
PICO-8 LS: Format File: Each Statement on Separate Linewhich 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
[Please log in to post a comment]