MCPcopy Index your code
hub / github.com/anomalyco/opencode / snapEdit

Function snapEdit

packages/opencode/src/cli/cmd/run/tool.ts:515–532  ·  view source on GitHub ↗
(p: ToolProps<typeof EditTool>)

Source from the content-addressed store, hash-verified

513}
514
515function snapEdit(p: ToolProps<typeof EditTool>): ToolSnapshot | undefined {
516 const file = p.input.filePath || ""
517 const diff = p.metadata.diff || ""
518 if (!file || !diff.trim()) {
519 return undefined
520 }
521
522 return {
523 kind: "diff",
524 items: [
525 {
526 title: `# Edited ${toolPath(file)}`,
527 diff,
528 file,
529 },
530 ],
531 }
532}
533
534function snapPatch(p: ToolProps<typeof ApplyPatchTool>): ToolSnapshot | undefined {
535 const files = list<PatchFile>(p.frame.meta.files)

Callers

nothing calls this directly

Calls 1

toolPathFunction · 0.85

Tested by

no test coverage detected