Skip to content

Commit 1f98bd6

Browse files
committed
💄
1 parent 2971e3a commit 1f98bd6

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/vs/editor/browser/core/editorState.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,19 @@ export class EditorStateCancellationTokenSource extends EditorKeybindingCancella
9393

9494
private readonly _listener = new DisposableStore();
9595

96-
constructor(readonly editor: IActiveCodeEditor, flags: CodeEditorStateFlag, parent?: CancellationToken, readonly range?: IRange) {
96+
constructor(readonly editor: IActiveCodeEditor, flags: CodeEditorStateFlag, range?: IRange, parent?: CancellationToken) {
9797
super(editor, parent);
9898

9999
if (flags & CodeEditorStateFlag.Position) {
100100
this._listener.add(editor.onDidChangeCursorPosition(e => {
101-
if (!this.range || !Range.containsPosition(this.range, e.position)) {
101+
if (!range || !Range.containsPosition(range, e.position)) {
102102
this.cancel();
103103
}
104104
}));
105105
}
106106
if (flags & CodeEditorStateFlag.Selection) {
107107
this._listener.add(editor.onDidChangeCursorSelection(e => {
108-
if (!this.range || !Range.containsRange(this.range, e.selection)) {
108+
if (!range || !Range.containsRange(range, e.selection)) {
109109
this.cancel();
110110
}
111111
}));

src/vs/editor/contrib/format/format.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export async function formatDocumentRangeWithProvider(
150150
let cts: CancellationTokenSource;
151151
if (isCodeEditor(editorOrModel)) {
152152
model = editorOrModel.getModel();
153-
cts = new EditorStateCancellationTokenSource(editorOrModel, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position, token);
153+
cts = new EditorStateCancellationTokenSource(editorOrModel, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position, undefined, token);
154154
} else {
155155
model = editorOrModel;
156156
cts = new TextModelCancellationTokenSource(editorOrModel, token);
@@ -238,7 +238,7 @@ export async function formatDocumentWithProvider(
238238
let cts: CancellationTokenSource;
239239
if (isCodeEditor(editorOrModel)) {
240240
model = editorOrModel.getModel();
241-
cts = new EditorStateCancellationTokenSource(editorOrModel, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position, token);
241+
cts = new EditorStateCancellationTokenSource(editorOrModel, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position, undefined, token);
242242
} else {
243243
model = editorOrModel;
244244
cts = new TextModelCancellationTokenSource(editorOrModel, token);

src/vs/editor/contrib/rename/rename.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class RenameController implements IEditorContribution {
169169
return undefined;
170170
}
171171
this._cts.dispose();
172-
this._cts = new EditorStateCancellationTokenSource(this.editor, CodeEditorStateFlag.Position | CodeEditorStateFlag.Value, undefined, loc.range);
172+
this._cts = new EditorStateCancellationTokenSource(this.editor, CodeEditorStateFlag.Position | CodeEditorStateFlag.Value, loc.range);
173173

174174
// do rename at location
175175
let selection = this.editor.getSelection();

0 commit comments

Comments
 (0)