MCPcopy Create free account
hub / github.com/GCWing/BitFun / format_document

Method format_document

src/crates/services/services-core/src/lsp/manager.rs:501–523  ·  view source on GitHub ↗

Formats a document.

(
        &self,
        language: &str,
        uri: &str,
        tab_size: u32,
        insert_spaces: bool,
    )

Source from the content-addressed store, hash-verified

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(

Callers 2

lsp_format_documentFunction · 0.45

Calls 2

get_processMethod · 0.45
send_requestMethod · 0.45

Tested by

no test coverage detected