Grandmaster
VS Code language support for the Grim configuration language.
Features
- Syntax highlighting for
.grim files
- Bracket matching and auto-closing
- Comment toggling (line and block)
- Code folding
Syntax Support
The extension provides highlighting for:
- Comments: Line (
//) and block (/* */)
- Strings: Single (
'...') and double ("...") quoted, including multiline (''...'' and ""..."")
- String Interpolation:
s"Hello ${name}!", s'...', s""..."", s''...''
- Numbers: Integers, floats, scientific notation
- Booleans:
true, false
- Null:
null
- Paths: Absolute (
/path/to/file) and relative (./src, ../lib)
- Operators: Arithmetic (
+, -, *, /, ^), comparison (==, !=), concatenation (++), logical (!)
- Keywords:
match
- Match expressions:
match (expr) { case => result, _ => default }
- Function calls:
func(args), pkg.module.func(args)
- References:
config.db.host, ::absolute.reference
- Structs:
{ field = value }
- Tuples:
[1, 2, 3]
Installation
From VSIX
Build the VSIX package:
cd ide/vscode
npx vsce package
Install in VS Code:
- Open VS Code
- Press
Ctrl+Shift+P (or Cmd+Shift+P on macOS)
- Type "Extensions: Install from VSIX..."
- Select the generated
.vsix file
Development
- Open this folder in VS Code
- Press
F5 to launch Extension Development Host
- Open a
.grim file to see syntax highlighting
Example
// Project configuration
name = "my-project"
version = "1.0.0"
build = {
target = /output/dist
sources = [./src/main, ./src/lib]
options = {
optimize = true
debug = false
}
}
env = match (environment) {
production => prodConfig
staging => stagingConfig
_ => devConfig
}
message = s"Building ${name} v${version}"
License
MIT
| |