MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / notify

Method notify

crates/opencode-lsp/src/lib.rs:302–317  ·  view source on GitHub ↗
(&self, method: &str, params: Value)

Source from the content-addressed store, hash-verified

300 }
301
302 pub async fn notify(&self, method: &str, params: Value) -> Result<(), LspError> {
303 let notification = JsonRpcNotification {
304 jsonrpc: "2.0".to_string(),
305 method: method.to_string(),
306 params: if params.is_null() { None } else { Some(params) },
307 };
308
309 let content = serde_json::to_string(&notification)?;
310 let message = format!("Content-Length: {}\r\n\r\n{}", content.len(), content);
311
312 let mut stdin = self.stdin.lock().await;
313 stdin.write_all(message.as_bytes()).await?;
314 stdin.flush().await?;
315
316 Ok(())
317 }
318
319 pub async fn open_document(
320 &self,

Callers 2

initializeMethod · 0.80
open_documentMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected