Schema Compiler
VS Code Extension
Syntax highlighting for .sia schema files in VS Code.
The Sia VS Code extension adds syntax highlighting for .sia schema files.
Installation
The extension is distributed as a .vsix file in the sia-schema repository:
# Clone the repository
git clone https://github.com/TimeleapLabs/sia-schema.git
# Install the extension
code --install-extension sia-schema/vscode-sia/vscode-sia-0.0.1.vsix
After installation, restart VS Code. Files with the .sia extension will automatically get syntax highlighting.
What It Provides
- Syntax highlighting for
.siafiles:- Keywords:
schema,plugin,method,returns,as - Built-in types:
int32,int64,string8,uint8, etc. - Custom types: PascalCase identifiers (e.g.,
Address,Person) - String literals, number literals
- Single-line (
//) and block (/* */) comments - Field names and function names
- Keywords:
- Language configuration:
- Line comment toggle (
Ctrl+/→//) - Block comment toggle (
Shift+Alt+A→/* */) - Auto-closing brackets:
{},[],() - Auto-closing quotes:
"",'' - Bracket matching and surrounding pairs
- Line comment toggle (
What It Does Not Provide
The extension is syntax-highlighting only. It does not include:
- Diagnostics / error checking: Syntax errors are not shown in the editor. Run
sia compileto check for errors. - Autocomplete / IntelliSense: No type or field name suggestions.
- Go to definition: No navigation between schema references.
- Formatting: No auto-formatting. Use your editor's generic formatter.
- Language server: No LSP integration.
Example
With the extension installed, a .sia file looks like this:
// User management schemas
schema User {
name string8
age? uint8
email string16(encoding = "ascii")
roles string8[]
address Address
}
schema Address {
street? string8 = "Unknown"
city string8
zip int32
}
plugin swiss.timeleap.users.v1 as UserService {
method getUser(timeout = 5000) {
id uint64
} returns {
user User
}
}
Keywords are highlighted as control flow, types as builtins, PascalCase identifiers as type references, and string/number literals in their respective colors.
Repository
- Extension source:
vscode-sia/in the sia-schema repo