(method: string, params: unknown)
| 240 | } |
| 241 | |
| 242 | #sendNotification(method: string, params: unknown): void { |
| 243 | // Access the client's transport to send raw JSON-RPC notification |
| 244 | const client = this.client as unknown as { |
| 245 | connected: boolean; |
| 246 | transport?: { send: (message: string) => void }; |
| 247 | }; |
| 248 | |
| 249 | if (!client.connected || !client.transport) { |
| 250 | this.#log("warn", "Workspace cannot send notification: not connected"); |
| 251 | console.warn(`[LSP:Workspace] Cannot send notification: not connected`); |
| 252 | return; |
| 253 | } |
| 254 | |
| 255 | const message = JSON.stringify({ |
| 256 | jsonrpc: "2.0", |
| 257 | method, |
| 258 | params, |
| 259 | }); |
| 260 | |
| 261 | client.transport.send(message); |
| 262 | } |
| 263 | |
| 264 | hasWorkspaceFolder(uri: string): boolean { |
| 265 | return this.#workspaceFolders.has(uri); |
no test coverage detected