Skip to content

DROOdotFOO/aztec-noir

Repository files navigation

Aztec Noir ("Zoir")

Zed Downloads

Noir language support for Zed, focused on Aztec network development.

Aztec Focus

Aztec Noir gives Aztec contract authors a first-class editor experience in Zed. Noir is the DSL Aztec uses for its private-by-default L2, and this extension is scoped accordingly:

  • Tracks Noir versions used by current Aztec releases
  • Prioritizes editor support for the Aztec contract surface (notes, oracles, public/private functions)
  • Tooling integration aimed at the nargo + Aztec CLI workflow

If you only need generic Noir editing without the Aztec slant, the existing Noir extension covers that case.

Features

  • Syntax highlighting - Full highlighting for Noir keywords, types, operators, and ZK-specific constructs
  • Language server integration - Powered by nargo lsp for diagnostics, hover, go-to-definition, and completions
  • Document outline - Navigate functions, structs, traits, and modules
  • Bracket matching - Including generic angle brackets
  • Auto-indentation - Smart indentation for blocks and expressions
  • Vim text objects - Function, class, parameter, and block selections
  • Runnable detection - Detect #[test] functions and main for one-click execution

Installation

From Zed Extensions

  1. Open Zed
  2. Press Cmd+Shift+X (or Ctrl+Shift+X on Linux)
  3. Search for "Aztec Noir"
  4. Click Install

Manual Installation

Clone this repository into your Zed extensions directory:

git clone https://github.com/DROOdotFOO/aztec-noir ~/.config/zed/extensions/aztec-noir

Requirements

Language Server (nargo)

The extension automatically manages the nargo LSP binary:

  1. PATH lookup - Uses nargo from PATH if available (respects noirup installations)
  2. Automatic download - Downloads from GitHub releases if not found (macOS/Linux only)

macOS / Linux

Install nargo with noirup:

curl -L https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash
noirup

Windows

Noir does not provide pre-built Windows binaries. You must build from source:

  1. Install Rust
  2. Clone and build nargo:
    git clone https://github.com/noir-lang/noir
    cd noir
    cargo build --release -p nargo
  3. Add target\release to your PATH

Configuration

Configure the language server in your Zed settings (~/.config/zed/settings.json):

{
  "lsp": {
    "nargo": {
      "binary": {
        "path": "/opt/noir/bin/nargo",
        "arguments": ["--show-output"],
        "env": { "NARGO_LOG": "debug" }
      }
    }
  }
}

All binary.* fields are optional. When binary.path is set, the extension uses it directly and skips PATH lookup and automatic download.

Running Tests

To enable one-click test running, add task templates to ~/.config/zed/tasks.json:

[
  {
    "label": "Noir: Run Test",
    "command": "nargo",
    "args": ["test", "--exact", "$ZED_CUSTOM_run"],
    "tags": ["noir-test"]
  },
  {
    "label": "Noir: Execute",
    "command": "nargo",
    "args": ["execute"],
    "tags": ["noir-main"]
  }
]

After adding these, you'll see run indicators next to #[test] functions and main.

Noir Language

Noir is a domain-specific language for zero-knowledge proofs. It enables writing private applications and verifiable computations.

Example:

fn main(x: Field, y: pub Field) {
    assert(x != y);
}

#[test]
fn test_main() {
    main(1, 2);
}

Tree-sitter Grammar

Syntax highlighting is powered by tree-sitter-noir.

Development

Build the extension

cargo build --release --target wasm32-wasip1

License

MIT OR Apache-2.0

About

Noir language support for Zed

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

 
 
 

Contributors