Skip to content

Repository files navigation

vscode-crown

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).

Features

  • 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)

Languages

Language Id Extensions
Crown crown .cr, .mcr
Crown Assembly crown-assembly .ca

Install / debug

npm install
npm run compile

Press 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.

File associations

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.

Format on save

"[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.

Manual checklist

Open these from a Crown checkout in the Extension Development Host:

  • examples/time.cr, examples/pick.cr, examples/server.cr
  • lib/table-row.cr, documentation.cr, repl.cr
  • examples/crown-assembly/hello.ca, control-flow.ca, data-structures.ca

Confirm highlighting (comments, strings, keywords, commands, blocks), completions (seset, funfunction, picpick, regregister_get in .ca), squiggles on unknown statement-head commands, and Format Document (1-space indent, stable on a second format).

About

Visual Studio Code Crown Language Support

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages