Vellum
Vellum is a scripting language for Creation Kit–era games. This extension adds editor support for Vellum (.vel, .vellum) in Visual Studio Code via the bundled vellum-lsp language server.
Windows x64 only for the initial release. Linux and macOS binaries are not bundled yet.
Features
- Syntax highlighting and semantic tokens for Vellum
- Diagnostics on edit
- Code completion
- Go to definition
- Vellum: Compile — compile the active file to
.pex via the vellum CLI
Installation
Install from a VSIX (not published on the VS Code Marketplace yet):
- Download
vellum-<version>.vsix from a GitHub Release or build one locally (see below).
- In VS Code, run Extensions: Install from VSIX… and select the file.
- Open a
.vel or .vellum file.
- Install the Vellum compiler and set
vellum.compilerPath if vellum is not on your PATH.
Compile
Run Vellum: Compile from the Command Palette or the editor context menu while a .vel file is active. The extension saves the file, then runs vellum.exe with your workspace settings.
Compiler output appears in the Vellum Compiler output channel.
Configuration
| Setting |
Description |
vellum.compilerPath |
Path to the vellum compiler executable. When empty, runs vellum (vellum.exe on Windows) from PATH. |
vellum.importPaths |
Extra import directories passed to the compiler and language server. Workspace folder(s) are always included. Supports absolute paths and ${workspaceFolder}. |
vellum.outputDirectory |
Output directory passed to the compiler (-o). When empty, .pex is written next to the source file. Supports absolute paths and ${workspaceFolder}. |
vellum.trace.server |
Trace LSP traffic (off, messages, verbose). |
vellum.languageServerPath |
Optional path to a vellum-lsp executable. When empty, the bundled server under server/<platform> is used. |
Example settings.json for a Skyrim mod project:
{
"vellum.compilerPath": "C:/path/to/vellum.exe",
"vellum.importPaths": [
"${workspaceFolder}/Scripts/Source",
"C:/Program Files (x86)/Steam/steamapps/common/Skyrim Special Edition/Data/Source/Scripts"
],
"vellum.outputDirectory": "${workspaceFolder}/Scripts"
}
Tasks
You can also wire compile into VS Code tasks. Example for the active file:
{
"version": "2.0.0",
"tasks": [
{
"label": "Vellum: Compile Active File",
"type": "shell",
"command": "${config:vellum.compilerPath}",
"args": [
"-f",
"${file}",
"-i",
"${workspaceFolder}/Scripts/Source;C:/Program Files (x86)/Steam/steamapps/common/Skyrim Special Edition/Data/Source/Scripts",
"-o",
"${workspaceFolder}/Scripts"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "shared"
}
}
]
}
For batch compiles, call vellum from a script in your mod build pipeline. Multiple import paths are separated with ; on the command line.
Building a VSIX
From the monorepo root, build the language server in Release, then package the extension:
cmake --build build --config Release
cd tools\editors\vscode
npm install
npm run package
The VSIX is written to dist/vellum-<version>.vsix.
To point at a custom server binary:
node scripts/package.js --server-path ..\..\..\bin\vellum-lsp\vellum-lsp.exe
Development
npm install in tools/editors/vscode
- Build
vellum-lsp (Release) so bin/vellum-lsp/vellum-lsp.exe exists
- Set
vellum.languageServerPath and vellum.compilerPath in workspace settings
- Press F5 to launch an Extension Development Host
Use npm run watch to recompile the client on change.
Links
License
MIT — see LICENSE.