-
Notifications
You must be signed in to change notification settings - Fork 29.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test DocumentCommentProvider edit and delete #59278
Labels
Milestone
Comments
@RMacfarlane Is there a sample that can be followed? Otherwise It's unclear where and how to start. |
This was referenced Sep 25, 2018
@sandy081 I implemented a |
@sandy081 I haven't made a sample yet since this is still proposed API, but here's a comment provider that provides a comment on the first line of any document export function activate(context: vscode.ExtensionContext) {
const _onDidChangeDocumentCommentThreads = new vscode.EventEmitter<vscode.CommentThreadChangedEvent>();
vscode.workspace.registerDocumentCommentProvider({
onDidChangeCommentThreads: _onDidChangeDocumentCommentThreads.event,
provideDocumentComments: async (document: vscode.TextDocument, token: vscode.CancellationToken): Promise<vscode.CommentInfo> => {
return {
threads: [{
threadId: '1',
resource: document.uri,
range: new vscode.Range(new vscode.Position(0, 0), new vscode.Position(0, 0)),
comments: [{
commentId: '1',
body: new vscode.MarkdownString('hello world'),
userName: 'me',
gravatar: ''
}]
}],
commentingRanges: []
}
},
createNewCommentThread: async (document: vscode.TextDocument, range: vscode.Range, text: string) => {
throw new Error('Not implemented');
},
replyToCommentThread: async (document: vscode.TextDocument, range: vscode.Range, thread: vscode.CommentThread, text: string) => {
throw new Error('Not implemented');
}
});
} |
This was referenced Sep 26, 2018
This was referenced Sep 26, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
#58078
Complexity: 4
DocumentCommentProviders
now expose a way to edit and delete comments. When the provider haseditComment
ordeleteComment
methods and a comment within a document has thecanEdit
orcanDelete
flag set, an action bar should appear on hover or focus of the comment. Things to test:editComment
anddeleteComment
is safely handled by VSCodeThe text was updated successfully, but these errors were encountered: