You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'use strict';// The module 'vscode' contains the VS Code extensibility API// Import the module and reference it with the alias vscode in your code belowimport*asvscodefrom'vscode';// this method is called when your extension is activated// your extension is activated the very first time the command is executedexportfunctionactivate(context: vscode.ExtensionContext){const_onDidChangeDocumentCommentThreads=newvscode.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: newvscode.Range(newvscode.Position(0,0),newvscode.Position(0,0)),comments: [{commentId: '1',body: newvscode.MarkdownString('hello world'),userName: 'me',gravatar: '',canEdit: true,canDelete: true}]}],commentingRanges: []}},createNewCommentThread: async(document: vscode.TextDocument,range: vscode.Range,text: string)=>{thrownewError('Not implemented');},replyToCommentThread: async(document: vscode.TextDocument,range: vscode.Range,thread: vscode.CommentThread,text: string)=>{thrownewError('Not implemented');},editComment: async(document: vscode.TextDocument,comment: vscode.Comment,text: string,token: vscode.CancellationToken)=>{return{commentId: '10',body: newvscode.MarkdownString(text),userName: 'me',gravatar: '',canEdit: false,canDelete: false};},deleteComment: async(document: vscode.TextDocument,comment: vscode.Comment,token: vscode.CancellationToken)=>{returnnull;}});}// this method is called when your extension is deactivatedexportfunctiondeactivate(){}
In editComment, I am returning a comment that does not support edit and delete. This is not being considered. Also setting commentId (may be other properties) does not have impact. If they are not considered we should not return the comment instead updated text?
The text was updated successfully, but these errors were encountered:
Ah, good point. I'm going to change the return type to Promise<void>, since the core already has the updated text, it doesn't actually need anything back from the extension.
Testing #59278
In editComment, I am returning a comment that does not support edit and delete. This is not being considered. Also setting commentId (may be other properties) does not have impact. If they are not considered we should not return the comment instead updated text?
The text was updated successfully, but these errors were encountered: