You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Java type-level annotations do not emit reference edges #1486
Code already emits references edges for annotations on Java methods, but annotations on classes, interfaces and records are skipped. In Spring, JPA and other similar projects this hides framework roles such as @Service and @Entity from the graph.
@oleksii-tumanov thanks for adding Java type-level annotation references. The original goal of #1486 makes sense: framework roles such as @Service and @Entity should be represented in the graph.
I noticed a possible symbol-resolution issue when testing this on a real Spring project.
the resulting graph contains 13 different target nodes labeled Service, with IDs scoped to the individual source files, rather than one canonical node representing:
Was the file-scoped target-node behavior intentional?
My expectation would be that annotation references should resolve through the file's import table and reuse one canonical external-symbol node identified by the fully qualified name. Using only the short label would not be sufficient because different annotations may share the same simple name.
but does not cover two files importing and referencing the same annotation.
Would you consider the per-file duplication a bug in cross-file annotation-symbol resolution?
If so, I can provide a minimal reproducer and open a focused follow-up issue for discussion.
Activity
safishamsi commentedon Jun 27, 2026
Fixed in 0.8.50 (PR #1487, thanks @oleksii-tumanov). Type-level annotations on Java classes/interfaces/records (
@Service,@Entity, …) now emitreferencesedges with theattributecontext, matching method-level annotations.lvlaxim commentedon Jul 31, 2026
@oleksii-tumanov thanks for adding Java type-level annotation references. The original goal of #1486 makes sense: framework roles such as
@Serviceand@Entityshould be represented in the graph.I noticed a possible symbol-resolution issue when testing this on a real Spring project.
For 13 classes using:
the resulting graph contains 13 different target nodes labeled
Service, with IDs scoped to the individual source files, rather than one canonical node representing:Conceptually, the graph currently looks like:
rather than:
Was the file-scoped target-node behavior intentional?
My expectation would be that annotation references should resolve through the file's import table and reuse one canonical external-symbol node identified by the fully qualified name. Using only the short label would not be sufficient because different annotations may share the same simple name.
For example:
{ "id": "external_java_org_springframework_stereotype_service", "label": "Service", "qualified_name": "org.springframework.stereotype.Service", "symbol_kind": "annotation", "external": true }The current test verifies the label pair:
but does not cover two files importing and referencing the same annotation.
Would you consider the per-file duplication a bug in cross-file annotation-symbol resolution?
If so, I can provide a minimal reproducer and open a focused follow-up issue for discussion.