Skip to content

DROOdotFOO/zoir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zoir

Zed Downloads

Noir zero-knowledge language support for Zed.

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 "Zoir"
  4. Click Install

Manual Installation

Clone this repository into your Zed extensions directory:

git clone https://github.com/Hydepwns/zoir ~/.config/zed/extensions/zoir

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": {
      "settings": {
        "args": []
      }
    }
  }
}

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