MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / #sendNotification

Method #sendNotification

src/cm/lsp/workspace.ts:242–262  ·  view source on GitHub ↗
(method: string, params: unknown)

Source from the content-addressed store, hash-verified

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);

Callers 2

addWorkspaceFolderMethod · 0.95
removeWorkspaceFolderMethod · 0.95

Calls 2

#logMethod · 0.95
sendMethod · 0.65

Tested by

no test coverage detected