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)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-09-23 18:20:05 | 0.005s | Q:6