mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
comment thread readonly
This commit is contained in:
@@ -144,6 +144,7 @@ export type CommentThreadChanges = Partial<{
|
||||
contextValue: string,
|
||||
comments: modes.Comment[],
|
||||
collapseState: modes.CommentThreadCollapsibleState;
|
||||
readOnly: boolean;
|
||||
}>;
|
||||
|
||||
export interface MainThreadCommentsShape extends IDisposable {
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user