pico-api is a project consisting of definition files for the sumneko/lua extension for VSCode, allowing you to write PICO-8 or Picotron programs with the support of modern editor features.
-
Install and enable sumneko/Lua extension in VSCode Marketplace
-
Download pico-api
-
New a folder .vscode in your workspace, and put the file setting.json into it
-
Change the field Lua.workspace.library in .vscode/settings.json to the path to the folder picotron(or folder pico8, depending on the type of your project)
-
New a cartridge and use this snippet at the top of its code:
-- picotron cd("/myproj") include("main.lua")
-- pico8 #include main.lua
Then you can write code in the workspace of VSCode and enjoy code prompts, formatting, AI copilot, etc.
Picotron Shorthand is not completely supported.
!=
operator and shorthand assignment operators (like+=
,-=
, etc) can be used now. Thanks to @arnaught.
This is a very rough version. Welcome to submit issues and PRs.
https://marketplace.visualstudio.com/items?itemName=sumneko.lua