MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / isInsideNonCodeContext

Function isInsideNonCodeContext

src/utils/tree-sitter.ts:411–425  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

409] as const;
410
411function isInsideNonCodeContext(node: Node): boolean {
412 let cursor: Node | null = node;
413 let depth = 0;
414 while (cursor && depth < 40) {
415 const cursorType = cursor.type;
416 for (const fragment of NON_CODE_ANCESTOR_TYPE_FRAGMENTS) {
417 if (cursorType.includes(fragment)) {
418 return true;
419 }
420 }
421 cursor = cursor.parent;
422 depth += 1;
423 }
424 return false;
425}
426
427/**
428 * Find identifier occurrences of `symbol` in `content` using Tree-sitter.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected