MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / isTreeSitterErrorString

Function isTreeSitterErrorString

src/core/condense/foldedFileContext.ts:10–14  ·  view source on GitHub ↗

* Checks if a definitions string is actually an error message from tree-sitter * rather than valid code definitions. These error strings should not be embedded * in the folded file context - instead, the file should be skipped.

(definitions: string)

Source from the content-addressed store, hash-verified

8 * in the folded file context - instead, the file should be skipped.
9 */
10function isTreeSitterErrorString(definitions: string): boolean {
11 // These are known error messages from parseSourceCodeDefinitionsForFile
12 const errorPatterns = ["This file does not exist", "do not have permission", "Unsupported file type:"]
13 return errorPatterns.some((pattern) => definitions.includes(pattern))
14}
15
16/**
17 * Result of generating folded file context.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected