MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / buildSnapshot

Function buildSnapshot

src/settings/lspServerDetail.js:257–286  ·  view source on GitHub ↗
(serverId)

Source from the content-addressed store, hash-verified

255}
256
257async function buildSnapshot(serverId) {
258 const liveServer = lspApi.servers.get(serverId);
259 if (!liveServer) return null;
260
261 const merged = getMergedConfig(liveServer);
262 const override = getServerOverride(serverId);
263 const directWebSocket = isDirectWebSocketServer(merged);
264 const installResult = await checkRuntimeServerInstallation(merged).catch(
265 (error) => ({
266 status: "failed",
267 version: null,
268 canInstall: true,
269 canUpdate: true,
270 message: error instanceof Error ? error.message : String(error),
271 }),
272 );
273
274 return {
275 liveServer,
276 merged,
277 override,
278 directWebSocket,
279 isCustom: isCustomServer(serverId),
280 installResult,
281 builtinExts: merged.clientConfig?.builtinExtensions || {},
282 installCommand: await getRuntimeInstallCommand(merged, "install"),
283 updateCommand: await getRuntimeInstallCommand(merged, "update"),
284 uninstallCommand: await getRuntimeUninstallCommand(merged),
285 };
286}
287
288function createItems(snapshot) {
289 const featureItems = getFeatureItems();

Callers 2

refreshVisibleStateFunction · 0.85
callbackFunction · 0.85

Calls 9

getServerOverrideFunction · 0.90
isCustomServerFunction · 0.90
getRuntimeInstallCommandFunction · 0.90
getMergedConfigFunction · 0.85
isDirectWebSocketServerFunction · 0.85
StringInterface · 0.85
getMethod · 0.45

Tested by

no test coverage detected