fix: hide empty non-Java folder ancestors - #1063
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes duplicate empty physical source ancestors in the Java Projects view while preserving non-Java resources.
Changes:
- Filters redundant source-root ancestors in JDTLS.
- Adds Maven fixture and regression coverage.
- Extends AutoTest coverage for resource visibility.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
ResourceSet.java |
Filters physical source ancestors. |
projectView.test.ts (simple) |
Updates expected project children. |
projectView.test.ts (Maven) |
Tests resource-root visibility. |
application.yml |
Adds a non-Java resource fixture. |
java-dep-view-modes.yaml |
Adds E2E regression checks. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
wenyt (wenytang-ms)
marked this pull request as ready for review
August 20, 2026 04:08
wenyt (wenytang-ms)
requested review from
Changyong Gong (chagong) and
Jinbo Wang (testforstephen)
as code owners
August 20, 2026 04:08
Changyong Gong (chagong)
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/mainhierarchyThis fixes the empty physical
src/maintree reported when Show Non-Java Resources is enabled. It intentionally does not change the visibility policy for Maventargetor other build-output folders.Root cause
java.getPackageDatacombines Java classpath roots withIJavaProject.getNonJavaResources(). A physical ancestor such assrccould therefore be emitted as a normal folder even thoughsrc/main/javaandsrc/main/resourceswere already represented as package roots. Expanding the physical folder filtered those Java elements and left an empty hierarchy.Testing
npm run compilenpm run tslintjava-dep-view-modes: 36/36 passing with the fixverify-empty-physical-src-hiddenfailsFixes #1062
Related to #1044
UI verification
The Maven resource root and
application.ymlremain visible, while the duplicate physicalsrchierarchy is absent.srcfolder is shown below.vscode.srcfolder is removed;targetfollows.vscode.