Add Java code graph support and Spring dependency injection resolution - #122
Add Java code graph support and Spring dependency injection resolution#122LudwigAndreas wants to merge 2 commits into
Conversation
theDakshJaitly
left a comment
There was a problem hiding this comment.
The focused Java/Spring tests, typecheck, and build pass, but the implementation currently corrupts common Java symbol identities and can create incorrect Spring DI edges. Please address the inline findings. In addition, this cannot be approved under the documented code-graph contribution policy as submitted: no approved code-graph issue is linked, and docs/extractors.md explicitly requires the language extractor to merge before its framework resolver rather than bundling both in one PR. Please split the Java extractor and Spring resolver into separately scoped changes backed by an approved issue.
| extra?: Partial<ExtractedNode>, | ||
| ): string | null { | ||
| if (!name) return null; | ||
| const id = generateNodeId(this.filePath, kind, name); |
There was a problem hiding this comment.
Using only the simple declaration name here produces duplicate IDs for ordinary Java code. The supplied fixture emits 27 nodes but only 25 unique IDs: PaymentGateway.charge() collides with StripePaymentGateway.charge(), and the inventory fields in OrderService and ReportService also collide. GraphStore.insertNode upserts on ID, so later declarations overwrite earlier ones and containment edges point at the same persisted symbol. Please derive a stable scope-qualified identity for Java declarations (and keep the Spring resolver's generated source IDs aligned), with tests covering same-named members in different classes and overloaded methods.
| return { original: ref, targetNodeId: target.node.id, confidence: 0.95, resolvedBy: "framework" }; | ||
| } | ||
|
|
||
| const fallback = context.getNodesByName(targetType) |
There was a problem hiding this comment.
This fallback runs even when an explicit qualifier failed to match. Replacing @Qualifier("stripe") with @Qualifier("missing") still resolves the dependency to the unique PaymentGateway interface at 0.75 confidence, creating a wrong DI edge instead of leaving it unresolved. When a qualifier is present and no bean with that name matches, please return null; add coverage for unknown qualifiers and ambiguous candidates.
| last_updated: "2026-07-12" | ||
| --- | ||
|
|
||
| # [Project Name] |
There was a problem hiding this comment.
This repository-wide agent configuration is unrelated to Java/Spring graph support and still contains placeholders such as [Project Name] and empty command/non-negotiable sections. Because root AGENTS.md changes instructions for every coding agent working in the repository, please remove this file from the PR.
What
Added Java code graph support via
tree-sitter-java.wasmand production-ready Spring dependency injection resolution.This includes:
@Beanproviders, qualifiers,@Primary, and Lombok-generated constructor injection.Why
This enables MEX to build accurate code graphs for Java projects and resolve Spring dependency injection relationships that are implicit in source code. As a result, navigation and dependency analysis now include both static Java references and framework-managed bean dependencies.
Type of change
How to test
Run
mex checkon a Spring-based Java project.Verify the generated graph includes:
@Beanproviders).Run:
npm test npm run typecheck npm run buildChecklist
npm test)Code-graph changes
mainLanguageExtractororFrameworkResolverinterfacecore / discuss-firstissue is linked above