The Noir Language Server provides IDE features by implementing the Language Server Protocol (LSP). It consists of two components:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/noir-lang/noir/llms.txt
Use this file to discover all available pages before exploring further.
- Server — the
nargo lspprocess that performs compilation and analysis. - Client — an editor plugin that communicates with the server and surfaces its results.
Language server
The server is bundled with Nargo. If Nargo is installed,nargo lsp is available. You can confirm it is present by running:
lsp in the list of subcommands.
The server is normally started automatically by the editor plugin and does not need to be launched manually. If you need to start it directly, run:
Language client (VS Code)
Noir provides an official Language Client for Visual Studio Code via the vscode-noir extension.Installation
Install the extension from the Visual Studio Marketplace.Setup
Open your Noir project as the workspace root
Open the folder containing your
Nargo.toml directly in VS Code. The LSP assumes the VS Code workspace root is the same as the Noir project root.Enable the LSP
The extension is active by default. If you have disabled it, open the extension settings and enable Noir: Enable LSP.
Verify the LSP is running
When the language server is running, you will see codelens buttons above functions in
.nr files:Above .nr functions you will see inline codelens buttons for Compile, Execute, and Info actions. These let you compile, measure circuit size, and execute programs directly from the editor.You will also see your #[test] functions appear in the VS Code Testing panel (the beaker icon in the sidebar), where you can run and inspect individual tests.Features
The Noir LSP provides the following editor features:| Feature | Description |
|---|---|
| Diagnostics | Errors and warnings are shown inline as you edit. |
| Go-to-definition | Navigate to the definition of functions, types, and variables. |
| Hover documentation | Hover over identifiers to see their type signatures and doc comments. |
| Code completion | Suggests completions for identifiers, fields, and methods. |
| Codelens | Inline action buttons for compiling, executing, and running tests. |
| Inlay hints | Display inferred types next to expressions. |
Configuration
Open the vscode-noir extension settings (search for “Noir” in VS Code settings) to configure the following options:| Setting | Description |
|---|---|
| Noir: Enable LSP | Enable or disable the language server. When enabled, the extension launches nargo lsp automatically. |
| Noir: Nargo Flags | Additional flags appended when the extension calls nargo lsp. For example: --program-dir ./circuits. |
| Noir: Nargo Path | Absolute path to the nargo binary. Useful if nargo is not on the editor’s PATH. |
| Noir > Trace: Server | Set to messages or verbose to log LSP protocol messages between the client and server. Useful for diagnosing LSP issues. |
Other editors
Any editor that supports LSP can be configured to usenargo lsp as a language server. The exact configuration format depends on the editor.
The server is started by executing nargo lsp and communicating over standard input/output. Configure your editor’s LSP client to point to the nargo binary with the lsp subcommand.
Neovim (nvim-lspconfig)
Neovim (nvim-lspconfig)
Using nvim-lspconfig:
Helix
Helix
Add the following to your
languages.toml:Shell completions
Nargo can generate shell completion scripts to improve CLI ergonomics:bash, zsh, fish, powershell, elvish. See the Nargo CLI reference for details.