MCPcopy
hub / github.com/claude-code-best/claude-code / stop

Function stop

src/services/lsp/LSPServerInstance.ts:274–290  ·  view source on GitHub ↗

* Stops the LSP server gracefully. * * If already stopped or stopping, returns immediately. * On failure, sets state to 'error', logs for monitoring, and throws. * * @throws {Error} If server fails to stop

()

Source from the content-addressed store, hash-verified

272 * @throws {Error} If server fails to stop
273 */
274 async function stop(): Promise<void> {
275 if (state === 'stopped' || state === 'stopping') {
276 return
277 }
278
279 try {
280 state = 'stopping'
281 await client.stop()
282 state = 'stopped'
283 logForDebugging(`LSP server instance stopped: ${name}`)
284 } catch (error) {
285 state = 'error'
286 lastError = error as Error
287 logError(error)
288 throw error
289 }
290 }
291
292 /**
293 * Manually restarts the server by stopping and starting it.

Callers 1

restartFunction · 0.70

Calls 3

stopMethod · 0.65
logForDebuggingFunction · 0.50
logErrorFunction · 0.50

Tested by

no test coverage detected