Coder Social home page Coder Social logo

pico8-emmylua-definitions's Introduction

PICO-8 EmmyLua autocomplete definitions

EmmyLua definitions for the PICO-8 API, for autocomplete/intellisense support in code editors where integration with the EmmyLua Language Server is supported (IntelliJ , VSCode).

Recording showing multiple examples of autocomplete in action

Using

Prerequisites

You must have an integration with the EmmyLua Language Server set up in your editor. EmmyLua has first-class support for IntelliJ and VSCode, with other setups supported through some configuration. See the section below for suggestions if you are using VSCode.

Installation

Simply place the file pico8.lua somewhere in your workspace, I would recommend a folder called _pico8 or _api or something. You may have to change some settings to reference these definitions as a library, but in my experience simply having them in your workspace is enough.

One approach that also makes it easy to update would be to simply clone this repo into your project's directory:

git clone [email protected]:peabnuts123/pico8-emmylua-definitions.git _pico8

That way you can run git pull if you need to update the definitions. You will have to copy the files manually if you intend to commit them to your project, however.

Visual Studio Code

If you are using VSCode, I would recommend this extension, which integrates with the EmmyLua language server as well as providing many Lua code editing features such as Go To Definition, linting and more.

Contributing

Please let me know if there are any incorrect or missing definitions by opening an issue or submitting a pull request.

Future work

Some future work I am considering:

  • Automating the generation of these definitions from the PICO-8 Fandom Wiki (where most of these definitions came from)
  • Changing the variable names and documentation to be more clear (i.e. author my own documentation)
  • Creating a version for each version of PICO-8, managed through git tags

pico8-emmylua-definitions's People

Contributors

peabnuts123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

alxgnon jaular

pico8-emmylua-definitions's Issues

Documentation - How to test the definition?

I'm unsure what the definitions provide with a fresh installed vs-vode. So I'm unsure even it even does work or not.

  • How is the code-completion activated (Ctrl-Space)?
  • Does it provide syntax-highlighting too (or did you use a different extension for that)?

I've tried the https://github.com/peabnuts123/pico8 example both with Ubuntu 18.04 and Windows 10 with the latest vs-code. I get the same result on both os: No syntax-highlighting and no pico8-specific code-completion.

The "sumneko.lua" extension was suggested running the first time (I've installed it of course). I have trouble using the "launch.json" because of the '"type": "coreclr"' which I can't pin down to any specific extension. I'm unsure if this related to the problem above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.