Skip to content

Commit

Permalink
don't move inline chat into target editor if there is already an acti…
Browse files Browse the repository at this point in the history
…ve session (#227062)

fixes microsoft/vscode#227052
  • Loading branch information
jrieken authored Aug 29, 2024
1 parent 724ebf4 commit abf9cb9
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down

0 comments on commit abf9cb9

Please sign in to comment.