A language server for Kerboscript within the KOS mod for Kerbal Space Program. A language server can provide features typical to an IDE language for the supported target language, in this case Kerboscript.
The project currently supports the following clients
For additional client support such as sublime text, emacs, notepad++ or others please post an issue with the requested editor.
Currently the vscode client 1.1.5 implements the follow features
The language server includes several comment directives that can be included extra functionality
\\ #include <file path>
: Include a script file in the current files scope even if no run is present\\ #region
: Foldable region start\\ #endRegion
: Foldable region endAll commands can be launched with ctrl+shift+p
kOS: Start Kerbal Space Program
kOS: Connect Telnet Client
kOS: Route Logging to LSP inspector
kOS: Route Logging to Vscode
kOS: Search Documentation
The workspace can be configured with a file called ksconfig.json
. The following is an example
{
"archive": "..",
"bodies": ["earth", "moon", "sun"],
"linting": {
"control-flow-break": "off"
}
}
This will set the archive folder to correspond to the folder above, the valid bodes to be earth
, moon
and sun
and to turn off linting related to invalid break statements. More info can be found here.
These settings are currently included with the tool
kos-vscode.kerbalSpaceProgramPath
Path to kerbal space programkos-vscode.completionCase
Indicate the preferred completion case for built in symbolskos-vscode.telnetHost
Host name of the telnet serverkos-vscode.telnetPort
Host port of the telnet serverkos-vscode.lspPort
Port to send lsp message to for the LSP Inspectorkos-vscode.trace.server
verbosity
Detail level of the logsformat
Log formatlevel
Message levelThis project is heavily inspired by the crafting interpreters series. Definitely check it out if your interested in creating your own language, or language tooling.