(
method: string,
params: unknown,
)
| 287 | }, |
| 288 | |
| 289 | async sendRequest<TResult>( |
| 290 | method: string, |
| 291 | params: unknown, |
| 292 | ): Promise<TResult> { |
| 293 | if (!connection) { |
| 294 | throw new Error('LSP client not started') |
| 295 | } |
| 296 | |
| 297 | checkStartFailed() |
| 298 | |
| 299 | if (!isInitialized) { |
| 300 | throw new Error('LSP server not initialized') |
| 301 | } |
| 302 | |
| 303 | try { |
| 304 | return await connection.sendRequest(method, params) |
| 305 | } catch (error) { |
| 306 | const err = error as Error |
| 307 | logError( |
| 308 | new Error( |
| 309 | `LSP server ${serverName} request ${method} failed: ${err.message}`, |
| 310 | ), |
| 311 | ) |
| 312 | throw error |
| 313 | } |
| 314 | }, |
| 315 | |
| 316 | async sendNotification(method: string, params: unknown): Promise<void> { |
| 317 | if (!connection) { |
nothing calls this directly
no test coverage detected