Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/api/browser/mainThreadChatStatus.ts
3296 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 { IChatStatusItemService } from '../../contrib/chat/browser/chatStatusItemService.js';
8
import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
9
import { ChatStatusItemDto, MainContext, MainThreadChatStatusShape } from '../common/extHost.protocol.js';
10
11
@extHostNamedCustomer(MainContext.MainThreadChatStatus)
12
export class MainThreadChatStatus extends Disposable implements MainThreadChatStatusShape {
13
14
constructor(
15
_extHostContext: IExtHostContext,
16
@IChatStatusItemService private readonly _chatStatusItemService: IChatStatusItemService,
17
) {
18
super();
19
}
20
21
$setEntry(id: string, entry: ChatStatusItemDto): void {
22
this._chatStatusItemService.setOrUpdateEntry({
23
id,
24
label: entry.title,
25
description: entry.description,
26
detail: entry.detail,
27
});
28
}
29
30
$disposeEntry(id: string): void {
31
this._chatStatusItemService.deleteEntry(id);
32
}
33
}
34
35