Skip to content

Commit abf9cb9

Browse files
authored
don't move inline chat into target editor if there is already an active session (microsoft#227062)
fixes microsoft#227052
1 parent 724ebf4 commit abf9cb9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ export class InlineChatController implements IEditorContribution {
622622
return;
623623
}
624624
if (e.kind === 'move') {
625+
assertType(this._session);
625626
const log: typeof this._log = (msg: string, ...args: any[]) => this._log('state=_showRequest) moving inline chat', msg, ...args);
626627

627628
log('move was requested', e.target, e.range);
@@ -636,13 +637,13 @@ export class InlineChatController implements IEditorContribution {
636637
}
637638

638639
const newEditor = editorPane.getControl();
639-
if (!newEditor || !isCodeEditor(newEditor) || !newEditor.hasModel()) {
640+
if (!isCodeEditor(newEditor) || !newEditor.hasModel()) {
640641
log('new editor is either missing or not a code editor or does not have a model');
641642
return;
642643
}
643644

644-
if (!this._session) {
645-
log('controller does not have a session');
645+
if (this._inlineChatSessionService.getSession(newEditor, e.target)) {
646+
log('new editor ALREADY has a session');
646647
return;
647648
}
648649

0 commit comments

Comments
 (0)