Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,18 @@
"category": "%command.pull.request.category%",
"enablement": "!commentIsEmpty"
},
{
"command": "pr.createCommentAndResolve",
"title": "%command.pr.createCommentAndResolve.title%",
"category": "%command.pull.request.category%",
"enablement": "!commentIsEmpty"
},
{
"command": "pr.createSingleCommentAndResolve",
"title": "%command.pr.createSingleCommentAndResolve.title%",
"category": "%command.pull.request.category%",
"enablement": "!commentIsEmpty"
},
{
"command": "pr.makeSuggestion",
"title": "%command.pr.makeSuggestion.title%",
Expand Down Expand Up @@ -2290,6 +2302,14 @@
"command": "pr.createSingleComment",
"when": "false"
},
{
"command": "pr.createCommentAndResolve",
"when": "false"
},
{
"command": "pr.createSingleCommentAndResolve",
"when": "false"
},
{
"command": "pr.makeSuggestion",
"when": "false"
Expand Down Expand Up @@ -3221,6 +3241,16 @@
"command": "pr.createSingleComment",
"group": "inline@2",
"when": "config.githubPullRequests.defaultCommentType == review && ((commentController =~ /^github-browse/ && !prInDraft) || commentController =~ /^github-review/ && !reviewInDraftMode)"
},
{
"command": "pr.createCommentAndResolve",
"group": "inline@3",
"when": "commentThread =~ /canResolve/ && ((commentController =~ /^github-browse/ && prInDraft) || (commentController =~ /^github-review/ && reviewInDraftMode))"
},
{
"command": "pr.createSingleCommentAndResolve",
"group": "inline@3",
"when": "commentThread =~ /canResolve/ && config.githubPullRequests.defaultCommentType != review && ((commentController =~ /^github-browse/ && !prInDraft) || (commentController =~ /^github-review/ && !reviewInDraftMode))"
}
],
"comments/comment/editorActions": [
Expand Down
2 changes: 2 additions & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@
"command.pr.deleteLocalBranchesNRemotes.title": "Delete local branches and remotes",
"command.pr.createComment.title": "Add Review Comment",
"command.pr.createSingleComment.title": "Add Comment",
"command.pr.createCommentAndResolve.title": "Add Review Comment and Resolve",
"command.pr.createSingleCommentAndResolve.title": "Add Comment and Resolve",
"command.pr.makeSuggestion.title": "Make Code Suggestion",
"command.pr.startReview.title": "Start Review",
"command.pr.editComment.title": "Edit Comment",
Expand Down
1 change: 1 addition & 0 deletions src/@types/vscode.proposed.chatParticipantAdditions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ declare module 'vscode' {
isComplete?: boolean;
toolSpecificData?: ChatTerminalToolInvocationData;
fromSubAgent?: boolean;
presentation?: 'hidden' | 'hiddenAfterComplete' | undefined;

constructor(toolName: string, toolCallId: string, isError?: boolean);
}
Expand Down
30 changes: 30 additions & 0 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,36 @@ export function registerCommands(
}),
);

context.subscriptions.push(
vscode.commands.registerCommand('pr.createCommentAndResolve', async (reply: CommentReply) => {
/* __GDPR__
"pr.createCommentAndResolve" : {}
*/
telemetry.sendTelemetryEvent('pr.createCommentAndResolve');
const handler = resolveCommentHandler(reply.thread);

if (handler) {
await handler.createOrReplyComment(reply.thread, reply.text, false);
await handler.resolveReviewThread(reply.thread);
}
}),
);

context.subscriptions.push(
vscode.commands.registerCommand('pr.createSingleCommentAndResolve', async (reply: CommentReply) => {
/* __GDPR__
"pr.createSingleCommentAndResolve" : {}
*/
telemetry.sendTelemetryEvent('pr.createSingleCommentAndResolve');
const handler = resolveCommentHandler(reply.thread);

if (handler) {
await handler.createOrReplyComment(reply.thread, reply.text, true);
await handler.resolveReviewThread(reply.thread);
}
}),
);

context.subscriptions.push(
vscode.commands.registerCommand('pr.makeSuggestion', async (reply: CommentReply | GHPRComment | undefined) => {
let potentialThread: GHPRCommentThread | undefined;
Expand Down