Repository navigation
fix: import missing in-repo Maven modules so cross-group symbols resolve (#110) - #114
Merged
Merged
Conversation
aviadshiber
force-pushed
the
fix/110-part-b-dependency-modules
branch
from
September 29, 2026 11:43
02d8743 to
3a40ed3
Compare
aviadshiber
marked this pull request as ready for review
September 29, 2026 13:07
…lve (#110) jdtls imports only the opened file's Maven group. A dependency on a reactor module in another group is resolved by m2e from the local repository at ${revision}, where it is usually missing, so every symbol from it is a false "cannot be resolved" / "undefined for the type" error. - reactor.py: GA -> module dir index of the modules reachable through <modules> (profiles unioned), contained in the reactor root, no symlinked poms, DOCTYPE/ENTITY and >1 MB poms rejected, inherited groupId, duplicate GAs dropped, bounded to 5000 poms / 10 s; "Missing artifact" parser (optional "Offline / " prefix). - dependency_modules.py: on a pom.xml "Missing artifact" error for an in-repo, uncovered module, add its folder via one debounced, batched didChangeWorkspaceFolders; separate registry; session budget (default 60, JAVA_FUNCTIONAL_LSP_DEPENDENCY_MODULES or jdtls.dependencyModules, 0 disables, max 200) with a WARNING listing unresolved GAs; a group expansion removes the dependency folders it covers in the same event and they are never re-added. - On language/eventNotification 100 (ClasspathUpdated) or when a pom's missing-artifact errors clear, send java.project.refreshDiagnostics for each open .java file under that project (debounced per project); the results go through the #109 hold unchanged. - e2e regression test on a two-group ${revision} reactor with an isolated, primed, offline local repository; it fails on PR A's head. - Version 0.14.0; README section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A missing pom-type dependency on a group or the reactor root would add its whole subtree as one folder, bypassing the group cap. The index now records aggregators (poms with <modules>) and never resolves them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Compare dependency-module folders and imported/group folders resolved, so a client root reached through a symlink still retires and dedupes them. - Keep flushing while candidates arrive during an in-flight send. - Reject DOCTYPE/ENTITY declarations at the expat level too (UTF-16 poms), and tolerate poms in encodings expat refuses instead of aborting the index. - Ignore coordinates outside Maven's character set, so no raw pom text is logged. - Tests: symlinked-root cases, send race, UTF-16 poms, guard log assertions, positive controls for negative assertions, e2e log check of the import path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aviadshiber
force-pushed
the
fix/110-part-b-dependency-modules
branch
from
September 29, 2026 14:42
3a40ed3 to
1cc6880
Compare
aviadshiber
changed the base branch from
fix/110-part-a-scope-and-logging
to
main
September 29, 2026 14:42
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.
Stacked on #113 (PR A). Please review and merge #113 first; this PR's base is
fix/110-part-a-scope-and-logging.Why
jdtls imports only the Maven group of the opened file. When a module in that group depends on a reactor module in another group, m2e looks it up in the local repository at
${revision}(for exampleTABOOLA-DEFAULT-VERSION). That version is never published, so the module is missing, and every symbol from it becomes a false error: "cannot be resolved", "is undefined for the type", or "The hierarchy of the type X is inconsistent".Spike S1 (real jdtls 1.61) showed two things:
java.project.refreshDiagnosticscall clears them.Change
reactor.pybuilds the index that mapsgroupId:artifactIdto a module directory. Only modules reachable through<modules>are included, with all profiles unioned.<!DOCTYPE/<!ENTITY, are rejected before XML parsing.<parent>. Coordinates containing${are skipped.[Offline / ]Missing artifact g:a:type[:classifier]:version.dependency_modules.pyreacts to Error diagnostics on apom.xml. Each missing GA that is in the index and not yet covered by an imported folder becomes a candidate.didChangeWorkspaceFoldersadd, debounced 500 ms. Added modules report their own missing dependencies the same way, so rounds chain.modulesand_expanded_groups.JAVA_FUNCTIONAL_LSP_DEPENDENCY_MODULESorjdtls.dependencyModules.0disables it, and values are clamped to 200. When the budget runs out, a WARNING lists the GAs left unresolved.language/eventNotificationwith eventType 100 (ClasspathUpdated), and apom.xmlwhose missing-artifact errors clear. The proxy then sendsworkspace/executeCommand java.project.refreshDiagnostics [uri, "thisFile", false]for each.javafile the client has open under that project, debounced per project. The resulting publishes go through the Stale diagnostics lag behind edits (imports/signature changes report false errors until recompile) #109 hold unchanged.Testing
tests/test_e2e_dependency_modules.py) runs the real server and real jdtls.root/{groupA/common, groupB/it}with${revision}. The client root isroot, and jdtls is scoped togroupB.com.example. It runs offline and is passed throughsettings.xmlininitializationOptions.HOMEand-Duser.home, so~/.m2and~/.cacheare never touched.e75bb070:1 passed in 4.07s. The proxy log from that run:tests/test_reactor.py,tests/test_dependency_modules.py) cover:uv run ruff check .,uv run ruff format --check .,uv run mypy src, anduv run pytest -qall pass: 973 passed, 1 pre-existing skip, and the e2e tests ran against local jdtls.Fixes #110
🤖 Generated with Claude Code