Parser to generate Eluna LSP definitions for LuaLS.
LuaLS-Eluna-Parser is a tool designed to generate Language Server Protocol (LSP) definitions for the Lua Language Server (LuaLS) from the Eluna API documentation. This enhances the development experience by providing intelligent suggestions and autocompletion for methods and properties of Eluna objects.
- Download Eluna API Documentation: Obtain a copy of the Eluna API documentation files.
- Run the Parser: Execute the parser on the documentation HTML files. An example of this process can be seen in the PowerShell or Bash script included in this repository.
- Completion: Once the parser runs successfully, the generated definitions will be ready to use.
OR
Download the latest generated definitions from the build workflow action, alternatively from this link (provided by nightly).
- Install LuaLS: Follow the LuaLS installation instructions.
- Configure Your Workspace: Point your workspace/LSP configuration to the location of the generated definitions.
- Enable parameter inference: In the LuaLS configuration, enable Lua.type.inferParamType, this is required for callback parameters to function properly.
- Install Python 3, Pip, and dependencies:
- Generate LSP definitions:
Theparser.py
script will generate definitions for every method documentation HTML file in a specified directory. To make it easier to generate stubs for all method subdirectories in one go, I provide a couple helper scripts. The inputs are the same for both the powershell and the bash script. Expected inputs are:- Path to parser.py
- Input directory (path to ElunaLuaEngine.github.io repository)
- Output directory (where the stubs will be created)
- Debug flag, optional, default false (provides some additional logging in the console)
- Example:
runParser.ps1 c:\path\to\parser.py c:\path\to\ElunaLuaEngine.github.io\repo c:\outputDirectory [debug(default false)]
- Configure your workspace/LSP to point to the location of your generated definitions.