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

Function visit

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

Source from the content-addressed store, hash-verified

102 }
103
104 function visit(node: any) {
105 if (nodeTypes.includes(node.type)) {
106 const symName = getSymbolName(node);
107 if (symName === name) {
108 const enclosing = getEnclosingClassName(node);
109 if (!parentClassName || enclosing === parentClassName) {
110 matches.push({
111 name,
112 kind: node.type,
113 startIndex: node.startIndex,
114 endIndex: node.endIndex,
115 startRow: node.startPosition.row,
116 endRow: node.endPosition.row,
117 startColumn: node.startPosition.column,
118 endColumn: node.endPosition.column,
119 });
120 }
121 }
122 }
123 for (let i = 0; i < node.childCount; i++) {
124 const c = node.child(i);
125 if (c) visit(c);
126 }
127 }
128
129 visit(rootNode);
130 return matches;

Callers 2

findSymbolByNameFunction · 0.70
listAvailableSymbolsFunction · 0.70

Calls 4

getSymbolNameFunction · 0.85
getEnclosingClassNameFunction · 0.85
childMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected