Skip to content

feat: allow running nargo expand#104

Merged
jfecher merged 1 commit intomasterfrom
ab/nargo-expand
Jun 24, 2025
Merged

feat: allow running nargo expand#104
jfecher merged 1 commit intomasterfrom
ab/nargo-expand

Conversation

@asterite
Copy link
Contributor

@asterite asterite commented Jun 24, 2025

Description

Problem

No issue, just something nice to have: allow invoking nargo expand via LSP.

Summary

Goes together with noir-lang/noir#9012

This works similar to Rust Analyzer's "expand macro", except that in our case the entire crate's contents are put in a new document.

Here's it working with a simple file:

lsp-nargo-expand-simple

Here's with one of Aztec's contracts:

lsp-nargo-expand-contract

Additional Context

In the future we could add another comment to expand the crate but only show the contents of, for example, the current module. But for now this command alone is good enough because you can make a code change, re-run the command and it'll update the document's content in-place so if you scrolled down to where you had interesting stuff to see you'll see the update you wanted to see.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@asterite asterite requested review from a team and TomAFrench and removed request for TomAFrench June 24, 2025 17:40
@jfecher jfecher merged commit 63e2ce5 into master Jun 24, 2025
4 checks passed
@jfecher jfecher deleted the ab/nargo-expand branch June 24, 2025 19:42
@github-actions github-actions bot mentioned this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants