MCPcopy Create free account
hub / github.com/codeaashu/claude-code / sendRequest

Function sendRequest

src/services/lsp/LSPServerManager.ts:244–263  ·  view source on GitHub ↗

* Send a request to the appropriate LSP server for the given file. * Returns undefined if no server handles this file type. * * @throws {Error} If server fails to start or request fails

(
    filePath: string,
    method: string,
    params: unknown,
  )

Source from the content-addressed store, hash-verified

242 * @throws {Error} If server fails to start or request fails
243 */
244 async function sendRequest<T>(
245 filePath: string,
246 method: string,
247 params: unknown,
248 ): Promise<T | undefined> {
249 const server = await ensureServerStarted(filePath)
250 if (!server) return undefined
251
252 try {
253 return await server.sendRequest<T>(method, params)
254 } catch (error) {
255 const err = error as Error
256 logError(
257 new Error(
258 `LSP request failed for file ${filePath}, method '${method}': ${err.message}`,
259 ),
260 )
261 throw error
262 }
263 }
264
265 // Return public interface
266 function getAllServers(): Map<string, LSPServerInstance> {

Callers

nothing calls this directly

Calls 2

ensureServerStartedFunction · 0.85
logErrorFunction · 0.50

Tested by

no test coverage detected