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

Function lombokAnnotationNames

src/extraction/languages/java.ts:60–72  ·  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

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

Callers 1

synthesizeLombokMembersFunction · 0.85

Calls 2

getChildByFieldFunction · 0.90
addMethod · 0.45

Tested by

no test coverage detected