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

Function remote_workspace_from_info

src/apps/desktop/src/api/commands.rs:55–81  ·  view source on GitHub ↗
(info: &WorkspaceInfo)

Source from the content-addressed store, hash-verified

53}
54
55fn remote_workspace_from_info(info: &WorkspaceInfo) -> Option<crate::api::RemoteWorkspace> {
56 if info.workspace_kind != WorkspaceKind::Remote {
57 return None;
58 }
59 let cid = info.metadata.get("connectionId")?.as_str()?.to_string();
60 let name = info
61 .metadata
62 .get("connectionName")
63 .and_then(|v| v.as_str())
64 .unwrap_or(&cid)
65 .to_string();
66 let rp = bitfun_core::service::remote_ssh::normalize_remote_workspace_path(
67 &info.root_path.to_string_lossy(),
68 );
69 let ssh_host = info
70 .metadata
71 .get("sshHost")
72 .and_then(|v| v.as_str())
73 .unwrap_or("")
74 .to_string();
75 Some(crate::api::RemoteWorkspace {
76 connection_id: cid,
77 remote_path: rp,
78 connection_name: name,
79 ssh_host,
80 })
81}
82
83fn lock_active_searches<'a>(
84 state: &'a State<'_, AppState>,

Callers 2

close_workspaceFunction · 0.85

Calls 3

as_strMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected