Crown language support for Visual Studio Code and Cursor: syntax highlighting, command IntelliSense, and formatting.
This is a language support extension, not a language pack (language packs localize the editor UI).
- Syntax highlighting for Crown and Crown Assembly
- Distinct color for Crown name literals and name-path segments (
variable.other.name.crown) - Command autocomplete at statement head
- Errors for unrecognized commands in command position (first word of a statement)
- Format Document / format on save (1-space indent, corpus-style layout)
| Language | Id | Extensions |
|---|---|---|
| Crown | crown |
.cr, .mcr |
| Crown Assembly | crown-assembly |
.ca |
npm install
npm run compilePress F5 in this folder to open an Extension Development Host with the extension loaded. Open a .cr, .mcr, or .ca file and confirm the status bar language mode is Crown or Crown Assembly.
Crystal also uses .cr. If a .cr file opens as Crystal, use Change Language Mode and pick Crown, or add this to your settings:
"files.associations": {
"*.cr": "crown",
"*.mcr": "crown",
"*.ca": "crown-assembly"
}.mcr and .ca can also be used by other tools. Use the same files.associations / Change Language Mode workaround.
"[crown]": {
"editor.formatOnSave": true
},
"[crown-assembly]": {
"editor.formatOnSave": true
}The formatter uses Crown’s real syntax (not a generic pretty-printer). If a file cannot be parsed, it only trims trailing whitespace and ensures a final newline.
Open these from a Crown checkout in the Extension Development Host:
examples/time.cr,examples/pick.cr,examples/server.crlib/table-row.cr,documentation.cr,repl.crexamples/crown-assembly/hello.ca,control-flow.ca,data-structures.ca
Confirm highlighting (comments, strings, keywords, commands, blocks), completions (se → set, fun → function, pic → pick, reg → register_get in .ca), squiggles on unknown statement-head commands, and Format Document (1-space indent, stable on a second format).