Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentParts.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 { IDisposable } from '../../../../../base/common/lifecycle.js';
7
import { ChatTreeItem, IChatCodeBlockInfo } from '../chat.js';
8
import { IChatRendererContent } from '../../common/chatViewModel.js';
9
10
export interface IChatContentPart extends IDisposable {
11
domNode: HTMLElement | undefined;
12
13
/**
14
* Used to indicate a part's ownership of a code block.
15
*/
16
codeblocksPartId?: string;
17
18
/**
19
* Codeblocks that were rendered by this part into CodeBlockModelCollection.
20
*/
21
codeblocks?: IChatCodeBlockInfo[];
22
23
/**
24
* Returns true if the other content is equivalent to what is already rendered in this content part.
25
* Returns false if a rerender is needed.
26
* followingContent is all the content that will be rendered after this content part (to support progress messages' behavior).
27
*/
28
hasSameContent(other: IChatRendererContent, followingContent: IChatRendererContent[], element: ChatTreeItem): boolean;
29
30
addDisposable?(disposable: IDisposable): void;
31
}
32
33
export interface IChatContentPartRenderContext {
34
readonly element: ChatTreeItem;
35
readonly elementIndex: number;
36
readonly container: HTMLElement;
37
readonly content: ReadonlyArray<IChatRendererContent>;
38
readonly contentIndex: number;
39
readonly preceedingContentParts: ReadonlyArray<IChatContentPart>;
40
}
41
42