Prevent unexpected rename cancellation by ChrisPapp · Pull Request #95739 · microsoft/vscode
This PR fixes #92507
The problem was that the rename command was getting cancelled. When moving the cursor's position (but still staying within the rename target's range) the cancellation token thinks it should cancel because the cursor moved...
| this._cts = new EditorStateCancellationTokenSource(this.editor, CodeEditorStateFlag.Position | CodeEditorStateFlag.Value); |
... but the input field thinks we didn't cancel because the cursor is still within range.
| let onCursorChanged = () => { | |
| const editorPosition = this._editor.getPosition(); | |
| if (!editorPosition || !Range.containsPosition(where, editorPosition)) { | |
| this.cancelInput(true); | |
| } | |
| }; |
Therefore we can either update the input field's logic to be in line with the cancellation token rules, or we can temporarily stop using the cancellation token.
I implemented the latter.