From 4849ca9bdf9666755eb463db297b69e5385090e3 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 4 Sep 2024 14:53:09 +0200 Subject: [PATCH] inline chat should always render changes, even when having empty responses or errors (#227573) fixes https://github.com/microsoft/vscode-copilot-release/issues/1524 --- .../browser/inlineChatController.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts index 8f88f752baac4..233942a24d817 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts @@ -758,7 +758,7 @@ export class InlineChatController implements IEditorContribution { let newPosition: Position | undefined; if (response.result?.errorDetails) { - // + // error -> no message, errors are shown with the request } else if (response.response.value.length === 0) { // empty -> show message @@ -766,21 +766,21 @@ export class InlineChatController implements IEditorContribution { this._ui.value.zone.widget.updateStatus(status, { classes: ['warn'] }); } else { - // real response -> complex... + // real response -> no message this._ui.value.zone.widget.updateStatus(''); + } - const position = await this._strategy.renderChanges(); - if (position) { - // if the selection doesn't start far off we keep the widget at its current position - // because it makes reading this nicer - const selection = this._editor.getSelection(); - if (selection?.containsPosition(position)) { - if (position.lineNumber - selection.startLineNumber > 8) { - newPosition = position; - } - } else { + const position = await this._strategy.renderChanges(); + if (position) { + // if the selection doesn't start far off we keep the widget at its current position + // because it makes reading this nicer + const selection = this._editor.getSelection(); + if (selection?.containsPosition(position)) { + if (position.lineNumber - selection.startLineNumber > 8) { newPosition = position; } + } else { + newPosition = position; } } this._showWidget(this._session.headless, false, newPosition);