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

Method get_formatters

crates/opencode-tui/src/api.rs:605–615  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

603 }
604
605 pub fn get_formatters(&self) -> anyhow::Result<Vec<String>> {
606 let url = format!("{}/formatter", self.base_url);
607 let response = self.client.get(&url).send()?;
608 if !response.status().is_success() {
609 let status = response.status();
610 let text = response.text().unwrap_or_default();
611 anyhow::bail!("Failed to get formatter status: {} - {}", status, text);
612 }
613 let status = response.json::<FormatterStatusResponse>()?;
614 Ok(status.formatters)
615 }
616
617 pub fn share_session(&self, session_id: &str) -> anyhow::Result<ShareResponse> {
618 let url = format!("{}/session/{}/share", self.base_url, session_id);

Callers 1

refresh_status_dialogMethod · 0.80

Calls 4

sendMethod · 0.45
getMethod · 0.45
statusMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected