Skip to content
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

Allow placing a mod.nr file within a module folder to be the entrypoint to that module. #4860

Open
TomAFrench opened this issue Apr 21, 2024 · 0 comments · May be fixed by #5039
Open

Allow placing a mod.nr file within a module folder to be the entrypoint to that module. #4860

TomAFrench opened this issue Apr 21, 2024 · 0 comments · May be fixed by #5039
Assignees
Labels
enhancement New feature or request

Comments

@TomAFrench
Copy link
Member

TomAFrench commented Apr 21, 2024

I would like to lay out my modules similarly to how I do it in Rust, such as below.

├── src
│    ├── main.nr
│    └─── foo
│         ├── mod.nr
│         └── bar.nr
└── Nargo.toml

This is not currently possible and I must do it this other way (which is also supported by rust)

├── src
│    └── main.nr
│    ├── foo.nr
│    └── foo
│         └── bar.nr
└── Nargo.toml

We should update how we look for modules in the file manager to support the first style of laying out imports as well. Note that we should error if I do the below.

├── src
│    ├── main.nr
│    ├── foo.nr
│    └─── foo
│          ├── mod.nr
│          └── bar.nr
└── Nargo.toml

See also #3850

@TomAFrench TomAFrench added the enhancement New feature or request label Apr 21, 2024
@michaeljklein michaeljklein linked a pull request May 16, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Backlog
Development

Successfully merging a pull request may close this issue.

2 participants