Log In  

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:

  1. The regular Format Document command in VSCode (alt+shift+F is the default keyboard shortcut)
  2. Command Palette -> PICO-8 LS: Format File for regular code formatting
  3. Command 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

P#129928 2023-05-19 16:39 ( Edited 2023-05-19 16:43)

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.

P#135332 2023-10-03 08:21 ( Edited 2023-10-09 14:47)

[Please log in to post a comment]