You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The LSP should work with local dependencies in files other than the main.nr file.
Expected Behavior
When I create a file, such as foo.nr with this content:
use crate::bar::bar;
fn foo(x : Field, y : Field) {
bar(x, y);
}
The dependency should not be a compile error.
Bug
This bug stems from the fact that we compile the saved file (foo.nr in the example above) as the root of the project. Since the root file is expected to contain the mod definitions, but those are all specified in main.nr, the LSP compilation reports an error because there was no mod bar.
Side note: adding mod bar makes the file compile with no warnings via the LSP but nargo compile would fail because it is not actually the root.
To Reproduce
Create a multi-file noir project
Use a crate:: dependency in a file that is not main.nr
Save the file with the LSP running
Notice the diagnostic warning on the dependency
Installation Method
None
Nargo Version
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered:
Aim
The LSP should work with local dependencies in files other than the
main.nr
file.Expected Behavior
When I create a file, such as
foo.nr
with this content:The dependency should not be a compile error.
Bug
This bug stems from the fact that we compile the saved file (
foo.nr
in the example above) as the root of the project. Since the root file is expected to contain themod
definitions, but those are all specified inmain.nr
, the LSP compilation reports an error because there was nomod bar
.Side note: adding
mod bar
makes the file compile with no warnings via the LSP butnargo compile
would fail because it is not actually the root.To Reproduce
crate::
dependency in a file that is notmain.nr
Installation Method
None
Nargo Version
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered: