提交 0683efcf 编写于 作者: P Peng Lyu 提交者: Rachel Macfarlane

Deprecate commands for static contribution later, fixes #73333

上级 66d5d871
......@@ -8970,7 +8970,7 @@ declare module 'vscode' {
/**
* The uri of the document the thread has been created on.
*/
readonly resource: Uri;
readonly uri: Uri;
/**
* The range the comment thread is located within the document. The thread icon will be shown
......@@ -9003,25 +9003,29 @@ declare module 'vscode' {
*/
acceptInputCommand?: Command;
/**
* Optional additonal commands.
* Dispose this comment thread.
*
* `additionalCommands` are the secondary actions rendered on Comment Widget.
* Once disposed, this comment thread will be removed from visible editors and Comment Panel when approriate.
*/
additionalCommands?: Command[];
dispose(): void;
}
/**
* Author information of a [comment](#Comment)
*/
export interface CommentAuthorInformation {
/**
* The command to be executed when users try to delete the comment thread. Currently, this is only called
* when the user collapses a comment thread that has no comments in it.
* The display name of the author of the comment
*/
deleteCommand?: Command;
name: string;
/**
* Dispose this comment thread.
*
* Once disposed, this comment thread will be removed from visible editors and Comment Panel when approriate.
* The optional icon path for the author
*/
dispose(): void;
iconPath?: Uri;
}
/**
......@@ -9074,11 +9078,6 @@ declare module 'vscode' {
* The command to be executed when users try to save the edits to the comment
*/
editCommand?: Command;
/**
* The command to be executed when users try to delete the comment
*/
deleteCommand?: Command;
}
/**
......@@ -9193,7 +9192,7 @@ declare module 'vscode' {
* @param range The range the comment thread is located within the document.
* @param comments The ordered comments of the thread.
*/
createCommentThread(id: string, resource: Uri, range: Range, comments: Comment[]): CommentThread;
createCommentThread(id: string, uri: Uri, range: Range, comments: Comment[]): CommentThread;
/**
* Dispose this comment controller.
......
......@@ -792,6 +792,11 @@ declare module 'vscode' {
*/
isDraft?: boolean;
/**
* The command to be executed when users try to delete the comment
*/
deleteCommand?: Command;
/**
* Proposed Comment Reaction
*/
......@@ -905,6 +910,26 @@ declare module 'vscode' {
toggleReaction?(document: TextDocument, comment: Comment, reaction: CommentReaction): Promise<void>;
}
export interface CommentThread {
/**
* The uri of the document the thread has been created on.
*/
readonly resource: Uri;
/**
* Optional additonal commands.
*
* `additionalCommands` are the secondary actions rendered on Comment Widget.
*/
additionalCommands?: Command[];
/**
* The command to be executed when users try to delete the comment thread. Currently, this is only called
* when the user collapses a comment thread that has no comments in it.
*/
deleteCommand?: Command;
}
export interface CommentController {
/**
......
......@@ -385,7 +385,11 @@ export class ExtHostCommentThread implements vscode.CommentThread {
}
get resource(): vscode.Uri {
return this._resource;
return this._uri;
}
get uri(): vscode.Uri {
return this._uri;
}
private _onDidUpdateCommentThread = new Emitter<void>();
......@@ -476,7 +480,7 @@ export class ExtHostCommentThread implements vscode.CommentThread {
private readonly _commandsConverter: CommandsConverter,
private _commentController: ExtHostCommentController,
private _id: string,
private _resource: vscode.Uri,
private _uri: vscode.Uri,
private _range: vscode.Range,
private _comments: vscode.Comment[]
) {
......@@ -484,7 +488,7 @@ export class ExtHostCommentThread implements vscode.CommentThread {
this._commentController.handle,
this.handle,
this._id,
this._resource,
this._uri,
extHostTypeConverter.Range.from(this._range)
);
......@@ -513,7 +517,7 @@ export class ExtHostCommentThread implements vscode.CommentThread {
this._commentController.handle,
this.handle,
this._id,
this._resource,
this._uri,
commentThreadRange,
label,
comments,
......@@ -717,6 +721,7 @@ function convertFromCommentThread(commentThread: modes.CommentThread): vscode.Co
return {
id: commentThread.threadId!,
threadId: commentThread.threadId!,
uri: URI.parse(commentThread.resource!),
resource: URI.parse(commentThread.resource!),
range: extHostTypeConverter.Range.to(commentThread.range),
comments: commentThread.comments ? commentThread.comments.map(convertFromComment) : [],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册