Skip to content

feat: added package dependency detection - #197

Merged
matt-dahlgren merged 3 commits into
CA-Visualizer-for-Education:mainfrom
ericycx:package_interface_detection
Jul 28, 2026
Merged

feat: added package dependency detection#197
matt-dahlgren merged 3 commits into
CA-Visualizer-for-Education:mainfrom
ericycx:package_interface_detection

Conversation

@ericycx

@ericycx ericycx commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Overview

I added a way for getFileImports to detect package imports and wrote tests for it as well.

Proposed Changes

In Java package declarations only occur as the first line of the file, if package is seen in the file, then it will first create a set of all files in the package, and then parse the entire file looking for files that are used from the package.

Screenshots of your changes (if applicable)

How to Test & Review

I wrote 2 tests covering the case when there is a package declaration, and when there is both a package declaration and imports in the file, which can be tested using npm test.

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality) X
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots)
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📚 Documentation update (change that only updates documentation)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

Before opening your pull request:

  • I have performed a self-review of my changes.

    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.

    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.

    • This is required for new features.
  • (Frontend) I have added/updated text in i18n JSON files for any new user-facing strings to support multilingual features.
    After opening your pull request:

  • I have verified that the CI tests have passed.

  • I have requested a review from a project maintainer, and a fellow student.

  • Technical Debt: If temporary workarounds or "TODOs" were used, I have opened a tracking issue to address them properly.

    • Linked Issues:

Questions and Comments

(Include any questions or comments you have regarding your changes.)

@ericycx
ericycx requested a review from matt-dahlgren as a code owner July 27, 2026 05:27
@ericycx ericycx assigned ericycx and unassigned ericycx Jul 27, 2026

@matt-dahlgren matt-dahlgren left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work thank you!

@matt-dahlgren
matt-dahlgren merged commit 34a3403 into CA-Visualizer-for-Education:main Jul 28, 2026
3 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