Monster Language for VS Code

Basic VS Code support for the Monster programming language, .mnst source files, and Monster.toml project manifests.
This extension is developed alongside the main Monster compiler project:
Install
From the VS Code Marketplace:
Or from the command line:
code --install-extension monster-lang.monster-language
What You Get
.mnst and Monster.toml file associations
- syntax highlighting for current Monster syntax, including
const, defer, struct, enum, payload enums, match, sizeof, pointers, slices, imports, and print_ln_*
- syntax highlighting for
Monster.toml project manifest sections and build options
- hover help for Monster keywords, primitive types, builtins, and manifest keys
- autocomplete suggestions for Monster keywords, builtins, primitive types, std imports/helpers, and
Monster.toml keys
- command palette actions for checking, running, building, and cleaning Monster files
- save-time diagnostics from
mst check in the Problems panel
- line comments and bracket rules
- starter snippets for
main, mainargs, hello, import, extern, const, let, letmut, lettyped, defer, struct, enum, match, if, and while
- Monster file icon support for themes that do not define one already
Quick Start
Create a Monster project:
mst init hello-monster
cd hello-monster
mst run
fn main() -> i32 {
print_ln_str("Hello, World!");
return 0;
}
[package]
name = "hello-monster"
entry = "src/main.mnst"
[build]
profile = "release"
opt-level = 2
cpu = "generic"
Open a .mnst file or Monster.toml file and VS Code will automatically switch to the matching Monster language mode.
Current Scope
Today this extension focuses on the basics:
- syntax coloring
- hover help
- autocomplete
mst check diagnostics
- command palette actions
- snippets
- file association for
.mnst and Monster.toml
- icon support
Not included yet:
- language server features
- formatting
- go-to-definition or semantic tokens
Commands
The extension can call the mst compiler from VS Code:
Monster: Check Current File
Monster: Run Current File
Monster: Build Current File
Monster: Clean Artifacts
By default, .mnst files are checked on save and diagnostics are shown in the Problems panel. If your compiler is not on PATH, set monster.compilerPath in VS Code settings.
Local Development
Open this repository in VS Code and press F5 to launch an Extension Development Host.
You can also copy or symlink this folder into your local VS Code extensions directory:
- Linux/macOS:
~/.vscode/extensions/monster-language
- Windows:
%USERPROFILE%\\.vscode\\extensions\\monster-language
Packaging
From the repository root:
npm run package
This creates a .vsix file that you can install locally in VS Code or upload to the Marketplace.