Actions
Available actions in the Tools → Noir menu
The plugin adds several actions to the Tools → Noir menu for managing the language server and exploring Noir features.
Restart Language Server
Section titled “Restart Language Server”Location: Tools → Noir → Restart Language Server
Restarts the nargo lsp connection. Use this when:
- You’ve updated nargo to a new version
- The LSP seems stuck or unresponsive
- Code completion or diagnostics stop working
- You’ve changed nargo-related settings
- Go to Tools → Noir → Restart Language Server
- Wait for the LSP to reinitialize (status bar will show progress)
- LSP features should now work with the fresh connection
Expand Macros
Section titled “Expand Macros”Location: Tools → Noir → Expand Macros
Runs nargo expand on the current project and displays the expanded output.
This is useful for:
- Understanding what macros generate
- Debugging macro-related issues
- Seeing the full code after all macro expansions
How It Works
Section titled “How It Works”- Open a Noir project in your IDE
- Go to Tools → Noir → Expand Macros
- The plugin runs
nargo expandin the background - Expanded output opens in a new scratch file
Example
Section titled “Example”Given this code with a macro:
#[oracle(get_secret)]unconstrained fn get_secret() -> Field {}
fn main() { let secret = unsafe { get_secret() };}The expand action shows the generated code after macro expansion, revealing the underlying implementation.
Browse Standard Library
Section titled “Browse Standard Library”Location: Tools → Noir → Browse Standard Library
Opens the Noir standard library source files in your IDE.
This is useful for:
- Understanding how stdlib functions work
- Finding available functions and modules
- Learning Noir idioms from official code
How It Works
Section titled “How It Works”- Go to Tools → Noir → Browse Standard Library
- The plugin locates the stdlib in your nargo installation
- The stdlib
lib.nrfile opens in the editor - Navigate through the stdlib modules from there
Finding the Stdlib
Section titled “Finding the Stdlib”The plugin finds the stdlib by:
- Running
nargo --versionto find the nargo executable - Locating the stdlib relative to the nargo installation
- Typically found at
~/.nargo/backends/acvm-backend-barretenberg/stdlib/
Stdlib Structure
Section titled “Stdlib Structure”The standard library includes:
lib.nr # Root module, re-exports everything├── collections/ # Array utilities, vectors├── convert/ # Type conversions├── hash/ # Poseidon, Pedersen, SHA256, etc.├── ec/ # Elliptic curve operations├── field/ # Field arithmetic├── merkle/ # Merkle tree utilities├── schnorr/ # Schnorr signatures├── ecdsa_secp256k1/ # ECDSA on secp256k1└── ...Accessing Actions
Section titled “Accessing Actions”Besides the menu, you can access actions via:
Search Everywhere
Section titled “Search Everywhere”Press Shift+Shift and type “Noir” to see all available actions:
- “Restart Noir Language Server”
- “Expand Macros”
- “Browse Standard Library”
Keyboard Shortcuts
Section titled “Keyboard Shortcuts”You can assign custom keyboard shortcuts:
- Go to Settings → Keymap
- Search for “Noir”
- Right-click an action → Add Keyboard Shortcut
- Press your desired key combination
- Click OK
Action Availability
Section titled “Action Availability”| Action | Requires nargo | Requires open project |
|---|---|---|
| Restart Language Server | Yes | Yes |
| Expand Macros | Yes | Yes |
| Browse Standard Library | Yes | No |