replace draft properties with labels in CommentThread and Comment

This commit is contained in:
Peng Lyu
2019-03-06 14:29:02 -08:00
parent 905248fa6e
commit ce1cb8a9fc
7 changed files with 71 additions and 8 deletions

View File

@@ -127,6 +127,7 @@ export interface MainThreadCommentsShape extends IDisposable {
$updateCommentThreadCommands(handle: number, commentThreadHandle: number, acceptInputCommands: modes.Command[]): void;
$updateCommentThreadCollapsibleState(handle: number, commentThreadHandle: number, collapseState: modes.CommentThreadCollapsibleState): void;
$updateCommentThreadRange(handle: number, commentThreadHandle: number, range: IRange): void;
$updateCommentThreadLabel(handle: number, commentThreadHandle: number, label: string): void;
$registerDocumentCommentProvider(handle: number, features: CommentProviderFeatures): void;
$unregisterDocumentCommentProvider(handle: number): void;
$registerWorkspaceCommentProvider(handle: number, extensionId: ExtensionIdentifier): void;

View File

@@ -308,6 +308,17 @@ export class ExtHostCommentThread implements vscode.CommentThread {
return this._range;
}
private _label: string;
get label(): string {
return this._label;
}
set label(label: string) {
this._label = label;
this._proxy.$updateCommentThreadLabel(this._commentControlHandle, this.handle, this._label);
}
private _comments: vscode.Comment[] = [];
get comments(): vscode.Comment[] {
@@ -557,7 +568,8 @@ function convertToModeComment(vscodeComment: vscode.Comment, commandsConverter:
userIconPath: iconPath,
isDraft: vscodeComment.isDraft,
editCommand: vscodeComment.editCommand ? commandsConverter.toInternal(vscodeComment.editCommand) : undefined,
deleteCommand: vscodeComment.editCommand ? commandsConverter.toInternal(vscodeComment.deleteCommand) : undefined
deleteCommand: vscodeComment.editCommand ? commandsConverter.toInternal(vscodeComment.deleteCommand) : undefined,
label: vscodeComment.label
};
}