From 163fd2adae2f73d49085cbd401afa098826f6d0a Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 22 Jul 2024 14:40:14 -0700 Subject: [PATCH] Avoid type assertion (#223128) Avoid cast For #211878 --- src/vs/workbench/test/browser/workbenchTestServices.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/test/browser/workbenchTestServices.ts b/src/vs/workbench/test/browser/workbenchTestServices.ts index 875d51208951e..65d9389856717 100644 --- a/src/vs/workbench/test/browser/workbenchTestServices.ts +++ b/src/vs/workbench/test/browser/workbenchTestServices.ts @@ -211,7 +211,12 @@ export class TestTextFileEditor extends TextFileEditor { } setSelection(selection: Selection | undefined, reason: EditorPaneSelectionChangeReason): void { - this._options = selection ? { selection } as IEditorOptions : undefined; + if (selection) { + const options: ITextEditorOptions = { selection }; + this._options = options; + } else { + this._options = undefined; + } this._onDidChangeSelection.fire({ reason }); }