diff --git a/comment-sample/src/extension.ts b/comment-sample/src/extension.ts index 4bb53c88..2c5d3f2a 100644 --- a/comment-sample/src/extension.ts +++ b/comment-sample/src/extension.ts @@ -27,17 +27,15 @@ export function activate(context: vscode.ExtensionContext) { thread.label = 'Create New Note'; // We will render all `acceptInputCommands` as Actions on the bottom of Comment Widget in the editor. - thread.acceptInputCommands = [ - { - title: 'Create Note', - command: 'mywiki.createNote', - // Command is responsible for arguments - arguments: [ - commentController, - thread - ] - } - ]; + thread.acceptInputCommand = { + title: 'Create Note', + command: 'mywiki.createNote', + // Command is responsible for arguments + arguments: [ + commentController, + thread + ] + }; }; // Register commenting range provider and callback. @@ -55,16 +53,14 @@ export function activate(context: vscode.ExtensionContext) { thread.label = 'Participants: vscode'; // After we create the new comment thread, we may want to update the actions on the Comment Widget. - thread.acceptInputCommands = [ - { - title: 'Create Comment', - command: 'mywiki.createComment', - arguments: [ - commentController, - thread - ] - } - ]; + thread.acceptInputCommand = { + title: 'Create Comment', + command: 'mywiki.createComment', + arguments: [ + commentController, + thread + ] + }; // Lastly, we want to clear the textarea in Comment Widget. commentController.inputBox.value = ''; diff --git a/comment-sample/src/typings/vscode.proposed.d.ts b/comment-sample/src/typings/vscode.proposed.d.ts index 522dce06..85c9ab6e 100644 --- a/comment-sample/src/typings/vscode.proposed.d.ts +++ b/comment-sample/src/typings/vscode.proposed.d.ts @@ -55,7 +55,17 @@ declare module 'vscode' { * The ordered comments of the thread. */ comments: Comment[]; - acceptInputCommands?: Command[]; + /** + * `acceptInputCommand` is the default action rendered on Comment Widget, which is always placed rightmost. + * It will be executed when users submit the comment from keyboard shortcut. + * This action is disabled when the comment editor is empty. + */ + acceptInputCommand?: Command; + + /** + * `additionalCommands` are the secondary actions rendered on Comment Widget. + */ + additionalCommands?: Command[]; /** * Whether the thread should be collapsed or expanded when opening the document. Defaults to Collapsed.