MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / buildSymbol

Function buildSymbol

src/utils/tree-sitter.ts:280–293  ·  view source on GitHub ↗
(node: Node, content: string)

Source from the content-addressed store, hash-verified

278}
279
280function buildSymbol(node: Node, content: string): TreeSitterSymbol {
281 const rangeNode = getSymbolRangeNode(node);
282
283 return {
284 name: extractNodeName(node),
285 kind: getNodeKind(node.type),
286 startLine: rangeNode.startPosition.row + 1,
287 endLine: rangeNode.endPosition.row + 1,
288 startIndex: rangeNode.startIndex,
289 endIndex: rangeNode.endIndex,
290 content: extractNodeContent(rangeNode, content),
291 nodeType: node.type
292 };
293}
294
295export async function extractTreeSitterSymbols(
296 content: string,

Callers 1

extractTreeSitterSymbolsFunction · 0.85

Calls 4

getSymbolRangeNodeFunction · 0.85
extractNodeNameFunction · 0.85
getNodeKindFunction · 0.85
extractNodeContentFunction · 0.85

Tested by

no test coverage detected