Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d803bb7

Browse files
authored
feat: automatically open workspaces in vscode in the dir specified (#6115)
This makes a one-click magical experience not only possible, but really nice too!
1 parent 2ed0eaf commit d803bb7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

site/src/components/Resources/AgentRow.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export const AgentRow: FC<AgentRowProps> = ({
119119
userName={workspace.owner_name}
120120
workspaceName={workspace.name}
121121
agentName={agent.name}
122+
folderPath={agent.expanded_directory}
122123
/>
123124
)}
124125
{applicationsHost !== undefined && applicationsHost !== "" && (

site/src/components/VSCodeDesktopButton/VSCodeDesktopButton.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ export interface VSCodeDesktopButtonProps {
77
userName: string
88
workspaceName: string
99
agentName?: string
10+
folderPath?: string
1011
}
1112

1213
export const VSCodeDesktopButton: FC<
1314
PropsWithChildren<VSCodeDesktopButtonProps>
14-
> = ({ userName, workspaceName, agentName }) => {
15+
> = ({ userName, workspaceName, agentName, folderPath }) => {
1516
const [loading, setLoading] = useState(false)
1617

1718
return (
@@ -32,6 +33,9 @@ export const VSCodeDesktopButton: FC<
3233
if (agentName) {
3334
query.set("agent", agentName)
3435
}
36+
if (folderPath) {
37+
query.set("folder", folderPath)
38+
}
3539

3640
location.href = `vscode://coder.coder-remote/open?${query.toString()}`
3741
})

0 commit comments

Comments
 (0)