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

Function getEnclosingClassName

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

Source from the content-addressed store, hash-verified

85 }
86
87 function getEnclosingClassName(node: any): string | null {
88 let cur = node.parent;
89 while (cur) {
90 if (
91 cur.type === 'class_declaration' ||
92 cur.type === 'abstract_class_declaration' ||
93 cur.type === 'class_definition' ||
94 cur.type === 'struct_item' ||
95 cur.type === 'class' // generic
96 ) {
97 return getSymbolName(cur);
98 }
99 cur = cur.parent;
100 }
101 return null;
102 }
103
104 function visit(node: any) {
105 if (nodeTypes.includes(node.type)) {

Callers 1

visitFunction · 0.85

Calls 1

getSymbolNameFunction · 0.85

Tested by

no test coverage detected