-
Notifications
You must be signed in to change notification settings - Fork 2
Navigate using mod
rather than use
#2
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2 +/- ##
===========================================
+ Coverage 9.67% 91.76% +82.08%
===========================================
Files 3 3
Lines 31 510 +479
===========================================
+ Hits 3 468 +465
- Misses 28 42 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR revises module navigation by tracking both use and mod statements and maintaining ancestor information for module imports.
- Introduces a new Visitor struct to record both use and mod declarations.
- Updates file traversal and test expectations to reflect the new module navigation strategy.
- Adds new structures and functions (e.g., FileToVisit and mod_to_path) to support the navigation logic.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
crates/extricrate/tests/fixtures/simple/src/module_a/module_b.rs | Adds a simple use statement for testing purposes. |
crates/extricrate/tests/fixtures/simple/src/module_a/mod.rs | Registers module_b as a submodule via a mod declaration. |
crates/extricrate/tests/fixtures/simple/src/main.rs | Declares module_a to initiate module navigation. |
crates/extricrate/src/lib.rs | Updates the visitor logic and file traversal to incorporate mod statements and track module ancestors. |
Co-authored-by: nitnelave <nitnelave1@gmail.com>
Co-authored-by: nitnelave <nitnelave1@gmail.com>
When we visit, we now track both
use
statement andmod
statements, and we use the latter to visit further files.We also now keep track of
ancestors
, so we always know which module is importing any other module.