Repository navigation
fix: Java source inspection for non-Java projects - #1120
Merged
wenyt (wenytang-ms) merged 1 commit intoNov 4, 2026
Merged
Conversation
wenyt (wenytang-ms)
requested review from
Changyong Gong (chagong) and
Jinbo Wang (testforstephen)
as code owners
November 4, 2026 05:20
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the Java-nature guard and its regression-test plan.
No open issues 🎉
What changed in this PR
Fixes #1119 by checking Java nature before inspecting source classpath entries, preventing Java-model errors for non-Java Maven parent projects while preserving their ordinary folders.
Changes:
- Uses
ProjectUtils.getJavaProject()to skip source-entry inspection for non-Java projects while retaining existing error handling. - Adds an AutoTest regression plan that checks Maven parent folder visibility and verifies the full language-server log contains neither reported error.
| File | Description |
|---|---|
test/e2e-plans/java-dep-source-entry-inspection.yaml |
Adds deterministic folder-visibility and full-log error-absence checks. |
jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/parser/ResourceSet.java |
Validates Java nature before inspecting source classpath entries. |
Review effort: Balanced
Changyong Gong (chagong)
approved these changes
Nov 4, 2026
wenyt (wenytang-ms)
deleted the
wenytang-ms-java-source-inspection-error
branch
November 4, 2026 08:23
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.
Fixes #1119.
Root cause
JavaCore.create(IProject)returns a Java-model handle even when the Eclipse project has no Java nature. The source-folder filtering added in 0.27.7 consequently callsgetOutputLocation()on a non-Java Mavenpackaging=pomparent and logsFailed to inspect Java source entrieswith Java model error 969. The parent project exists; it is the Java-model project that does not exist.Changes
ProjectUtils.getJavaProject()helper to validate Java nature before inspecting source classpath entries.test/mavenandtest/multi-modulefixtures. It expands the Maven parent's physical folders, refreshes Java Projects, and checks the full copied language-server log for both reported errors.Reproduction
test/mavenwith non-Java resources shown in Java Projects.test/multi-moduleto the workspace and wait for Maven import.multi-module > de.myorg.myservice > srcand refresh Java Projects.The parent retains only Maven nature throughout verification; the fix does not add Java nature or change the fixture.
Verification
Local Windows x64 runs used VS Code 1.144.1, Red Hat Java 1.58.0, JDT LS 1.63.0.202610161533, and AutoTest 0.7.28.
java-dep-view-modes.yaml: 36/36 passed, covering flat/hierarchical presentation, refresh, non-Java resource visibility, retainedapplication.yml, and hidden redundant empty physical source ancestors.The fixed VSIX is a local build of 0.27.7, not a new Marketplace release.
Validation screenshots
Before: published 0.27.7
The Maven parent and its physical folders exist, but browsing them logs the inspection failure and Java model error 969.
After: freshly built fixed VSIX
The same Maven parent's
src/mainandsrc/testfolders remain visible. This run passes all 22/22 steps, including both full-log error-absence assertions; the screenshot illustrates the retained folder display rather than serving as the error-absence assertion.Folder-view regression: resource file retained and redundant physical ancestor hidden (36/36 passed)
src/main/resources/application.ymlremains visible, while the duplicate empty physicalsrcancestor stays hidden.