Skip to content

Commit 36181ed

Browse files
committed
Merge branch 'main' into copilot/fix-instruction-grammar-errors
2 parents 1fd708b + b0bf1a5 commit 36181ed

28 files changed

Lines changed: 1890 additions & 1388 deletions

package.json

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@
243243
"default": [
244244
{
245245
"label": "%githubPullRequests.queries.copilotOnMyBehalf%",
246-
"query": "repo:${owner}/${repository} is:open author:copilot involves:${user}"
246+
"query": "repo:${owner}/${repository} is:open author:copilot assignee:${user}"
247247
},
248248
{
249249
"label": "Local Pull Request Branches",
@@ -321,6 +321,11 @@
321321
"default": true,
322322
"description": "%githubPullRequests.defaultDeletionMethod.selectRemote.description%"
323323
},
324+
"githubPullRequests.deleteBranchAfterMerge": {
325+
"type": "boolean",
326+
"default": false,
327+
"description": "%githubPullRequests.deleteBranchAfterMerge.description%"
328+
},
324329
"githubPullRequests.terminalLinksHandler": {
325330
"type": "string",
326331
"enum": [
@@ -612,6 +617,11 @@
612617
"markdownDescription": "%githubPullRequests.webviewRefreshInterval.description%",
613618
"default": 60
614619
},
620+
"githubPullRequests.devMode": {
621+
"type": "boolean",
622+
"markdownDescription": "%githubPullRequests.devMode.description%",
623+
"default": false
624+
},
615625
"githubIssues.ignoreMilestones": {
616626
"type": "array",
617627
"default": [],
@@ -711,6 +721,21 @@
711721
"default": "on",
712722
"markdownDescription": "%githubIssues.useBranchForIssues.markdownDescription%"
713723
},
724+
"githubIssues.workingBaseBranch": {
725+
"type": "string",
726+
"enum": [
727+
"currentBranch",
728+
"defaultBranch",
729+
"prompt"
730+
],
731+
"enumDescriptions": [
732+
"%githubIssues.workingBaseBranch.currentBranch%",
733+
"%githubIssues.workingBaseBranch.defaultBranch%",
734+
"%githubIssues.workingBaseBranch.prompt%"
735+
],
736+
"default": "currentBranch",
737+
"markdownDescription": "%githubIssues.workingBaseBranch.markdownDescription%"
738+
},
714739
"githubIssues.issueCompletionFormatScm": {
715740
"type": "string",
716741
"default": "${issueTitle}\nFixes ${issueNumberLabel}",
@@ -971,6 +996,12 @@
971996
"category": "%command.pull.request.category%",
972997
"icon": "$(globe)"
973998
},
999+
{
1000+
"command": "pr.pickOnCodespaces",
1001+
"title": "%command.pr.pickOnCodespaces.title%",
1002+
"category": "%command.pull.request.category%",
1003+
"icon": "$(cloud)"
1004+
},
9741005
{
9751006
"command": "pr.exit",
9761007
"title": "%command.pr.exit.title%",
@@ -1417,6 +1448,11 @@
14171448
"title": "%command.pr.checkoutOnVscodeDevFromDescription.title%",
14181449
"category": "%command.pull.request.category%"
14191450
},
1451+
{
1452+
"command": "pr.checkoutOnCodespacesFromDescription",
1453+
"title": "%command.pr.checkoutOnCodespacesFromDescription.title%",
1454+
"category": "%command.pull.request.category%"
1455+
},
14201456
{
14211457
"command": "pr.openSessionLogFromDescription",
14221458
"title": "%command.pr.openSessionLogFromDescription.title%",
@@ -2050,6 +2086,10 @@
20502086
"command": "pr.pickOnVscodeDev",
20512087
"when": "false"
20522088
},
2089+
{
2090+
"command": "pr.pickOnCodespaces",
2091+
"when": "false"
2092+
},
20532093
{
20542094
"command": "pr.exit",
20552095
"when": "github:inReviewMode"
@@ -2849,6 +2889,11 @@
28492889
"when": "view == pr:github && viewItem =~ /pullrequest(:local)?:nonactive/ && (!isWeb || remoteName != codespaces && virtualWorkspace != vscode-vfs)",
28502890
"group": "1_pullrequest@2"
28512891
},
2892+
{
2893+
"command": "pr.pickOnCodespaces",
2894+
"when": "view == pr:github && viewItem =~ /pullrequest(:local)?:nonactive/ && (!isWeb || remoteName != codespaces && virtualWorkspace != vscode-vfs)",
2895+
"group": "1_pullrequest@3"
2896+
},
28522897
{
28532898
"command": "pr.openChanges",
28542899
"when": "view =~ /(pr|prStatus):github/ && viewItem =~ /(pullrequest|description)/ && config.multiDiffEditor.experimental.enabled",
@@ -3602,6 +3647,11 @@
36023647
"group": "checkout@1",
36033648
"when": "webviewId == PullRequestOverview && github:checkoutMenu"
36043649
},
3650+
{
3651+
"command": "pr.checkoutOnCodespacesFromDescription",
3652+
"group": "checkout@2",
3653+
"when": "webviewId == PullRequestOverview && github:checkoutMenu"
3654+
},
36053655
{
36063656
"command": "pr.openSessionLogFromDescription",
36073657
"when": "webviewId == PullRequestOverview && github:codingAgentMenu"
@@ -3671,6 +3721,16 @@
36713721
},
36723722
"description": "The color used for indicating that an issue is closed."
36733723
},
3724+
{
3725+
"id": "github.issues.closed",
3726+
"defaults": {
3727+
"dark": "pullRequests.merged",
3728+
"light": "pullRequests.merged",
3729+
"highContrast": "editor.foreground",
3730+
"highContrastLight": "editor.foreground"
3731+
},
3732+
"description": "The color used for indicating that an issue is closed. Duplicates issues.closed because there's another extension that uses this identifier."
3733+
},
36743734
{
36753735
"id": "pullRequests.merged",
36763736
"defaults": {

package.nls.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"githubPullRequests.hideViewedFiles.description": "Hide files that have been marked as viewed in the pull request changes tree.",
4040
"githubPullRequests.defaultDeletionMethod.selectLocalBranch.description": "When true, the option to delete the local branch will be selected by default when deleting a branch from a pull request.",
4141
"githubPullRequests.defaultDeletionMethod.selectRemote.description": "When true, the option to delete the remote will be selected by default when deleting a branch from a pull request.",
42+
"githubPullRequests.deleteBranchAfterMerge.description": "Automatically delete the branch after merging a pull request. This setting only applies when the pull request is merged through this extension.",
4243
"githubPullRequests.terminalLinksHandler.description": "Default handler for terminal links.",
4344
"githubPullRequests.terminalLinksHandler.github": "Create the pull request on GitHub.",
4445
"githubPullRequests.terminalLinksHandler.vscode": "Create the pull request in VS Code.",
@@ -102,6 +103,7 @@
102103
"githubPullRequests.experimental.notificationsMarkPullRequests.description": "Adds an action in the Notifications view to mark pull requests with no non-empty reviews, comments, or commits since you last viewed the pull request as read.",
103104
"githubPullRequests.experimental.useQuickChat.description": "Controls whether the Copilot \"Summarize\" commands in the Pull Requests, Issues, and Notifications views will use quick chat. Only has an effect if `#githubPullRequests.experimental.chat#` is enabled.",
104105
"githubPullRequests.webviewRefreshInterval.description": "The interval, in seconds, at which the pull request and issues webviews are refreshed when the webview is the active tab.",
106+
"githubPullRequests.devMode.description": "When enabled, limits expensive API calls to prevent hitting rate limits during extension development. Disables automatic Copilot PR status polling, collapses all PR query results, and disables issue fetching.",
105107
"githubIssues.ignoreMilestones.description": "An array of milestone titles to never show issues from.",
106108
"githubIssues.createIssueTriggers.description": "Strings that will cause the 'Create issue from comment' code action to show.",
107109
"githubIssues.createIssueTriggers.items": "String that enables the 'Create issue from comment' code action. Should not contain whitespace.",
@@ -130,6 +132,15 @@
130132
"githubIssues.useBranchForIssues.on": "A branch will always be checked out when you start working on an issue. If the branch doesn't exist, it will be created.",
131133
"githubIssues.useBranchForIssues.off": "A branch will not be created when you start working on an issue. If you have worked on an issue before and a branch was created for it, that same branch will be checked out.",
132134
"githubIssues.useBranchForIssues.prompt": "A prompt will show for setting the name of the branch that will be created and checked out.",
135+
"githubIssues.workingBaseBranch.markdownDescription": {
136+
"message": "Determines which branch to use as the base when creating a new branch for an issue. This setting controls what branch the new issue branch is created from.",
137+
"comment": [
138+
"Describes the base branch selection for issue branches"
139+
]
140+
},
141+
"githubIssues.workingBaseBranch.currentBranch": "Create the issue branch from the current branch without switching to the default branch first.",
142+
"githubIssues.workingBaseBranch.defaultBranch": "Always switch to the default branch before creating the issue branch.",
143+
"githubIssues.workingBaseBranch.prompt": "Prompt which branch to use as the base when creating an issue branch.",
133144
"githubIssues.issueCompletionFormatScm.markdownDescription": {
134145
"message": "Sets the format of issue completions in the SCM inputbox. \n- `${user}` will be replace with the currently logged in username \n- `${issueNumber}` will be replaced with the current issue number \n- `${issueNumberLabel}` will be replaced with a label formatted as #number or owner/repository#number, depending on whether the issue is in the current repository",
135146
"comment": [
@@ -189,6 +200,7 @@
189200
"command.pr.pick.title": "Checkout Pull Request",
190201
"command.pr.openChanges.title": "Open Changes",
191202
"command.pr.pickOnVscodeDev.title": "Checkout Pull Request on vscode.dev",
203+
"command.pr.pickOnCodespaces.title": "Checkout Pull Request on Codespaces",
192204
"command.pr.exit.title": "Checkout Default Branch",
193205
"command.pr.dismissNotification.title": "Dismiss Notification",
194206
"command.pr.markAllCopilotNotificationsAsRead.title": "Dismiss All Copilot Notifications",
@@ -288,6 +300,7 @@
288300
"command.pr.checkoutFromDescription.title": "Checkout",
289301
"command.pr.applyChangesFromDescription.title": "Apply Changes",
290302
"command.pr.checkoutOnVscodeDevFromDescription.title": "Checkout on vscode.dev",
303+
"command.pr.checkoutOnCodespacesFromDescription.title": "Checkout on Codespaces",
291304
"command.pr.openSessionLogFromDescription.title": "View Session",
292305
"command.issue.openDescription.title": "View Issue Description",
293306
"command.issue.copyGithubDevLink.title": "Copy github.dev Link",

src/commands.ts

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { PullRequestModel } from './github/pullRequestModel';
3131
import { PullRequestOverviewPanel } from './github/pullRequestOverview';
3232
import { chooseItem } from './github/quickPicks';
3333
import { RepositoriesManager } from './github/repositoriesManager';
34-
import { getIssuesUrl, getPullsUrl, isInCodespaces, ISSUE_OR_URL_EXPRESSION, parseIssueExpressionOutput, vscodeDevPrLink } from './github/utils';
34+
import { codespacesPrLink, getIssuesUrl, getPullsUrl, isInCodespaces, ISSUE_OR_URL_EXPRESSION, parseIssueExpressionOutput, vscodeDevPrLink } from './github/utils';
3535
import { OverviewContext } from './github/views';
3636
import { isNotificationTreeItem, NotificationTreeItem } from './notifications/notificationItem';
3737
import { NotificationsManager } from './notifications/notificationsManager';
@@ -694,24 +694,38 @@ export function registerCommands(
694694
}
695695
}));
696696

697-
context.subscriptions.push(
698-
vscode.commands.registerCommand('pr.pickOnVscodeDev', async (pr: PRNode | RepositoryChangesNode | PullRequestModel) => {
699-
if (pr === undefined) {
700-
// This is unexpected, but has happened a few times.
701-
Logger.error('Unexpectedly received undefined when picking a PR.', logId);
702-
return vscode.window.showErrorMessage(vscode.l10n.t('No pull request was selected to checkout, please try again.'));
703-
}
697+
const pickPullRequest = async (pr: PRNode | RepositoryChangesNode | PullRequestModel, linkGenerator: (pr: PullRequestModel) => string, requiresHead: boolean = false) => {
698+
if (pr === undefined) {
699+
// This is unexpected, but has happened a few times.
700+
Logger.error('Unexpectedly received undefined when picking a PR.', logId);
701+
return vscode.window.showErrorMessage(vscode.l10n.t('No pull request was selected to checkout, please try again.'));
702+
}
704703

705-
let pullRequestModel: PullRequestModel;
704+
let pullRequestModel: PullRequestModel;
706705

707-
if (pr instanceof PRNode || pr instanceof RepositoryChangesNode) {
708-
pullRequestModel = pr.pullRequestModel;
709-
} else {
710-
pullRequestModel = pr;
711-
}
706+
if (pr instanceof PRNode || pr instanceof RepositoryChangesNode) {
707+
pullRequestModel = pr.pullRequestModel;
708+
} else {
709+
pullRequestModel = pr;
710+
}
712711

713-
return vscode.env.openExternal(vscode.Uri.parse(vscodeDevPrLink(pullRequestModel)));
714-
}),
712+
if (requiresHead && !pullRequestModel.head) {
713+
return vscode.window.showErrorMessage(vscode.l10n.t('Unable to checkout pull request: missing head branch information.'));
714+
}
715+
716+
return vscode.env.openExternal(vscode.Uri.parse(linkGenerator(pullRequestModel)));
717+
};
718+
719+
context.subscriptions.push(
720+
vscode.commands.registerCommand('pr.pickOnVscodeDev', async (pr: PRNode | RepositoryChangesNode | PullRequestModel) =>
721+
pickPullRequest(pr, vscodeDevPrLink)
722+
),
723+
);
724+
725+
context.subscriptions.push(
726+
vscode.commands.registerCommand('pr.pickOnCodespaces', async (pr: PRNode | RepositoryChangesNode | PullRequestModel) =>
727+
pickPullRequest(pr, codespacesPrLink, true)
728+
),
715729
);
716730

717731
context.subscriptions.push(vscode.commands.registerCommand('pr.checkoutOnVscodeDevFromDescription', async (context: OverviewContext | undefined) => {
@@ -725,6 +739,20 @@ export function registerCommands(
725739
return vscode.env.openExternal(vscode.Uri.parse(vscodeDevPrLink(resolved.pr)));
726740
}));
727741

742+
context.subscriptions.push(vscode.commands.registerCommand('pr.checkoutOnCodespacesFromDescription', async (context: OverviewContext | undefined) => {
743+
if (!context) {
744+
return vscode.window.showErrorMessage(vscode.l10n.t('No pull request context provided for checkout.'));
745+
}
746+
const resolved = await resolvePr(context);
747+
if (!resolved) {
748+
return vscode.window.showErrorMessage(vscode.l10n.t('Unable to resolve pull request for checkout.'));
749+
}
750+
if (!resolved.pr.head) {
751+
return vscode.window.showErrorMessage(vscode.l10n.t('Unable to checkout pull request: missing head branch information.'));
752+
}
753+
return vscode.env.openExternal(vscode.Uri.parse(codespacesPrLink(resolved.pr)));
754+
}));
755+
728756
context.subscriptions.push(vscode.commands.registerCommand('pr.openSessionLogFromDescription', async (context: SessionLinkInfo | undefined) => {
729757
if (!context) {
730758
return vscode.window.showErrorMessage(vscode.l10n.t('No pull request context provided for checkout.'));

0 commit comments

Comments
 (0)