MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / run_tool

Function run_tool

src/formatting.rs:298–310  ·  view source on GitHub ↗

Run a single tool on the content and return the formatted string.

(
    tool: &ResolvedTool,
    content: &str,
    file_path: &Path,
    timeout: Duration,
)

Source from the content-addressed store, hash-verified

296
297/// Run a single tool on the content and return the formatted string.
298fn run_tool(
299 tool: &ResolvedTool,
300 content: &str,
301 file_path: &Path,
302 timeout: Duration,
303) -> Result<String, String> {
304 match tool.name {
305 "php-cs-fixer" => run_php_cs_fixer(&tool.path, content, file_path, timeout),
306 "phpcbf" => run_phpcbf(&tool.path, content, file_path, timeout),
307 "pint" => run_pint(&tool.path, content, file_path, timeout),
308 _ => Err(format!("Unknown formatting tool: {}", tool.name)),
309 }
310}
311
312/// Run php-cs-fixer on a sibling temp file and return the formatted content.
313///

Callers 1

run_external_pipelineFunction · 0.85

Calls 3

run_php_cs_fixerFunction · 0.85
run_phpcbfFunction · 0.85
run_pintFunction · 0.85

Tested by

no test coverage detected