Skip to content

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

Merged
merged 26 commits into from
May 18, 2025

Conversation

ksnll
Copy link
Contributor

@ksnll ksnll commented May 6, 2025

When we visit, we now track both use statement and mod 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.

@ksnll ksnll marked this pull request as ready for review May 6, 2025 20:09
Copy link

codecov bot commented May 6, 2025

Codecov Report

Attention: Patch coverage is 97.25610% with 9 lines in your changes missing coverage. Please review.

Project coverage is 91.76%. Comparing base (c084648) to head (9c6215e).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
crates/extricrate/src/lib.rs 97.25% 9 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nitnelave nitnelave requested a review from Copilot May 7, 2025 02:51
Copy link

@Copilot Copilot AI left a 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.

ksnll and others added 2 commits May 18, 2025 06:45
Co-authored-by: nitnelave <nitnelave1@gmail.com>
@nitnelave nitnelave merged commit b618479 into nitnelave:master May 18, 2025
7 checks passed
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