From abf9cb91c62d026e17db8ebf3d047dfed5b8f70f Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 29 Aug 2024 12:31:48 +0200 Subject: [PATCH] don't move inline chat into target editor if there is already an active session (#227062) fixes https://github.com/microsoft/vscode/issues/227052 --- .../contrib/inlineChat/browser/inlineChatController.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts index 18e4a817bfa..c6d9ae577fb 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts @@ -622,6 +622,7 @@ export class InlineChatController implements IEditorContribution { return; } if (e.kind === 'move') { + assertType(this._session); const log: typeof this._log = (msg: string, ...args: any[]) => this._log('state=_showRequest) moving inline chat', msg, ...args); log('move was requested', e.target, e.range); @@ -636,13 +637,13 @@ export class InlineChatController implements IEditorContribution { } const newEditor = editorPane.getControl(); - if (!newEditor || !isCodeEditor(newEditor) || !newEditor.hasModel()) { + if (!isCodeEditor(newEditor) || !newEditor.hasModel()) { log('new editor is either missing or not a code editor or does not have a model'); return; } - if (!this._session) { - log('controller does not have a session'); + if (this._inlineChatSessionService.getSession(newEditor, e.target)) { + log('new editor ALREADY has a session'); return; }