Skip to content

Latest commit

 

History

History
100 lines (72 loc) · 2.52 KB

File metadata and controls

100 lines (72 loc) · 2.52 KB

mq Extension for Zed

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.

Features

  • Syntax highlighting for .mq files 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)

Installation

The "mq" extension is not yet published on the Zed Extensions.

  1. Open Zed
  2. Open the Extensions panel (cmd-shift-x on macOS)
  3. Search for "mq"
  4. Click "Install"

The extension will automatically download and install the mq-lsp language server on first use.

Usage

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

Configuration

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.

Type Checking

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

Inlay hints show inferred types inline in the editor. Enable them in your Zed settings.json:

{
  "inlay_hints": {
    "enabled": true
  }
}

Custom Binary Path

To use a specific mq-lsp binary, configure it in your Zed settings.json:

{
  "lsp": {
    "mq-lsp": {
      "binary": {
        "path": "/path/to/mq-lsp"
      }
    }
  }
}

Contributing

Contributions are welcome! Please see the mq repository for more information.

License

This extension is provided under the MIT License. See the LICENSE file for details.