MGSL – Multi Grid Scripting Language
VS Code support for MGSL, a domain-specific language for procedural
grid-based level generation. MGSL programs describe how to transform a stack
of correlated grids through pattern-rewrite rules.
Features
Real-time diagnostics
Errors appear as you type — undeclared grids, unknown tag values, shape
mismatches, duplicate declarations, and more.

Tag value coloring
Every tag value gets a stable background color. Pattern bodies light up to
show which cells carry which values — the same color you see in the tag
declaration appears wherever that value is used.

Colors automatically adapt to light and dark themes.
Hover over any tag value, rule name, or grid name to see its declaration
inline — including the full tagset, rule attributes, and pair count.
Go to definition
F12 (or Ctrl+click) on a tag value, rule name, or grid reference
jumps to where it is declared.
Completion in pattern bodies
Inside [ … ] pattern cells, Ctrl+Space (or type [ to trigger
automatically) offers all tag values declared for that grid, including
glyph aliases, plus the wildcards . and ?.
Syntax highlighting
Keywords, pattern wildcards (. and ?), comments, and numeric literals
are highlighted via a TextMate grammar.
Language quick reference
tag terrain { wall █, floor · }
layers {
level: grid of terrain
}
rule fill(symmetry=all) {
level[?]
=>
level[·]
}
program {
resize(60, 40)
all fill
}
| Token |
Meaning in pattern |
. |
match any value (including empty) |
? |
match or write the empty cell |
| name / glyph |
a specific tag value |
| integer |
a numeric value (grid of number) |
Getting started
- Create a file with the
.mgsl extension
- Declare tags and layers
- Write rules and a program block
- Diagnostics appear in the Problems panel as you edit
Resources
Changelog
0.2.0
- Hover information for tag values, rule names, and grid references
- Go to definition (F12 / Ctrl+click)
- Completion inside pattern bodies — tag values, glyphs, and wildcards
- Coloring scoped to actual tag value references (no false positives on rule/layer names)
- Error squiggles now land on the correct token (rule name, tag name, etc.)
- Additional sema checks: inconsistent row widths, reserved glyph aliases
0.1.0
- Initial release: syntax highlighting, real-time diagnostics, tag-value coloring