feat: eager test discovery and JAR fallback resolution improvements#29
Merged
monkey666-cr merged 2 commits intoMay 27, 2026
Merged
Conversation
Resolve missing Bazel build-output JARs (e.g., bazel-out/.../bin/3rdparty/lib<name>.jar) to their actual JAR files in the external repository cache. This fixes the issue where 3rdparty java_library wrapper targets (like //3rdparty:junit) produce output JARs that don't exist after aspect-only builds, causing them to be silently dropped from the classpath. Changes: - Add resolveBuildOutputJar() to handle lib<name>.jar pattern matching and repo search - Add extractArtifactNameFromLibJar() to extract artifact name from filename - Add findCandidateRepoDir() to search external/ with priority: exact_double > exact_single > prefix > bzlmod - Update resolveFallbackJar() to call new build-output resolution when /external/ path resolution fails - Add clearActiveDebugProject command handler to clear debug session gating - Add onDidTerminateDebugSession handler to call clearActiveDebugProject on debug end - Add comprehensive unit tests (15 new test cases) This ensures that tests can find JUnit and other 3rdparty dependencies even when the aspect build doesn't materialize the wrapper JAR on disk. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Trigger testing.refreshTests via vscjava.vscode-java-test after: - Initial JDT.LS import (via serverReady()) - Scope-change re-imports Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
testing.refreshTestsviavscjava.vscode-java-testafter initial JDT.LS import (serverReady()) and scope-change re-imports, so tests are discovered eagerly without manual interventionbazel-out/.../bin/3rdparty/lib<name>.jar) to their actual JARs in the external repository cache, fixing classpath gaps for targets like//3rdparty:junitChanges
Extension (TypeScript)
serverReady()and scope-change re-importsJava Bridge
resolveBuildOutputJar()to handlelib<name>.jarpattern matching and repo searchextractArtifactNameFromLibJar()to extract artifact name from filenamefindCandidateRepoDir()to searchexternal/with priority:exact_double > exact_single > prefix > bzlmodresolveFallbackJar()to call new build-output resolution when/external/path resolution failsclearActiveDebugProjectcommand handler andonDidTerminateDebugSessionhandlerTest plan
//3rdparty:junitand similar wrapper targets appear in test classpathsmvn test -Djava.library.path=../target/releaseactiveDebugProjecton termination🤖 Generated with Claude Code