Behaviour SwRS-MDOKFSTUDIO-MYST-045
The host renames only the label text in one undo step
When the host receives a label rename, the extension SHALL change only the `(old)=` text of the stated line as one undo step of the source editor, keeping surrounding whitespace and CRLF endings, and when that line is no longer exactly `(old)=` change nothing and answer The label is no longer on that line. Refresh the preview, without searching other lines; it SHALL accept a previewLabelRename message only with a source line, two valid label names and the current render, and answer previewLabelRenameResult with the same edit id.
Step 2 of path 2 in StRS-MDOKFSTUDIO-MYST-009: from “The Rename label popover is open” to “The host holds a valid rename”.
Scenarios 7
The situations the tests check; open one to read it.
nominalA valid rename edits only the label text
nominalThe uses of the old name are counted, not rewritten
refusalThe label line changed
boundaryThe same label on another line is not touched
nominalA valid message is answered with its edit id
refusalAccepted shape of the rename message
| Field of previewLabelRename | Accepted | Otherwise |
|---|---|---|
| line | A source line (a safe integer, 1 or more) | The validator rejects the message |
| oldName | A valid label name: letters, digits and `_ . : -`, 100 characters at most | The validator rejects the message |
| newName | The same pattern and bound as oldName | The validator rejects the message |
| editId | Optional; repeated in the answer, which the page matches by it | Not checked by the validator |
| render identity | The current render | The gate drops or refuses the message (see SwRS-MDOKFSTUDIO-TRUST-065) |
A message rejected by the validator changes nothing in the document.