comment thread readonly

This commit is contained in:
rebornix
2020-09-24 17:45:02 -07:00
parent ee8378e806
commit c49d699aec
6 changed files with 128 additions and 60 deletions

View File

@@ -144,6 +144,7 @@ export type CommentThreadChanges = Partial<{
contextValue: string,
comments: modes.Comment[],
collapseState: modes.CommentThreadCollapsibleState;
readOnly: boolean;
}>;
export interface MainThreadCommentsShape extends IDisposable {

View File

@@ -219,6 +219,7 @@ type CommentThreadModification = Partial<{
contextValue: string | undefined,
comments: vscode.Comment[],
collapsibleState: vscode.CommentThreadCollapsibleState
readOnly: boolean;
}>;
export class ExtHostCommentThread implements vscode.CommentThread {
@@ -263,6 +264,19 @@ export class ExtHostCommentThread implements vscode.CommentThread {
return this._range;
}
private _readonly: boolean = false;
set readOnly(state: boolean) {
if (this._readonly !== state) {
this._readonly = state;
this.modifications.readOnly = state;
this._onDidUpdateCommentThread.fire();
}
}
get readOnly() {
return this._readonly;
}
private _label: string | undefined;
get label(): string | undefined {
@@ -387,6 +401,9 @@ export class ExtHostCommentThread implements vscode.CommentThread {
if (modified('collapsibleState')) {
formattedModifications.collapseState = convertToCollapsibleState(this._collapseState);
}
if (modified('readOnly')) {
formattedModifications.readOnly = this.readOnly;
}
this.modifications = {};
this._proxy.$updateCommentThread(