mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Add a command for deleting comment threads
This commit is contained in:
@@ -123,12 +123,13 @@ 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, comments: modes.Comment[], acceptInputCommand: modes.Command | undefined, additionalCommands: modes.Command[], collapseState: modes.CommentThreadCollapsibleState): modes.CommentThread2 | undefined;
|
||||
$createCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, comments: modes.Comment[], acceptInputCommand: modes.Command | undefined, additionalCommands: modes.Command[], deleteCommand: modes.Command | undefined, collapseState: modes.CommentThreadCollapsibleState): modes.CommentThread2 | undefined;
|
||||
$deleteCommentThread(handle: number, commentThreadHandle: number): void;
|
||||
$updateComments(handle: number, commentThreadHandle: number, comments: modes.Comment[]): void;
|
||||
$setInputValue(handle: number, input: string): void;
|
||||
$updateCommentThreadAcceptInputCommand(handle: number, commentThreadHandle: number, acceptInputCommand: modes.Command): void;
|
||||
$updateCommentThreadAdditionalCommands(handle: number, commentThreadHandle: number, additionalCommands: modes.Command[]): void;
|
||||
$updateCommentThreadDeleteCommand(handle: number, commentThreadHandle: number, deleteCommand: 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;
|
||||
|
||||
@@ -415,6 +415,18 @@ export class ExtHostCommentThread implements vscode.CommentThread {
|
||||
this._proxy.$updateCommentThreadAdditionalCommands(this._commentController.handle, this.handle, internals);
|
||||
}
|
||||
|
||||
private _deleteCommand?: vscode.Command;
|
||||
get deleteComand(): vscode.Command | undefined {
|
||||
return this._deleteCommand;
|
||||
}
|
||||
|
||||
set deleteCommand(deleteCommand: vscode.Command) {
|
||||
this._deleteCommand = deleteCommand;
|
||||
|
||||
const internal = this._commandsConverter.toInternal(deleteCommand);
|
||||
this._proxy.$updateCommentThreadDeleteCommand(this._commentController.handle, this.handle, internal);
|
||||
}
|
||||
|
||||
private _collapseState?: vscode.CommentThreadCollapsibleState;
|
||||
|
||||
get collapsibleState(): vscode.CommentThreadCollapsibleState {
|
||||
@@ -444,6 +456,7 @@ export class ExtHostCommentThread implements vscode.CommentThread {
|
||||
this._comments.map(comment => { return convertToModeComment(this._commentController, comment, this._commandsConverter); }),
|
||||
this._acceptInputCommand ? this._commandsConverter.toInternal(this._acceptInputCommand) : undefined,
|
||||
this._additionalCommands ? this._additionalCommands.map(x => this._commandsConverter.toInternal(x)) : [],
|
||||
this._deleteCommand ? this._commandsConverter.toInternal(this._deleteCommand) : undefined,
|
||||
this._collapseState!
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user