MCPcopy Index your code
hub / github.com/codeaashu/claude-code / sendNotification

Function sendNotification

src/services/lsp/LSPServerInstance.ts:416–437  ·  view source on GitHub ↗

* Send a notification to the LSP server (fire-and-forget). * Used for file synchronization (didOpen, didChange, didClose).

(
    method: string,
    params: unknown,
  )

Source from the content-addressed store, hash-verified

414 * Used for file synchronization (didOpen, didChange, didClose).
415 */
416 async function sendNotification(
417 method: string,
418 params: unknown,
419 ): Promise<void> {
420 if (!isHealthy()) {
421 const error = new Error(
422 `Cannot send notification to LSP server '${name}': server is ${state}`,
423 )
424 logError(error)
425 throw error
426 }
427
428 try {
429 await client.sendNotification(method, params)
430 } catch (error) {
431 const notificationError = new Error(
432 `LSP notification '${method}' failed for server '${name}': ${errorMessage(error)}`,
433 )
434 logError(notificationError)
435 throw notificationError
436 }
437 }
438
439 /**
440 * Registers a handler for LSP notifications from the server.

Callers

nothing calls this directly

Calls 3

isHealthyFunction · 0.85
logErrorFunction · 0.50
errorMessageFunction · 0.50

Tested by

no test coverage detected