Skip to content

fix: hide empty non-Java folder ancestors - #1063

Merged
wenyt (wenytang-ms) merged 6 commits into
mainfrom
fix/1062-empty-non-java-folders
Aug 20, 2026
Merged

fix: hide empty non-Java folder ancestors#1063
wenyt (wenytang-ms) merged 6 commits into
mainfrom
fix/1062-empty-non-java-folders

Conversation

@wenytang-ms

@wenytang-ms wenyt (wenytang-ms) commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • hide physical non-Java folder ancestors when their entire subtree is already represented by Java model/package-root nodes
  • keep real non-Java resources visible through their Java resource root
  • add a Maven regression fixture and project-view test for the empty src/main hierarchy

This fixes the empty physical src/main tree reported when Show Non-Java Resources is enabled. It intentionally does not change the visibility policy for Maven target or other build-output folders.

Root cause

java.getPackageData combines Java classpath roots with IJavaProject.getNonJavaResources(). A physical ancestor such as src could therefore be emitted as a normal folder even though src/main/java and src/main/resources were already represented as package roots. Expanding the physical folder filtered those Java elements and left an empty hierarchy.

Testing

  • JDTLS extension build and checkstyle
  • npm run compile
  • npm run tslint
  • Maven Project View Tests: 15 passing
  • AutoTest java-dep-view-modes: 36/36 passing with the fix
  • Pre-fix A/B: 35/36 passing; only verify-empty-physical-src-hidden fails

Fixes #1062
Related to #1044

UI verification

The Maven resource root and application.yml remain visible, while the duplicate physical src hierarchy is absent.

Before After
The extra physical src folder is shown below .vscode. The extra src folder is removed; target follows .vscode.
Before: duplicate physical src folder After: duplicate physical src folder removed

UI verification for empty src hierarchy fix

wenyt (wenytang-ms) and others added 5 commits August 20, 2026 10:31
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@wenytang-ms
wenyt (wenytang-ms) merged commit 6d43dfb into main Aug 20, 2026
34 checks passed
@wenytang-ms
wenyt (wenytang-ms) deleted the fix/1062-empty-non-java-folders branch August 20, 2026 04:24
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.

Empty src/main folder appears when Show Non-Java Resources is enabled

3 participants