diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 2185299d26a787b3b2607ba648bafeb091613d1f..76a7fedbf43615e441a2f715d4163952ddf85993 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,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. diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 27758cdb3075cfdd1a91052907de8a255e287e62..0324fb4fc836eacef43e7d7763a3dd41e18f2276 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 d4c5f74621d1eb24ac8e74f358da2838fe7836cc..a36f7409934f280368087edd4a7f7d4cc2953aac 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) : [],