DiagnosticRunner
🛈 DocStrings¶
Run diagnostics using CLI tools.
Works with any command executor (local subprocess, Docker, SSH, etc.) to run CLI diagnostic tools and parse their output.
Source code in src/anyenv/lsp_servers/_runner.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
__init__
¶
__init__(executor: CommandExecutor | None = None) -> None
Initialize with an optional command executor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
executor
|
CommandExecutor | None
|
Callable to execute commands. Defaults to local subprocess. |
None
|
Source code in src/anyenv/lsp_servers/_runner.py
get_server
¶
get_server(server_id: str) -> LSPServerInfo | None
get_servers_for_file
¶
get_servers_for_file(path: str) -> list[LSPServerInfo]
Get all servers that can handle a file.
register
¶
register(server: LSPServerInfo) -> None
register_defaults
¶
Register all default servers with CLI diagnostic support.
Source code in src/anyenv/lsp_servers/_runner.py
run
async
¶
run(server: LSPServerInfo | str, files: list[str]) -> DiagnosticsResult
Run diagnostics using a specific server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server
|
LSPServerInfo | str
|
Server instance or server ID |
required |
files
|
list[str]
|
File paths to check |
required |
Returns:
| Type | Description |
|---|---|
DiagnosticsResult
|
DiagnosticsResult with parsed diagnostics |
Source code in src/anyenv/lsp_servers/_runner.py
run_all
async
¶
run_all(files: list[str], *, concurrency: int = 1) -> dict[str, DiagnosticsResult]
Run all applicable servers on the given files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
list[str]
|
File paths to check |
required |
concurrency
|
int
|
How many servers may run at once. The default runs them one after another (safe for remote executors and slow machines). |
1
|
Returns:
| Type | Description |
|---|---|
dict[str, DiagnosticsResult]
|
Dict mapping server ID to DiagnosticsResult, in registration order |
Source code in src/anyenv/lsp_servers/_runner.py
run_for_file
async
¶
run_for_file(path: str) -> list[Diagnostic]
Run all applicable servers on a single file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
File path to check |
required |
Returns:
| Type | Description |
|---|---|
list[Diagnostic]
|
Combined list of diagnostics from all applicable servers |