MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / lombokAnnotationNames

Function lombokAnnotationNames

src/extraction/languages/java.ts:59–71  ·  view source on GitHub ↗

Simple names of every annotation in a node's `modifiers` child (`@lombok.Getter` → `Getter`).

(node: SyntaxNode)

Source from the content-addressed store, hash-verified

57
58/** Simple names of every annotation in a node's `modifiers` child (`@lombok.Getter` → `Getter`). */
59function lombokAnnotationNames(node: SyntaxNode): Set<string> {
60 const names = new Set<string>();
61 const modifiers = node.namedChildren.find((c: SyntaxNode) => c.type === 'modifiers');
62 if (!modifiers) return names;
63 for (const child of modifiers.namedChildren) {
64 if (child.type === 'marker_annotation' || child.type === 'annotation') {
65 const nameNode = getChildByField(child, 'name');
66 const simple = nameNode ? nameNode.text.trim().split('.').pop() : undefined;
67 if (simple) names.add(simple);
68 }
69 }
70 return names;
71}
72
73/** Text of a declaration's `modifiers` child (keyword modifiers are anonymous, so match on text). */
74function modifierTextOf(node: SyntaxNode): string {

Callers 1

synthesizeLombokMembersFunction · 0.85

Calls 1

getChildByFieldFunction · 0.90

Tested by

no test coverage detected