diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 2185299d26a..76a7fedbf43 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -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,18 +9003,6 @@ declare module 'vscode' { */ acceptInputCommand?: Command; - /** - * 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; /** * Dispose this comment thread. @@ -9040,6 +9028,22 @@ declare module 'vscode' { iconPath?: Uri; } + /** + * Author information of a [comment](#Comment) + */ + + export interface CommentAuthorInformation { + /** + * The display name of the author of the comment + */ + name: string; + + /** + * The optional icon path for the author + */ + iconPath?: Uri; + } + /** * A comment is displayed within the editor or the Comments Panel, depending on how it is provided. */ @@ -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. diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 27758cdb307..0324fb4fc83 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -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; } + 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 { /** diff --git a/src/vs/workbench/api/common/extHostComments.ts b/src/vs/workbench/api/common/extHostComments.ts index d4c5f74621d..a36f7409934 100644 --- a/src/vs/workbench/api/common/extHostComments.ts +++ b/src/vs/workbench/api/common/extHostComments.ts @@ -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(); @@ -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) : [],