MCPcopy
hub / github.com/coder/mux / setSelectedWorkspaceId

Method setSelectedWorkspaceId

vscode/src/extension.ts:1010–1029  ·  view source on GitHub ↗
(workspaceId: string | null)

Source from the content-addressed store, hash-verified

1008 }
1009
1010 async setSelectedWorkspaceId(workspaceId: string | null): Promise<void> {
1011 if (workspaceId !== null) {
1012 assert(typeof workspaceId === "string", "workspaceId must be string or null");
1013 }
1014
1015 if (workspaceId === this.selectedWorkspaceId) {
1016 this.postMessage({ type: "setSelectedWorkspace", workspaceId });
1017 await this.updateChatSubscription();
1018 return;
1019 }
1020
1021 this.selectedWorkspaceId = workspaceId;
1022 await this.context.workspaceState.update(
1023 SELECTED_WORKSPACE_STATE_KEY,
1024 workspaceId ? workspaceId : undefined
1025 );
1026
1027 this.postMessage({ type: "setSelectedWorkspace", workspaceId });
1028 await this.updateChatSubscription();
1029 }
1030
1031 resolveWebviewView(view: vscode.WebviewView): void {
1032 muxLogDebug("mux.chatView: resolveWebviewView", { visible: view.visible });

Callers 4

onWebviewMessageMethod · 0.95
refreshWorkspacesMethod · 0.95
openWorkspaceCommandFunction · 0.80

Calls 4

postMessageMethod · 0.95
updateMethod · 0.65
assertFunction · 0.50

Tested by

no test coverage detected