Formats a document.
(
&self,
language: &str,
uri: &str,
tab_size: u32,
insert_spaces: bool,
)
| 499 | |
| 500 | /// Formats a document. |
| 501 | pub async fn format_document( |
| 502 | &self, |
| 503 | language: &str, |
| 504 | uri: &str, |
| 505 | tab_size: u32, |
| 506 | insert_spaces: bool, |
| 507 | ) -> Result<serde_json::Value> { |
| 508 | let process = self.get_process(language).await?; |
| 509 | |
| 510 | let params = serde_json::json!({ |
| 511 | "textDocument": { |
| 512 | "uri": uri |
| 513 | }, |
| 514 | "options": { |
| 515 | "tabSize": tab_size, |
| 516 | "insertSpaces": insert_spaces |
| 517 | } |
| 518 | }); |
| 519 | |
| 520 | process |
| 521 | .send_request("textDocument/formatting", Some(params)) |
| 522 | .await |
| 523 | } |
| 524 | |
| 525 | /// Gets inlay hints. |
| 526 | pub async fn get_inlay_hints( |
no test coverage detected