Editor Setup
Configure editor support for .mg files — syntax highlighting, diagnostics, completions, and more
Migraine provides built-in editor support for .mg workflow files. Use migraine init --editor to automatically configure your editor.
Quick Start
Supported Editors
VS Code
Installs the bundled Migraine extension with:
- Syntax highlighting — Full TextMate grammar for
.mgfiles - Diagnostics — Real-time parse error detection
- Autocompletion — Keywords, blocks, properties, value prefixes
- Hover docs — Markdown documentation on hover
- Document outline — Block structure in the sidebar
Neovim
Writes configuration to ~/.config/nvim/:
- LSP configuration —
lua/migraine_lsp.luausinglspconfig - Filetype detection —
.mgfiles mapped tomigrainefiletype - Syntax highlighting — Vim syntax definitions
After setup, add to your init.lua:
Vim
Writes configuration to ~/.vim/:
- Filetype detection —
.mgfiles mapped tomigrainefiletype - Syntax highlighting — Vim syntax definitions
- ALE linter — Integration with Asynchronous Lint Engine
Helix
Appends Migraine LSP configuration to languages.toml:
This adds an entry like:
LSP Server
The Migraine LSP server runs via stdio and provides:
| Feature | Description |
|---|---|
| Diagnostics | Parse errors shown inline |
| Completion | Keywords, blocks, properties, value prefixes |
| Hover | Documentation on hover |
| Document symbols | metadata, workflow, config blocks in outline |
| Semantic tokens | Rich token-based highlighting |
Starting the LSP manually
The LSP is started automatically by configured editors. To run it manually:
This starts a JSON-RPC server on stdio, communicating via the Language Server Protocol.
Manual LSP Configuration
If you need to configure an editor manually, the LSP server command is:
File type: migraine
File extensions: .mg
Example: LSP with Neovim (manual)
Example: LSP with Helix (manual)
Add to ~/.config/helix/languages.toml (or ~/Library/Preferences/helix/languages.toml on macOS):
Migraine