Skip to content

Commit 5e9e547

Browse files
authored
Don't rely on options from setInput (microsoft#205745)
Fix microsoft/vscode-copilot-release#914
1 parent 025b4c9 commit 5e9e547

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/workbench/contrib/chat/browser/chatEditor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class ChatEditor extends EditorPane {
8181
super.clearInput();
8282
}
8383

84-
override async setInput(input: ChatEditorInput, options: IChatEditorOptions, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
84+
override async setInput(input: ChatEditorInput, options: IChatEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
8585
super.setInput(input, options, context, token);
8686

8787
const editorModel = await input.resolve();
@@ -93,7 +93,7 @@ export class ChatEditor extends EditorPane {
9393
throw new Error('ChatEditor lifecycle issue: no editor widget');
9494
}
9595

96-
this.updateModel(editorModel.model, options.viewState);
96+
this.updateModel(editorModel.model, options?.viewState ?? input.options.viewState);
9797
}
9898

9999
private updateModel(model: IChatModel, viewState?: IChatViewState): void {

0 commit comments

Comments
 (0)