{"record":{"id":"95747c2537610e77","repo":"microsoft/vscode","slug":"file-not-found-p","errorCode":null,"errorMessage":"File not found: ${p}","messagePattern":"File not found: (.+?)","errorType":"exception","errorClass":"DiffError","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/tools/node/applyPatch/parser.ts","lineNumber":922,"sourceCode":"\treturn commit;\n}\n\n// -----------------------------------------------------------------------------\n// Filesystem helpers for Node environment\n// -----------------------------------------------------------------------------\n\nexport async function load_files(\n\tpaths: Array<string>,\n\topenFn: (p: string) => Promise<AbstractDocumentWithLanguageId | TextDocument>,\n): Promise<Record<string, AbstractDocumentWithLanguageId | TextDocument>> {\n\tconst orig: Record<string, AbstractDocumentWithLanguageId | TextDocument> = {};\n\tfor (const p of paths) {\n\t\ttry {\n\t\t\torig[p] = await openFn(p);\n\t\t} catch {\n\t\t\t// Convert any file read error into a DiffError so that callers\n\t\t\t// consistently receive DiffError for patch-related failures.\n\t\t\tthrow new DiffError(`File not found: ${p}`);\n\t\t}\n\t}\n\treturn orig;\n}\n\nexport function apply_commit(\n\tcommit: Commit,\n\twriteFn: (p: string, c: string) => void,\n\tremoveFn: (p: string) => void,\n): void {\n\tfor (const [p, change] of Object.entries(commit.changes)) {\n\t\tif (change.type === ActionType.DELETE) {\n\t\t\tremoveFn(p);\n\t\t} else if (change.type === ActionType.ADD) {\n\t\t\twriteFn(p, change.newContent ?? '');\n\t\t} else if (change.type === ActionType.UPDATE) {\n\t\t\tif (change.movePath) {\n\t\t\t\twriteFn(change.movePath, change.newContent ?? '');","sourceCodeStart":904,"sourceCodeEnd":940,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/tools/node/applyPatch/parser.ts#L904-L940","documentation":"Error \"File not found: ${p}\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/tools/node/applyPatch/parser.ts:922 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"a94b963a32aa9749d69504576791fa29700ae46d","analyzedAt":"2026-08-12T01:08:56.794Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}