(&self, method: &str, params: Value)
| 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(¬ification)?; |
| 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, |
no outgoing calls
no test coverage detected