This extension provides language support for mq in the Zed editor.
mq is a jq-like command-line tool for Markdown processing. It allows you to easily slice, filter, map, and transform Markdown files.
- Syntax highlighting for
.mqfiles using Tree-sitter grammar - Language Server Protocol (LSP) support via
mq-lsp - Auto-completion and diagnostics
- Code navigation and hover information with type display
- Inlay hints for inline type annotations
- Type checking support (configurable via settings)
The "mq" extension is not yet published on the Zed Extensions.
- Open Zed
- Open the Extensions panel (
cmd-shift-xon macOS) - Search for "mq"
- Click "Install"
The extension will automatically download and install the mq-lsp language server on first use.
Create or open a .mq file to activate the extension. The language server will provide:
- Syntax highlighting
- Code completion
- Diagnostics and error checking
- Hover information
- Go to definition
The extension will automatically detect and use mq-lsp if it's in your PATH. Otherwise, it will download the appropriate binary for your platform from the mq GitHub releases.
Enable type checking by adding the following to your Zed settings.json (cmd-,):
{
"lsp": {
"mq-lsp": {
"initialization_options": {
"enableTypeCheck": true,
"strictArray": false,
"tuple": false
}
}
}
}| Option | Default | Description |
|---|---|---|
enableTypeCheck |
false |
Enable type checking; passes --enable-type-checking to mq-lsp |
strictArray |
false |
Arrays must contain elements of a single type (requires enableTypeCheck) |
tuple |
false |
Heterogeneous array literals are typed as tuples (requires enableTypeCheck) |
Inlay hints show inferred types inline in the editor. Enable them in your Zed settings.json:
{
"inlay_hints": {
"enabled": true
}
}To use a specific mq-lsp binary, configure it in your Zed settings.json:
{
"lsp": {
"mq-lsp": {
"binary": {
"path": "/path/to/mq-lsp"
}
}
}
}Contributions are welcome! Please see the mq repository for more information.
This extension is provided under the MIT License. See the LICENSE file for details.