XenoScript for VS Code
Language support for XenoScript — the statically typed modding scripting language used for game and toolchain scripting.
Overview
This extension adds first-class editing support for .xeno files in VS Code, including syntax highlighting, semantic navigation, and live diagnostics powered by the bundled xenolsp language server.
Features
- Syntax highlighting for
.xeno files
- Hover type information at the cursor
- Go to Definition for symbols and declarations
- Find All References in the current file
- Live diagnostics with incremental parsing so errors stay visible while typing
- Project build command for XenoScript files
- Language server restart command to reload the backend after updates
Requirements
- VS Code 1.82 or newer
- A working
xenolsp binary
This extension looks for the language server in the following order:
- Custom
xenoscript.lspPath / platform-specific overrides
xenoscript.toolchainRoot
- Bundled
bin/xenolsp or bin/xenolsp.exe
xenolsp on your PATH
Installation
Install from VSIX
- Download the
.vsix package from the releases page or build it locally.
- Open VS Code.
- Go to Extensions.
- Open the Command Palette and run
Extensions: Install from VSIX....
- Select the
.vsix file.
Build from source
cd vscode-xenoscript
npm install
npm run compile
# Copy xenolsp[.exe] into bin/
cp ../bin/xenolsp bin/
# or on Windows: copy ..\bin\xenolsp.exe bin\
npx vsce package
This produces a package like vscode-xenoscript-x.y.z.vsix.
Extension Settings
| Setting |
Description |
xenoscript.lspPath |
Absolute path to the xenolsp binary. Useful when you want to use a game or SDK-provided toolchain instead of the bundled one. |
xenoscript.lspPathWindows |
Windows-only override for the language server path. |
xenoscript.lspPathLinux |
Linux-only override for the language server path. |
xenoscript.toolchainRoot |
Root path for a XenoScript toolchain or game install; the extension will look for tools/xenolsp or bin/xenolsp under it. |
xenoscript.trace.server |
Enables tracing for VS Code ↔ language server communication (off, messages, or verbose). |
Customize XenoScript token colors
The extension contributes a default palette for XenoScript TextMate scopes. It is applied automatically and does not recolor matching tokens in other languages. To customize the palette, copy the rules below into your VS Code settings.json and adjust the colors to suit your preferences.
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment.line.double-slash.xeno",
"comment.block.xeno",
"punctuation.definition.comment.begin.xeno",
"punctuation.definition.comment.end.xeno"
],
"settings": { "foreground": "#6A9955", "fontStyle": "italic" }
},
{
"scope": [
"string.quoted.double.xeno",
"string.other.module.xeno"
],
"settings": { "foreground": "#CE9178" }
},
{
"scope": "constant.character.escape.xeno",
"settings": { "foreground": "#D7BA7D" }
},
{
"scope": [
"punctuation.definition.string.begin.xeno",
"punctuation.definition.string.end.xeno"
],
"settings": { "foreground": "#CE9178" }
},
{
"scope": [
"punctuation.section.interpolation.begin.xeno",
"punctuation.section.interpolation.end.xeno"
],
"settings": { "foreground": "#D4D4D4" }
},
{
"scope": [
"punctuation.definition.attribute.xeno",
"entity.name.tag.xeno"
],
"settings": { "foreground": "#C586C0", "fontStyle": "bold" }
},
{
"scope": "keyword.control.import.xeno",
"settings": { "foreground": "#C586C0" }
},
{
"scope": [
"keyword.control.xeno",
"keyword.declaration.xeno",
"storage.modifier.xeno",
"keyword.operator.new.xeno",
"keyword.operator.typeof.xeno",
"keyword.operator.cast.xeno",
"keyword.other.xeno"
],
"settings": { "foreground": "#569CD6" }
},
{
"scope": [
"constant.language.boolean.xeno",
"constant.language.null.xeno",
"constant.other.xeno"
],
"settings": { "foreground": "#D7BA7D" }
},
{
"scope": [
"constant.numeric.float.xeno",
"constant.numeric.integer.xeno"
],
"settings": { "foreground": "#B5CEA8" }
},
{
"scope": "support.type.builtin.xeno",
"settings": { "foreground": "#4EC9B0" }
},
{
"scope": "entity.name.type.xeno",
"settings": { "foreground": "#4EC9B0" }
},
{
"scope": "entity.name.function.xeno",
"settings": { "foreground": "#DCDCAA", "fontStyle": "bold" }
},
{
"scope": "entity.name.type.generic.container.xeno",
"settings": { "foreground": "#4EC9B0", "fontStyle": "bold" }
},
{
"scope": "entity.name.type.generic.argument.xeno",
"settings": { "foreground": "#9CDCFE", "fontStyle": "bold" }
},
{
"scope": "variable.other.xeno",
"settings": { "foreground": "#9CDCFE" }
},
{
"scope": [
"punctuation.definition.generic.begin.xeno",
"punctuation.definition.generic.end.xeno",
"punctuation.definition.block.begin.xeno",
"punctuation.definition.block.end.xeno",
"punctuation.definition.parameters.begin.xeno",
"punctuation.definition.parameters.end.xeno",
"punctuation.terminator.statement.xeno",
"punctuation.separator.comma.xeno",
"punctuation.separator.colon.xeno",
"punctuation.accessor.xeno"
],
"settings": { "foreground": "#D4D4D4" }
},
{
"scope": [
"keyword.operator.arithmetic.xeno",
"keyword.operator.comparison.xeno",
"keyword.operator.logical.xeno",
"keyword.operator.assignment.xeno",
"keyword.operator.nullable.xeno"
],
"settings": { "foreground": "#D4D4D4" }
}
]
}
Generic containers such as Dictionary, List, Queue, and Stack are teal, while their generic type arguments, including nested ones, are highlighted separately in light blue.
Commands
| Command |
Description |
XenoScript: Restart Language Server |
Stops and relaunches xenolsp so the newest binary or config is used. |
XenoScript: Show Language Server Path |
Displays the resolved path to the active xenolsp binary. |
XenoScript: Build Project |
Runs the project build action for the current XenoScript file. |
Troubleshooting
If the language features are not working, try the following:
- Confirm the
xenolsp binary exists and is executable.
- Check the resolved language server path with
XenoScript: Show Language Server Path.
- Restart the language server with
XenoScript: Restart Language Server.
- If needed, set
xenoscript.lspPath or xenoscript.toolchainRoot explicitly.
Development
npm install
npm run watch
Use the built-in VS Code extension host for debugging, or package the extension with npx vsce package when ready to distribute.
License
This project is licensed under the terms in the LICENSE file.