Blue Language for Visual Studio Code
Support for Blue, a functional language for durable systems of actors.
What it does
- Highlighting of
.blue files, and of Blue in Markdown code blocks.
- Errors and warnings as you type, from Blue's own checker: the same messages
blue check gives, without running anything.
- Types and documentation on hover, for your own top-level names and for the standard library's, such as
List.map.
- An outline of a file's functions, values, types, actors, choreographies, invariants and tests.
- Snippets for the common declarations: type
fn, match, actor, test, bench and so on.
- Commands: Blue: Run This File and Blue: Run This File's Tests run
blue run and blue test in a terminal.
Highlighting and snippets work on their own. Checking, hover and the outline need Blue installed: the extension starts blue lsp, the language server built into the blue command.
Settings
| Setting |
Default |
What it does |
blue.path |
blue |
The blue command: a name on your PATH, or a full path. It can be set only in your user settings, not by a workspace, since it names a program to run. |
blue.languageServer.enabled |
true |
Whether files are checked as you edit them. |
blue.trace.server |
off |
Logs the messages between the editor and blue lsp, to look into a problem. |
Trust
Checking a file reads the modules it imports and its project's settings, so in a workspace you have not trusted, Blue files are highlighted but not checked, and the run and test commands are off. Trust the workspace to turn them on.
Building it
npm install
npm test # the grammar's tests
npm run check # type-checks the extension
npm run package # makes bluelang-0.1.0.vsix
Install the .vsix with Extensions: Install from VSIX... in the command palette, or code --install-extension bluelang-0.1.0.vsix. The grammar is kept once, in the repository's grammar/blue.tmLanguage.json, and copied in by npm run grammar.