mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Enable updating a chat model without triggering incremental typing (#183894)
This commit is contained in:
parent
fa8eefda18
commit
f6758dfc33
|
@ -146,9 +146,11 @@ export class ChatResponseModel extends Disposable implements IChatResponseModel
|
|||
this._id = 'response_' + ChatResponseModel.nextId++;
|
||||
}
|
||||
|
||||
updateContent(responsePart: string) {
|
||||
updateContent(responsePart: string, quiet?: boolean) {
|
||||
this._response = new MarkdownString(this.response.value + responsePart);
|
||||
this._onDidChange.fire();
|
||||
if (!quiet) {
|
||||
this._onDidChange.fire();
|
||||
}
|
||||
}
|
||||
|
||||
setProviderResponseId(providerResponseId: string) {
|
||||
|
@ -433,7 +435,7 @@ export class ChatModel extends Disposable implements IChatModel {
|
|||
return request;
|
||||
}
|
||||
|
||||
acceptResponseProgress(request: ChatRequestModel, progress: IChatProgress): void {
|
||||
acceptResponseProgress(request: ChatRequestModel, progress: IChatProgress, quiet?: boolean): void {
|
||||
if (!this._session) {
|
||||
throw new Error('acceptResponseProgress: No session');
|
||||
}
|
||||
|
@ -447,7 +449,7 @@ export class ChatModel extends Disposable implements IChatModel {
|
|||
}
|
||||
|
||||
if ('content' in progress) {
|
||||
request.response.updateContent(progress.content);
|
||||
request.response.updateContent(progress.content, quiet);
|
||||
} else {
|
||||
request.setProviderRequestId(progress.requestId);
|
||||
request.response.setProviderResponseId(progress.requestId);
|
||||
|
|
|
@ -528,7 +528,7 @@ export class ChatService extends Disposable implements IChatService {
|
|||
const request = model.addRequest(message);
|
||||
model.acceptResponseProgress(request, {
|
||||
content: response.message,
|
||||
});
|
||||
}, true);
|
||||
model.completeResponse(request, {
|
||||
session: model.session!,
|
||||
errorDetails: response.errorDetails,
|
||||
|
|
Loading…
Reference in a new issue