You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 57d9583
Browse filesBrowse the repository at this point in the historyBrowse files
feat: add a command to open a workspace in the VS Code Agents window
Coder: Open Workspace in Agents Window starts the workspace if needed, writes the SSH config to ~/.ssh/config for plain ssh, and opens the template's directory (or the last folder opened on the workspace) in the Agents window. The command shows only where VS Code has the Agents window.
`The template for ${createWorkspaceIdentifier(ready.workspace)} sets no directory and no folder was opened on it before, so the Agents window opens without a folder on it.`,
1291
+
);
1292
+
}
1293
+
1294
+
this.logger.info("Opening workspace in the Agents window",{
1295
+
remoteAuthority,
1296
+
handoff,
1297
+
});
1298
+
awaitopenAgentsWindow(
1299
+
folderPath
1300
+
? vscode.Uri.from({
1301
+
scheme: "vscode-remote",
1302
+
authority: remoteAuthority,
1303
+
path: folderPath,
1304
+
})
1305
+
: undefined,
1306
+
);
1307
+
returnrecordOpenResult(telemetry,ready,{
1308
+
status: "opened",
1309
+
handoff,
1310
+
});
1311
+
}
1312
+
1202
1313
/**
1203
1314
* Open a devcontainer from a workspace belonging to the currently logged-in deployment.
1204
1315
*
@@ -1703,44 +1814,27 @@ export class Commands {
1703
1814
}
1704
1815
1705
1816
/**
1706
-
* Given a workspace and agent, build the host name, find a directory to open,
1707
-
* and pass both to the Remote SSH plugin in the form of a remote authority
1708
-
* URI.
1709
-
*
1710
-
* If provided, folderPath is always used, otherwise expanded_directory from
1711
-
* the agent is used.
1817
+
* The folder to open on the agent: `folderPath`, else the template's default
1818
+
* directory, else a recently opened folder on this workspace.
1712
1819
*/
1713
-
privateasyncopenWorkspace(
1714
-
baseUrl: string,
1715
-
workspace: Workspace,
1820
+
privateasyncchooseFolder(
1821
+
folders: vscode.Uri[],
1822
+
remoteAuthority: string,
1716
1823
agent: WorkspaceAgent,
1717
1824
options: Pick<
1718
1825
OpenOptions,
1719
1826
"folderPath"|"openRecent"|"useDefaultDirectory"
1720
1827
>={},
1721
-
): Promise<OpenWorkspaceResult>{
1828
+
): Promise<FolderChoice>{
1722
1829
const{ openRecent, useDefaultDirectory }={
1723
1830
...openDefaults,
1724
1831
...options,
1725
1832
};
1726
1833
let{ folderPath }=options;
1727
-
letremoteAuthority=toRemoteAuthority(
1728
-
baseUrl,
1729
-
workspace.owner_name,
1730
-
workspace.name,
1731
-
agent.name,
1732
-
);
1733
-
1734
-
letnewWindow=true;
1735
-
// Open in the existing window if no workspaces are open.
0 commit comments