diff --git a/comment-sample/src/extension.ts b/comment-sample/src/extension.ts index ed0c8419..094c4626 100644 --- a/comment-sample/src/extension.ts +++ b/comment-sample/src/extension.ts @@ -15,13 +15,10 @@ export function activate(context: vscode.ExtensionContext) { provideCommentingRanges: (document: vscode.TextDocument, token: vscode.CancellationToken) => { let lineCount = document.lineCount; return [new vscode.Range(0, 0, lineCount - 1, 0)]; - } - }; - - // callback when users click `+` button on Gutter or run Create Comment command from Command Palette - commentController.emptyCommentThreadFactory = { + }, + // callback when users click `+` button on Gutter or run Create Comment command from Command Palette createEmptyCommentThread: (document: vscode.TextDocument, range: vscode.Range) => { - // create a empty thread + // create a empty thread let thread = commentController.createCommentThread(`${++threadId}`, document.uri, range, []); // by default, a comment thread is collapsed, for newly created empty comment thread, we want to expand it and users can start commenting immediately thread.collapsibleState = vscode.CommentThreadCollapsibleState.Expanded; diff --git a/comment-sample/src/typings/vscode.proposed.d.ts b/comment-sample/src/typings/vscode.proposed.d.ts index 9876a997..a1334387 100644 --- a/comment-sample/src/typings/vscode.proposed.d.ts +++ b/comment-sample/src/typings/vscode.proposed.d.ts @@ -155,9 +155,7 @@ declare module 'vscode' { * Provide a list of ranges which allow new comment threads creation or null for a given document */ provideCommentingRanges(document: TextDocument, token: CancellationToken): ProviderResult; - } - export interface EmptyCommentThreadFactory { /** * The method `createEmptyCommentThread` is called when users attempt to create new comment thread from the gutter or command palette. * Extensions still need to call `createCommentThread` inside this call when appropriate. @@ -192,11 +190,6 @@ declare module 'vscode' { */ commentingRangeProvider?: CommentingRangeProvider; - /** - * Optional new comment thread factory. - */ - emptyCommentThreadFactory?: EmptyCommentThreadFactory; - /** * Dispose this comment controller. */