find_annotation_usages
Locate all usages of a Java annotation by providing its fully qualified type name, returning every code location where it is applied.
Instructions
Find all usages of an annotation type in the project.
JDT-UNIQUE: This fine-grained search is not available in LSP.
USAGE: Provide fully qualified annotation name as typeName
OUTPUT: All locations where the annotation is applied
Examples:
find_annotation_usages(typeName="org.springframework.beans.factory.annotation.Autowired")
find_annotation_usages(typeName="org.junit.jupiter.api.Test")
find_annotation_usages(typeName="javax.persistence.Entity")
potentialMatches, present only when there are any, holds the places JDT's search reports as possible matches but cannot confirm, because a type or name there does not resolve (a missing dependency or a compile error): count is their exact number, and locations lists them, as many as the results it stands beside may list. They are never counted or listed as results.
Requires load_project to be called first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| typeName | Yes | Fully qualified annotation type name (e.g., 'org.springframework.beans.factory.annotation.Autowired') | |
| maxResults | No | Maximum results to return (default 100) |