php_lsp/analysis/external/
mod.rs1#[cfg(not(target_family = "wasm"))]
8pub mod phpcs;
9#[cfg(not(target_family = "wasm"))]
10pub mod phpstan;
11
12#[cfg(not(target_family = "wasm"))]
13use std::path::Path;
14
15#[cfg(not(target_family = "wasm"))]
16use tower_lsp_server::ls_types::Diagnostic;
17
18#[cfg(not(target_family = "wasm"))]
19use crate::lang::config::ExternalToolsConfig;
20
21#[cfg(not(target_family = "wasm"))]
26pub async fn run_external_diagnostics(
27 cfg: &ExternalToolsConfig,
28 path: &Path,
29 workspace_root: Option<&Path>,
30) -> Vec<Diagnostic> {
31 let mut out = Vec::new();
32 if cfg.phpstan.enabled {
33 out.extend(phpstan::run(&cfg.phpstan, path, workspace_root).await);
34 }
35 if cfg.phpcs.enabled {
36 out.extend(phpcs::run(&cfg.phpcs, path, workspace_root).await);
37 }
38 out
39}