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

Function restartServer

src/components/lspInfoDialog/index.js:83–104  ·  view source on GitHub ↗
(serverId)

Source from the content-addressed store, hash-verified

81}
82
83async function restartServer(serverId) {
84 addLspLog(serverId, "info", "Restart requested by user");
85 toast("Restarting server...");
86
87 try {
88 const clientState = getClientState(serverId);
89 if (clientState) {
90 await clientState.dispose();
91 }
92
93 const { stopManagedServer } = await import("cm/lsp/serverLauncher");
94 stopManagedServer(serverId);
95
96 window.editorManager?.restartLsp?.();
97
98 addLspLog(serverId, "info", "Server restarted successfully");
99 toast("Server restarted");
100 } catch (err) {
101 addLspLog(serverId, "error", `Restart failed: ${err.message}`);
102 toast("Restart failed");
103 }
104}
105
106async function stopServer(serverId) {
107 addLspLog(serverId, "info", "Stop requested by user");

Callers

nothing calls this directly

Calls 4

addLspLogFunction · 0.90
getClientStateFunction · 0.85
stopManagedServerFunction · 0.85
disposeMethod · 0.45

Tested by

no test coverage detected