Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/api/browser/mainThreadChatInputNotification.ts
13397 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { Disposable } from '../../../base/common/lifecycle.js';
7
import { ChatInputNotificationSeverity, IChatInputNotificationService } from '../../contrib/chat/browser/widget/input/chatInputNotificationService.js';
8
import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
9
import { ChatInputNotificationDto, MainContext, MainThreadChatInputNotificationShape } from '../common/extHost.protocol.js';
10
11
@extHostNamedCustomer(MainContext.MainThreadChatInputNotification)
12
export class MainThreadChatInputNotification extends Disposable implements MainThreadChatInputNotificationShape {
13
14
constructor(
15
_extHostContext: IExtHostContext,
16
@IChatInputNotificationService private readonly _chatInputNotificationService: IChatInputNotificationService,
17
) {
18
super();
19
}
20
21
$setNotification(notification: ChatInputNotificationDto): void {
22
this._chatInputNotificationService.setNotification({
23
id: notification.id,
24
severity: notification.severity as number as ChatInputNotificationSeverity,
25
message: notification.message,
26
description: notification.description,
27
actions: notification.actions,
28
dismissible: notification.dismissible,
29
autoDismissOnMessage: notification.autoDismissOnMessage,
30
});
31
}
32
33
$disposeNotification(id: string): void {
34
this._chatInputNotificationService.deleteNotification(id);
35
}
36
}
37
38