Skip to content

haedrichowen/TIC80-ls

 
 

Repository files navigation

PICO-8 Language Server

Full language support for the PICO-8 dialect of Lua.

The goal is to have all the features you'd expect in a full-fledged language server, such as the one for Lua, but specifically tailored for a frictionless PICO-8 experience.

Feature highlights

View docs on hover, then auto-complete and signature help:

docs gif

Full support for #include statements:

include gif

Technical Note

This extension uses the Language Server Protocol, so while it's mainly made for VSCode, it could also be used for other editors such as NeoVim, Atom, etc.

Implemented Features

  • Syntax highlighting
  • Syntax errors
  • Warnings on undefined variable usage
  • Find symbol in document
  • Go to definition
  • Find references
  • Hover support for built-in functions
  • Auto-completion
  • Signature help
  • support for #includeing other files

Planned features

  • Snippets for common idioms (functions, loops, #include, etc.)
  • Hover support/signature help for user-defined functions/variables
  • code formatting

Development

Please follow the official Language Server Extension Guide to understand how to develop VS Code language server extension.

Changelog

0.5.0 (5/18/2023)

  • Formatter has been released! Thanks to @beetrootpaul for major contributions in this feature.
  • Closes #26
  • Formatter is accessible through regular "Format Document" feature (Alt + Shift + F by default)
  • Also accessible through Command Palette, with PICO-8 LS: Format File - Each Statement on Separate Line command. This version of the formatter will ensure that each statement is on a separate line, as opposed to the normal one which will keep statements on the same line.
  • Works on both .lua and .p8 files!

0.4.10 (12/22/2022)

  • Add snippets for pico-8 glyphs (#30) - thanks to @mika76 for the contribution!
  • Fix for labels being marked undefined unless defined before goto (#32)

0.4.9 (12/17/2022)

  • Add reset and info built-in function calls (#36) - thanks to @miguno for the contribution!

0.4.8 (9/23/2022)

  • Fixed snippets
  • Added working indentation rules based on the other pico8vscodeeditor extension

0.4.6 (7/27/2022)

  • Fix file URI resolution for Windows (fixes go-to-definition and find-references) (#20)
    • (0.4.7) Apply same fix in places that were missed before (#22)

0.4.4 (6/15/2022)

  • Support for binary literals like 0b0101101001011010.1 (#10)
  • (0.4.5) Added auto-complete demo in readme

0.4.3 (6/9/2022)

  • Fix shorthand ? print function messing up document outline (#17)

0.4.2 (6/6/2022)

  • Fix warning on shorthand ? print function
  • Fix warning on labels and gotos (#16)
  • Add support for extcmd, yield, and a few other missing built-in functions (14)

0.4.1 (6/2/2022)

  • Better support for #includeing files -- files included by other files now have the same global scope. Go to definition and find usages works both from the including file, and from the included file. (Previously only worked from the including file.) (#3)
  • Fix code folding (#15)

0.4.0 (5/26/2022)

  • Add support for #includeing files (#3, #8)
  • Add support for built-in global symbols like ❎, 🅾️, and ░ (#9)

0.3.3 (4/6/2022)

  • Add support for P8SCII control codes in string literals (#7)
  • Added built-in t() and time() functions (#2)

0.3.2 (4/1/2022)

  • Fixed plugin not working on Windows because of problem parsing CRLF line endings (#5)

0.3.1 (2/22/2022)

  • Removed one of the leading 0's from the versioning scheme
  • Added stat with docs to the builtins (#1)

0.0.3 (2/7/2022)

  • Hover support for built-in functions
  • Auto-completion
  • Signature help
  • Disabling warnings for unused locals until bugs are fixed
  • Remove some warnings about Unicode characters left over from luaparse library

0.0.2 (1/31/2022)

  • Started using esbuild for bundling extension (should improve install/load performance)
  • Go to definition
  • Find references
  • Warnings for undefined globals, unused locals
  • Snippets for commonly typed patterns (if, then, function)

0.0.1 (1/23/2022)

First release, very basic feature set:

  • Syntax highlighting
  • Syntax errors
  • Go to symbol

Credits

PICO-8 Lua parser based on https://github.com/fstirlitz/luaparse

PICO-8 by Lexaloffle Games

About

TIC-80 Language Server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 63.9%
  • Lua 34.9%
  • JavaScript 1.2%