Editor Setup
Ce contenu n’est pas encore disponible dans votre langue.
mashin provides editor extensions for VS Code and Zed, plus a tree-sitter grammar that works with any editor that supports tree-sitter.
VS Code
Section titled “VS Code”The VS Code extension provides syntax highlighting, completions, hover documentation, go-to-definition, formatting, and diagnostics.
Installation
Section titled “Installation”Install from the marketplace (search “mashin”) or install locally for development:
# Symlink the extension into your VS Code extensions directoryln -s /path/to/mashin-core/tools/mashin-vscode ~/.vscode/extensions/mashin-languageRestart VS Code. Open any .mashin file to verify syntax highlighting.
Features
Section titled “Features”| Feature | What it does |
|---|---|
| Syntax highlighting | Full mashinTalk grammar (TextMate) |
| Completions | Keywords, step types, @mashin/actions/* machines, config options |
| Hover | Documentation for keywords, step types, stdlib machines, context accessors |
| Go-to-definition | Navigate to stdlib machines, local machines, steps, input fields |
| Formatting | Format via the mashin language server |
| Diagnostics | Real-time validation of machine structure and syntax |
| Snippets | 25+ templates for machines, steps, goals, and common patterns |
Snippets
Section titled “Snippets”Type these prefixes and press Tab:
| Prefix | Creates |
|---|---|
machine |
New machine skeleton |
step-reason |
LLM reasoning step |
step-code |
Pure computation step |
step-call |
Call an action machine |
step-memory |
Memory operation step |
inputs |
Input schema block |
outputs |
Output schema block |
goal |
Goal specification |
call-http-get |
Call @mashin/actions/http/get |
call-http-post |
Call @mashin/actions/http/post |
permissions |
Permission policies |
hooks |
Step hooks/middleware |
Enabling the language server
Section titled “Enabling the language server”The extension ships with a bundled server, so completions, diagnostics and formatting work out of the box with no build step.
To use the full mashin language server instead (the same one the CLI runs), point the extension at it in VS Code settings:
{ "mashin.languageServer.command": "mashin lsp"}mashin lsp speaks LSP over stdio and needs no computer running.
The Zed extension uses the tree-sitter grammar for syntax highlighting and connects to the language server for completions, hover, and diagnostics.
Installation
Section titled “Installation”In Zed, open the Extensions panel (Cmd+Shift+X), select “Install Dev Extension…”, and point it at the tools/mashin-zed/ directory.
Enabling the language server
Section titled “Enabling the language server”Add to your Zed settings (~/.config/zed/settings.json):
{ "lsp": { "mashin-language-server": { "binary": { "path": "mashin", "arguments": ["lsp"] } } }}Tree-sitter grammar
Section titled “Tree-sitter grammar”The tree-sitter grammar is the canonical definition of mashinTalk syntax. Any editor with tree-sitter support can use it.
The grammar lives at tools/tree-sitter-mashin-talk/grammar.js. It handles the full mashinTalk keyword-hierarchy syntax including:
- Machine declarations and all section types
- Step types (
compute,ask,decide,for_each, etc.) - Expressions (arithmetic, string interpolation, arrow functions, match expressions)
- Comments (line and block)
Using with other editors
Section titled “Using with other editors”For editors like Neovim, Helix, or Emacs (with tree-sitter support):
- Clone or link the
tools/tree-sitter-mashin-talk/directory - Build the parser:
cd tools/tree-sitter-mashin-talk && tree-sitter generate && tree-sitter build - Configure your editor to use the grammar for
.mashinfiles - Copy the highlight queries from
tools/tree-sitter-mashin-talk/queries/into your editor’s query directory
Next steps
Section titled “Next steps”- Language Server - Full LSP feature reference
- CLI Reference - The command-line tool