-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(lsp): Ensure lsp does not crawl past the root specified #2322
Conversation
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I just want to check that we're not creating an additional need for us to make paths absolute in order to find the package manifest that we haven't accounted for elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This currently panics if you do nargo --program-dir ./foo compile
but if you do nargo --program-dir /absolute/path/to/foo compile
then we succeed.
We should normalize the paths we're passing into these functions to avoid this
Oof, looks like this is on master actually. |
Yeah, I didn't change the way that program-dir was searched. I don't think it ever supported relative paths |
I've addresses this panic in #2324 |
* master: (26 commits) chore(noir): Release 0.10.0 (#2039) fix(lsp): Ensure lsp does not crawl past the root specified (#2322) fix: Prevent panic when passing relative paths to `--program-dir` (#2324) fix: Overflowing assignment will result in an error (#2321) chore: clippy fixes (#2320) chore: Parameterize the build mode for noir-wasm (#2317) chore: Make `wasm` tests pull from `result` directory (#2319) chore: Fix typo (#2315) chore: Reuse workspace target directory in wasm build script (#2312) feat(nargo): Add `--workspace` flag to run commands in every package (#2313) chore(frontend): Replace `ModuleOrigin` with `Location` on `ModuleData` (#2308) fix: Fix 3 parser test cases in parsing (#2284) fix: Require package names to be non-empty (#2293) fix(nargo)!: Remove `-p` short flag from the `--program-dir` flag (#2300) feat: optionally output a debug artifact on compile (#2260) chore: `nargo info` now prints information as a prettified table (#2282) fix(lsp): Pass `--program-dir` to test command from codelens (#2292) fix(nargo): Allow `--program-dir` flag anywhere in a command (#2290) feat: Execute brillig opcodes with constant inputs at compile-time (#2190) feat: Add basic benchmarking (#2213) ...
* master: (34 commits) chore: move orphaned integration tests to new directory (#2331) chore(noir): Release 0.10.1 (#2328) feat(ssa): Switch mem2reg pass to be per function rather than per block (#2243) feat(ssa): Perform dead instruction elimination on intrinsic functions (#2276) feat: Add full call stacks to runtime errors (#2310) chore(ci): fix mismatched input name to publish workflow (#2327) chore: add README for integration test structure (#2277) feat: Improved error message for unexpected return type (#2302) feat(stdlib): Implement `str` `as_bytes` and `into_bytes` function (#2298) chore(ci): automatically convert changelog entries to sentence case (#2325) chore(noir): Release 0.10.0 (#2039) fix(lsp): Ensure lsp does not crawl past the root specified (#2322) fix: Prevent panic when passing relative paths to `--program-dir` (#2324) fix: Overflowing assignment will result in an error (#2321) chore: clippy fixes (#2320) chore: Parameterize the build mode for noir-wasm (#2317) chore: Make `wasm` tests pull from `result` directory (#2319) chore: Fix typo (#2315) chore: Reuse workspace target directory in wasm build script (#2312) feat(nargo): Add `--workspace` flag to run commands in every package (#2313) ...
Description
Problem*
Resolves #2261
Summary*
This reworks the crawling for Nargo.toml files. When searching for the
program_dir
, we still search to the root usingfind_package_root
; however,find_package_manifest
requires a root where we stop the crawling. Additionally, we now read the<program_dir>/Nargo.toml
exactly instead of traversing.These changes allowed me to fix a problem with the LSP where it would crawl past the
root_uri
and find a Nargo.toml outside of the directory you have opened.Documentation
This PR requires documentation updates when merged.
Additional Context
PR Checklist*
cargo fmt
on default settings.