MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / getSymbolName

Function getSymbolName

src/tools/ast/edit-symbol.ts:71–85  ·  view source on GitHub ↗
(node: any)

Source from the content-addressed store, hash-verified

69 parentClassName?: string,
70): FoundSymbol[] {
71 const matches: FoundSymbol[] = [];
72
73 function getSymbolName(node: any): string | null {
74 // Try common field names
75 for (const field of ['name']) {
76 const f = node.childForFieldName(field);
77 if (f) return f.text;
78 }
79 // Fallback: look for first identifier child
80 for (let i = 0; i < node.childCount; i++) {
81 const c = node.child(i);
82 if (c && (c.type === 'identifier' || c.type === 'property_identifier' || c.type === 'type_identifier')) {
83 return c.text;
84 }
85 }
86 return null;
87 }
88

Callers 2

getEnclosingClassNameFunction · 0.85
visitFunction · 0.85

Calls 1

childMethod · 0.80

Tested by

no test coverage detected