diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts index b2ad0fd9c2d..113a0b01470 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts @@ -17,6 +17,7 @@ import { StopWatch } from '../../../../base/common/stopwatch.js'; import { assertType } from '../../../../base/common/types.js'; import { generateUuid } from '../../../../base/common/uuid.js'; import { ICodeEditor, isCodeEditor } from '../../../../editor/browser/editorBrowser.js'; +import { EditorOption } from '../../../../editor/common/config/editorOptions.js'; import { IPosition, Position } from '../../../../editor/common/core/position.js'; import { IRange, Range } from '../../../../editor/common/core/range.js'; import { ISelection, Selection, SelectionDirection } from '../../../../editor/common/core/selection.js'; @@ -591,8 +592,19 @@ export class InlineChatController implements IEditorContribution { const progressiveEditsClock = StopWatch.create(); const progressiveEditsQueue = new Queue(); - let next: State.WAIT_FOR_INPUT | State.SHOW_REQUEST | State.CANCEL | State.PAUSE | State.ACCEPT = State.WAIT_FOR_INPUT; + // disable typing and squiggles while streaming a reply + const origDeco = this._editor.getOption(EditorOption.renderValidationDecorations); + this._editor.updateOptions({ + renderValidationDecorations: 'off' + }); + store.add(toDisposable(() => { + this._editor.updateOptions({ + renderValidationDecorations: origDeco + }); + })); + + let next: State.WAIT_FOR_INPUT | State.SHOW_REQUEST | State.CANCEL | State.PAUSE | State.ACCEPT = State.WAIT_FOR_INPUT; store.add(Event.once(this._messages.event)(message => { this._log('state=_makeRequest) message received', message); this._chatService.cancelCurrentRequestForSession(chatModel.sessionId); diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.ts index dfd271fa79b..884bdc4208e 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.ts @@ -184,6 +184,12 @@ export class InlineChatHintsController extends Disposable implements IEditorCont const ghostCtrl = InlineCompletionsController.get(editor); + this._store.add(commandService.onWillExecuteCommand(e => { + if (e.commandId === _inlineChatActionId || e.commandId === ACTION_START) { + this.hide(); + } + })); + this._store.add(this._editor.onMouseDown(e => { if (e.target.type !== MouseTargetType.CONTENT_TEXT) { return; @@ -227,12 +233,13 @@ export class InlineChatHintsController extends Disposable implements IEditorCont const visible = this._visibilityObs.read(r);// || this._ctxMenuVisibleObs.read(r); const isEol = model.getLineMaxColumn(position.lineNumber) === position.column; - const isWhitespace = model.getLineLastNonWhitespaceColumn(position.lineNumber) === 0 && model.getValueLength() > 0; + const isWhitespace = model.getLineLastNonWhitespaceColumn(position.lineNumber) === 0 && model.getValueLength() > 0 && position.column > 1; - const shouldShow = (isWhitespace && _configurationService.getValue(InlineChatConfigKeys.LineEmptyHint)) - || (visible && isEol && _configurationService.getValue(InlineChatConfigKeys.LineSuffixHint)); + if (isWhitespace && !_configurationService.getValue(InlineChatConfigKeys.LineEmptyHint)) { + return undefined; + } - if (!shouldShow) { + if (!visible || !isEol || !_configurationService.getValue(InlineChatConfigKeys.LineSuffixHint)) { return undefined; } diff --git a/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatController.test.ts b/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatController.test.ts index 708a821ba7d..7ef2b96f657 100644 --- a/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatController.test.ts +++ b/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatController.test.ts @@ -71,7 +71,7 @@ import { ITextModelService } from '../../../../../editor/common/services/resolve import { TextModelResolverService } from '../../../../services/textmodelResolver/common/textModelResolverService.js'; import { ChatInputBoxContentProvider } from '../../../chat/browser/chatEdinputInputContentProvider.js'; -suite('InteractiveChatController', function () { +suite('InlineChatController', function () { const agentData = { extensionId: nullExtensionDescription.identifier, diff --git a/test/unit/electron/renderer.js b/test/unit/electron/renderer.js index 9dd1b2174ec..7c28a98930c 100644 --- a/test/unit/electron/renderer.js +++ b/test/unit/electron/renderer.js @@ -211,7 +211,7 @@ async function loadTests(opts) { ]); const _allowedSuitesWithOutput = new Set([ - 'InteractiveChatController' + 'InlineChatController' ]); let _testsWithUnexpectedOutput = false;