-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Closed
Labels
apiapi-proposalfeature-requestRequest for new features or functionalityRequest for new features or functionalityon-testplan
Milestone
Description
Extensions should be able to handle edits and deletes to comments within the editor. The DocumentCommentProvider
can be extended to add these new methods, mimicking the other methods on the provider.
interface DocumentCommentProvider {
provideDocumentComments(document: TextDocument, token: CancellationToken): Promise<CommentInfo>;
createNewCommentThread(document: TextDocument, range: Range, text: string, token: CancellationToken): Promise<CommentThread>;
replyToCommentThread(document: TextDocument, range: Range, commentThread: CommentThread, text: string, token: CancellationToken): Promise<CommentThread>;
/**
* Called when a user edits the comment body to the be new text text.
*/
editComment?(document: TextDocument, comment: Comment, text: string, token: CancellationToken): Promise<Comment>;
/**
* Called when a user deletes the comment.
*/
deleteComment?(document: TextDocument, comment: Comment, token: CancellationToken): Promise<void>;
onDidChangeCommentThreads?: Event<CommentThreadChangedEvent>;
}
Additionally, comments themselves need a flag indicating whether or not they can be edited or deleted.
interface Comment {
<existing properties>
/**
* Whether the current user has permission to edit the comment.
*
* This will be treated as false if the comment is provided by a `WorkspaceCommentProvider`, or
* if it is provided by a `DocumentCommentProvider` and no `editComment` method is given.
*/
canEdit?: boolean;
/**
* Whether the current user has permission to delete the comment.
*
* This will be treated as false if the comment is provided by a `WorkspaceCommentProvider`, or
* if it is provided by a `DocumentCommentProvider` and no `deleteComment` method is given.
*/
canDelete?: boolean;
}
Metadata
Metadata
Assignees
Labels
apiapi-proposalfeature-requestRequest for new features or functionalityRequest for new features or functionalityon-testplan