Preserve comment thread collapse state across extension host update messages, fixes https://github.com/microsoft/vscode-pull-request-github/issues/1400

This commit is contained in:
Jackson Kearl
2019-10-24 12:00:53 -07:00
committed by Rachel Macfarlane
parent 0441b18597
commit 69fd68da9f
4 changed files with 63 additions and 36 deletions

View File

@@ -131,12 +131,20 @@ export interface CommentProviderFeatures {
reactionHandler?: boolean;
}
export type CommentThreadChanges = Partial<{
range: IRange,
label: string,
contextValue: string,
comments: modes.Comment[],
collapseState: modes.CommentThreadCollapsibleState
}>;
export interface MainThreadCommentsShape extends IDisposable {
$registerCommentController(handle: number, id: string, label: string): void;
$unregisterCommentController(handle: number): void;
$updateCommentControllerFeatures(handle: number, features: CommentProviderFeatures): void;
$createCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, extensionId: ExtensionIdentifier): modes.CommentThread | undefined;
$updateCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, label: string | undefined, contextValue: string | undefined, comments: modes.Comment[], collapseState: modes.CommentThreadCollapsibleState): void;
$updateCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, changes: CommentThreadChanges): void;
$deleteCommentThread(handle: number, commentThreadHandle: number): void;
$onDidCommentThreadsChange(handle: number, event: modes.CommentThreadChangedEvent): void;
}