MCPcopy Create free account
hub / github.com/GCWing/BitFun / open_workspace

Function open_workspace

src/apps/desktop/src/api/commands.rs:1371–1407  ·  view source on GitHub ↗
(
    state: State<'_, AppState>,
    app: tauri::AppHandle,
    request: OpenWorkspaceRequest,
)

Source from the content-addressed store, hash-verified

1369
1370#[tauri::command]
1371pub async fn open_workspace(
1372 state: State<'_, AppState>,
1373 app: tauri::AppHandle,
1374 request: OpenWorkspaceRequest,
1375) -> Result<WorkspaceInfoDto, String> {
1376 match state
1377 .workspace_service
1378 .open_workspace(request.path.clone().into())
1379 .await
1380 {
1381 Ok(workspace_info) => {
1382 apply_active_workspace_context(&state, &app, &workspace_info, None).await;
1383
1384 if let Err(e) = state
1385 .workspace_identity_watch_service
1386 .sync_watched_workspaces()
1387 .await
1388 {
1389 warn!(
1390 "Failed to sync workspace identity watchers after open: {}",
1391 e
1392 );
1393 }
1394
1395 info!(
1396 "Workspace opened: name={}, path={}",
1397 workspace_info.name,
1398 workspace_info.root_path.display()
1399 );
1400 Ok(WorkspaceInfoDto::from_workspace_info(&workspace_info))
1401 }
1402 Err(e) => {
1403 error!("Failed to open workspace: {}", e);
1404 Err(format!("Failed to open workspace: {}", e))
1405 }
1406 }
1407}
1408
1409#[tauri::command]
1410pub async fn open_remote_workspace(

Callers

nothing calls this directly

Calls 4

open_workspaceMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected