jade.replace_text
Replace an exact, unique string in a file using content anchors instead of line numbers; it refuses absent or ambiguous matches and supports atomic multi-site edits.
Instructions
Replace an exact, unique string in a file. An anchor string does not move when the lines around it do, which is why follow-up edits address text rather than line numbers. Refuses when the anchor is absent or matches more than once — extend it with surrounding context to disambiguate. For several sites, use apply: atomic, one validation, no diagnostics from half-done intermediate states.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path to edit. | |
| newText | Yes | Replacement text. | |
| oldText | Yes | Exact text to replace. Must appear exactly once. | |
| expectedDigest | No | Optional. The digest from the read this edit is based on; the edit is refused if the file changed since, by anyone. | |
| expectedRevision | No | Revision expected before editing. |