YAML Representation of the DCS World Mission Scripting Environment's API Signature
This project provides a comprehensive YAML-based schema definition for the DCS World API. The goal is to create a complete schema that can be used by LSP servers to provide extremely strict and detailed linting for DCS World mission scripting in Lua. Currently we support exporting the schema to EmmyLua Annotations for use with existing Lua language servers like LuaLS.
Just an end user and want linting in your IDE? Go to Using Pre-Built Releases
- Complete API signature definitions in YAML format
- Type checking for DCS functions, methods, and properties
- Schema validation tools
- JSON schema output for use with language servers
- EmmyLua annotations export for Lua editor integration
For most users, the easiest way to use this project is to download the pre-built releases:
- Go to the Releases page
- Download the latest release
- Extract the files to your desired location
Each release includes:
dcs-world-api-schema.json- JSON schema for the DCS World APIdcs-world-api-schema.yaml- YAML schema for the DCS World APIdcs-world-api.lua- EmmyLua annotations for Lua editor integration <-- End Users: you probably only care about this
To use the EmmyLua annotations with your Lua editor:
- Set up your editor to use EmmyLua annotation compatible LSP
- Include the
dcs-world-api.luafile in your project or configure your editor to reference it
- Install a popular Lua LSP extension like sumneko's Lua extension.
- Create a
.vscode/settings.jsonin your DCS World Lua project if it does not alreaady exist. - For LuaLS or sumeneko's Lua extension, or other popular Lua LSP for VSCode, all you should have to do is add the following to your
settings.json:
{
"Lua.workspace.library": [
"$PATH_TO_YOUR_LUA_DIST_FILE_CHANGE_ME/dcs-world-api.lua",
]
}- Type checking, hover information, and autocomplete should now function in
.luafiles in VSCode
Note
For whatever reason, LuaLS marks all functions as deprecated despite not having the flag. This is a bug that I am working on fixing.
But you can disable that by adding the following to your settings.json:
{
"Lua.workspace.library": [
"$PATH_TO_YOUR_LUA_DIST_FILE_CHANGE_ME/dcs-world-api.lua",
],
"Lua.diagnostics.disable": ["deprecated"]
}Aspirationally, we would like to be able to provide, correct, valid packages for valdidating the DCS schema in the following languages natively:
- TypeScript definitions export for JavaScript/TypeScript development
- Go struct definitions for Go development
- Python type hints for Python development
The exporters for these languages exists in /tools at this time but a release process has not been formalized and the exports are not great.
The exporters can be used via task build:golang, task build:python, task build:typscript :
And they output as follows in /dist
dcs-world-api.d.ts- TypeScript definitions for JavaScript/TypeScript developmentdcs-world-api.go- Go struct definitions for Go applicationsdcs_world_api.py- Python type hints for Python development
If you need to build from source or want to contribute to the project:
-
Clone the repository:
git clone https://github.com/yolowingpixie/dcs-world-schema.git cd dcs-world-schema -
Install Task (if not already installed): This project uses Task to run commands. Installation instructions are available at taskfile.dev/installation.
-
Set up the environment:
task setup
-
Generate all schema files and type definitions:
task build
The generated files will be in the dist/ directory.
dcs-world-schema/- Core schema files in YAML formatglobals/- Global namespace definitionstypes/- Type definitions
tools/- Utilities for validation and buildingdist/- Generated schema files and exportsreference_data/- DCS API reference data
Contributions are welcome! Please see CONTRIBUTING.md for detailed development setup, workflow, and contribution guidelines.
This project is licensed under MIT.