Skip to content

renoise/definitions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LuaCATS definitions for the Renoise Lua API

Renoise

This is a Renoise Tools API add-on for the LuaLS Language Server.

LuaLS provides various features for Lua in code editors, such as autocompletion, type hovers, dynamic type checking, diagnostics and more via LuaCATS annotations.

Status

The API definitions is usable as is is now, but still a work in progress.

Please report bugs or improvements as issues here and/or create a merge request.

Known issues

  • __eq, __lt, __le meta methods can't be annotated via LuaLS at the moment. They are specified in ### operators as plain comments and should be converted as soon as LuaLS supports them.

  • __index meta methods currently can't be annotated via LuaLS.
    They are currently mentioned as @operator index, but won't be picked up by the language server and should be converted as soon as LuaLS supports them.

  • Scripts to convert/generate a HTML doc page are missing. So no HTML version can be built from the definitions yet. The old conversion script won't work anymore, but maybe can be used as a template, for inspirations: https://github.com/renoise/xrnx/tree/master/Xtra/HtmlGen
    Also, LuaLS can export the annotation data formatted as JSON or Markdown

  • Return types for main class constructors (renoise.app(), .tool(), .song() etc.) should be specified as an instance to allow the LSP to warn when trying to access non-constant properties on the classes themselves (like renoise.Song.selected_track), see ViewBuilderInstance in view_builder.lua for a work-around.

  • The LuaLS type system allows setting non-existent properties for constructor tables, which then causes runtime crash (for example vb:text { margin = 100 }), using (exact) for @class annotations doesn't help.

Usage

To use the definition in e.g. vscode, first install the sumneko.lua vscode extension as described here: https://luals.github.io/#vscode-install

Then clone or download a copy of this repository, and configure your workspace to use the Renoise definition files:

// .vscode/settings.json:
{
    "Lua.workspace.library": ["PATH/TO/RENOISE_DEFINITION_FOLDER"],
    "Lua.runtime.plugin": "PATH/TO/RENOISE_DEFINITION_FOLDER/plugin.lua"
}

The "Lua.runtime.plugin" setting only is needed in order to automatically annotate the custom class keyword.

Contribute

Contributions are welcome!

Please report issues here or fork the latest git repository and create a feature or bugfix branch.

About

LuaCATS definitions for the Renoise Lua API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages