Skip to content

Commit 0e768cc

Browse files
authored
Apply worktree changes from context menu. (#2417)
1 parent ed63d70 commit 0e768cc

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4535,6 +4535,11 @@
45354535
}
45364536
],
45374537
"chat/chatSessions": [
4538+
{
4539+
"command": "github.copilot.chat.applyCopilotCLIAgentSessionChanges",
4540+
"when": "chatSessionType == copilotcli",
4541+
"group": "inline@0"
4542+
},
45384543
{
45394544
"command": "github.copilot.cli.sessions.resumeInTerminal",
45404545
"when": "chatSessionType == copilotcli",

package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@
413413
"github.copilot.cli.sessions.newTerminalSession": "New Agent Session in Terminal",
414414
"github.copilot.command.openCopilotAgentSessionsInBrowser": "Open in Browser",
415415
"github.copilot.command.closeChatSessionPullRequest.title": "Close Pull Request",
416-
"github.copilot.command.applyCopilotCLIAgentSessionChanges": "Apply Changes",
416+
"github.copilot.command.applyCopilotCLIAgentSessionChanges": "Apply Changes to Workspace",
417417
"github.copilot.config.githubMcpServer.enabled": "Enable built-in support for the GitHub MCP Server.",
418418
"github.copilot.config.githubMcpServer.toolsets": "Specify toolsets to use from the GitHub MCP Server.",
419419
"github.copilot.config.githubMcpServer.readonly": "Enable read-only mode for the GitHub MCP Server. When enabled, only read tools are available.",

src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,12 +1079,16 @@ export function registerCLIChatCommands(copilotcliSessionItemProvider: CopilotCL
10791079

10801080
await vscode.commands.executeCommand('_workbench.openMultiDiffEditor', { multiDiffSourceUri, title, resources });
10811081
}));
1082-
disposableStore.add(vscode.commands.registerCommand('github.copilot.chat.applyCopilotCLIAgentSessionChanges', async (sessionItemResource?: vscode.Uri) => {
1083-
if (!sessionItemResource) {
1082+
disposableStore.add(vscode.commands.registerCommand('github.copilot.chat.applyCopilotCLIAgentSessionChanges', async (sessionItemOrResource?: vscode.ChatSessionItem | vscode.Uri) => {
1083+
const resource = sessionItemOrResource instanceof vscode.Uri
1084+
? sessionItemOrResource
1085+
: sessionItemOrResource?.resource;
1086+
1087+
if (!resource) {
10841088
return;
10851089
}
10861090

1087-
const sessionId = SessionIdForCLI.parse(sessionItemResource);
1091+
const sessionId = SessionIdForCLI.parse(resource);
10881092
const sessionWorktree = copilotcliSessionItemProvider.worktreeManager.getWorktreePath(sessionId);
10891093

10901094
if (!sessionWorktree) {

0 commit comments

Comments
 (0)