Skip to content

Commit 0198f59

Browse files
authored
prevent endless autoSend loop of inline chat (microsoft#180945)
fixes microsoft/vscode-internalbacklog#3990
1 parent 4270de1 commit 0198f59

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorController.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ export class InteractiveEditorController implements IEditorContribution {
406406

407407
let placeholder = session.placeholder ?? '';
408408
let value = options?.message ?? '';
409-
409+
let autoSend = options?.autoSend ?? false;
410410

411411
if (session.slashCommands) {
412412
store.add(this._instaService.invokeFunction(installSlashCommandSupport, this._zone.widget.inputEditor as IActiveCodeEditor, session.slashCommands));
@@ -502,7 +502,8 @@ export class InteractiveEditorController implements IEditorContribution {
502502
this._ctxLastFeedbackKind.reset();
503503
// reveal the line after the whole range to ensure that the input box is visible
504504
this._editor.revealPosition({ lineNumber: wholeRange.endLineNumber + 1, column: 1 }, ScrollType.Smooth);
505-
if (options?.autoSend && !this._currentSession.lastResponse) {
505+
if (autoSend) {
506+
autoSend = false;
506507
this.accept();
507508
}
508509
const input = await inputPromise;

0 commit comments

Comments
 (0)