Skip to content

feat: add configurable full JAR build mode for complete IDE experience#15

Merged
monkey666-cr merged 2 commits into
monkey666-cr:mainfrom
runchen0919:refactor/source-resolution
May 14, 2026
Merged

feat: add configurable full JAR build mode for complete IDE experience#15
monkey666-cr merged 2 commits into
monkey666-cr:mainfrom
runchen0919:refactor/source-resolution

Conversation

@runchen0919
Copy link
Copy Markdown
Contributor

@runchen0919 runchen0919 commented May 14, 2026

Summary

  • Add a bazel-jdt.syncMode setting (fast/full) that controls whether Bazel aspect builds request full JARs or header JARs
  • In full mode, a new intellij-resolve-java-full-jars output group builds transitive runtime JARs, resolving missing imports and InlayHint errors caused by hjars stripping private members
  • JAR selection logic checks file existence before using full JARs, falling back to compile_jars (hjars) when the full JAR hasn't been built

Changes

  • graph.rs: Add full JAR resolution with existence-check fallback logic
  • intellij_info_impl_bundled.bzl: Add intellij-resolve-java-full-jars output group
  • jni_exports.rs / state.rs: Thread full_jars flag through JNI layer
  • command.rs: Support --output_groups flag selection based on sync mode
  • BazelBridge.java / BazelCommandHandler.java: Expose sync mode to Java layer
  • vscode-extension: Add bazel-jdt.syncMode configuration setting

Data Flow

VS Code bazel-jdt.syncMode setting → Java BazelBridge → JNI → Rust build_with_aspects_sync(full_jars: bool) → Bazel --output_groups flag

Test plan

  • Verify fast mode (default) works as before with header JARs
  • Verify full mode triggers full JAR build and resolves previously missing imports
  • Verify fallback works when full JARs are unavailable

🤖 Generated with Claude Code

runchen0919 and others added 2 commits May 14, 2026 17:35
…lti-strategy chain

Merge separate target_jars and target_source_jars maps into a single
ResolvedJar struct that pairs each classpath JAR with its source
attachment. Introduce build_resolved_jars() with a 6-strategy resolution
chain: class_to_source, interface_to_source, source_by_dir, single_source,
infer_source, convention_probe, and maven_cache fallback.

Key changes:
- Add ResolvedJar struct pairing classpath_path with source_path
- Remove get_target_source_jar() in favor of per-jar source_path
- Filter stub source JARs (< 1KB) and probe ~/.m2 as fallback
- Deduplicate classpath entries and merge source from later targets
- Add placeholder native libs in debug build script for bnd validation
- Enable bazel_graph=info logging for source resolution diagnostics

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a sync mode setting (fast/full) that controls whether the Bazel
aspect build requests full JARs or header JARs. In full mode, a new
`intellij-resolve-java-full-jars` output group builds transitive
runtime JARs, resolving missing imports and InlayHint errors caused
by hjars stripping private members.

The JAR selection logic now checks file existence before using full
JARs, falling back to compile_jars (hjars) when the full JAR hasn't
been built. This ensures correct classpath entries regardless of
which sync mode was used.

Data flow: VS Code `bazel-jdt.syncMode` setting → Java BazelBridge
→ JNI → Rust `build_with_aspects_sync(full_jars: bool)` → Bazel
`--output_groups` flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@monkey666-cr monkey666-cr merged commit 58eb2ac into monkey666-cr:main May 14, 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