Skip to content

About

Defold annotations generator for Lua Language Server

Resources

Stars

59 stars

Watchers

2 watching

Forks

Latest commit

 

History

71 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Defold Annotations

Warning

Supported through Defold 1.13.1. Starting with Defold 1.13.2, use the official Lua annotations included in the editor and in the ref-doc.zip asset on the Defold Releases page. Automatic generation and releases from this repository have been discontinued. Existing releases and this generator remain available for older Defold versions.

Release License Website Mastodon Twitter Telegram Buy me a coffee

A set of Lua scripts for parsing Defold documentation and generating annotation files compatible with Lua Language Server.

By design, it can be run on Windows, macOS and Linux. Only Lua needs to be installed. The Lua language was chosen because it allows all Defold users to contribute to this project.

Generated annotations are available on the Releases page.

Use case

These annotations are used by Defold Kit, a Visual Studio Code extension for developing games with Defold.

Manual Generation

Install Lua and run the main.lua script with an explicit supported Defold version (up to 1.13.1).

$ lua main.lua '1.13.1'

Do not omit the version argument: the default fetches the latest Defold release, which this generator no longer supports. You can also generate annotations for earlier versions.

$ lua main.lua '1.5.0'

As a result, you will see the tmp/defold_api folder with .lua files. These are the annotations.

Tests

The repository includes a self-contained test harness with no runtime dependency on local doc/ or generated defold_api/ folders.

Run all tests with:

$ lua tests/run.lua

The test system uses:

  • tests/fixtures/docs/ for miniature synthetic Defold docs
  • tests/fixtures/modules/ for direct module fixtures
  • tests/fixtures/patches/ for patch-specific test data
  • tests/snapshots/ for small curated output fragments

Contribution

Issues

If you find a typo in the annotations or outdated meta information, please comment to issue #4. I try to collect annotation errors there, and then prepare a pull request to Defold source code, as this is the main source of documentation.

Otherwise, on parsing and generation problems, craete a new issue.

Debug

There is a launch config for tomblind/local-lua-debugger-vscode to debug with breakpoints.

It's also useful to turn the config.clean_traces to true in config.lua file to avoid deleting temporary files.

Third-party

About

Defold annotations generator for Lua Language Server

Resources

Stars

59 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages