LSPServerInfo
Sub classes¶
| Name | Children | Inherits |
|---|---|---|
| TypeScriptServer anyenv.lsp_servers._servers.js_ts_lsps TypeScript language server with tsserver path detection. |
||
| AstroServer anyenv.lsp_servers._servers.js_ts_lsps Astro language server with TypeScript SDK detection. |
||
| OxlintServer anyenv.lsp_servers._servers.js_ts_lsps Oxlint (oxc) linter with JSON diagnostic parsing. |
||
| BiomeServer anyenv.lsp_servers._servers.js_ts_lsps Biome linter/formatter with JSON diagnostic parsing. |
||
| PyrightServer anyenv.lsp_servers._servers.python_lsps Pyright with virtualenv detection and JSON diagnostic parsing. |
||
| ZubanServer anyenv.lsp_servers._servers.python_lsps Zuban type checker with mypy-compatible text output parsing. |
||
| TyServer anyenv.lsp_servers._servers.python_lsps Ty (Astral) type checker with GitLab JSON diagnostic parsing. |
||
| PyreflyServer anyenv.lsp_servers._servers.python_lsps Pyrefly (Meta) type checker with JSON diagnostic parsing. |
||
| MypyServer anyenv.lsp_servers._servers.python_lsps Mypy with JSON diagnostic parsing. |
||
| RustAnalyzerServer anyenv.lsp_servers._servers.rust_lsps Rust analyzer with workspace detection. |
||
| GoplsServer anyenv.lsp_servers._servers.go_lsps Go language server with go.work priority. |
🛈 DocStrings¶
Static configuration for an LSP server.
Subclass and override resolve_root and/or resolve_initialization for
servers that need custom behavior beyond the declarative configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
Unique identifier for this server |
required |
extensions
|
list[str]
|
File extensions this server handles (e.g., [".py", ".pyi"]) |
required |
root_detection
|
RootDetection
|
Configuration for finding project root |
required |
command
|
str
|
Primary command to run the server |
required |
args
|
list[str]
|
Additional command-line arguments |
list()
|
npm_install
|
NpmInstall | None
|
npm installation config |
None
|
go_install
|
GoInstall | None
|
Go installation config |
None
|
cargo_install
|
CargoInstall | None
|
Cargo installation config |
None
|
dotnet_install
|
DotnetInstall | None
|
.NET tool installation config |
None
|
gem_install
|
GemInstall | None
|
Ruby gem installation config |
None
|
github_release
|
GitHubRelease | None
|
GitHub release download config |
None
|
initialization
|
dict[str, Any]
|
LSP initialization options sent to server |
dict()
|
env
|
dict[str, str]
|
Environment variables for the server process |
dict()
|
global_server
|
bool
|
If True, use single global instance instead of per-project |
False
|
cli_diagnostics
|
CLIDiagnosticConfig | None
|
CLI fallback for diagnostics |
None
|
Source code in src/anyenv/lsp_servers/_base.py
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 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | |
has_cli_diagnostics
property
¶
Check if this server supports CLI diagnostics.
build_diagnostic_command
¶
Build the CLI command for running diagnostics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
list[str]
|
List of file paths to check |
required |
Returns:
| Type | Description |
|---|---|
str
|
The command string to execute |
Source code in src/anyenv/lsp_servers/_base.py
can_handle
¶
Check if this server handles the given file extension.
get_env
¶
Get environment variables, merged with optional base environment.
Source code in src/anyenv/lsp_servers/_base.py
get_full_command
¶
parse_diagnostics
¶
parse_diagnostics(stdout: str, stderr: str) -> list[Diagnostic]
Parse CLI output into diagnostics.
Override for custom output formats. Default handles common JSON formats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stdout
|
str
|
Standard output from the command |
required |
stderr
|
str
|
Standard error from the command |
required |
Source code in src/anyenv/lsp_servers/_base.py
resolve_env
async
¶
Resolve environment variables for the server process.
Default implementation returns the static env dict.
Override for dynamic behavior.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str
|
The resolved LSP root directory |
required |
fs
|
AsyncFileSystem
|
Filesystem to use for file operations |
required |
Source code in src/anyenv/lsp_servers/_base.py
resolve_initialization
async
¶
Resolve dynamic LSP initialization options.
Default implementation returns the static initialization dict.
Override for dynamic behavior (e.g., detecting virtualenv, tsdk path).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str
|
The resolved LSP root directory |
required |
fs
|
AsyncFileSystem
|
Filesystem to use for file operations |
required |
Source code in src/anyenv/lsp_servers/_base.py
resolve_root
async
¶
Resolve the LSP root directory for a given file.
Default implementation searches upward from file_path for include_patterns, respecting exclude_patterns. Override for custom behavior (e.g., workspace detection).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The file being edited |
required |
project_root
|
str
|
The overall project/workspace root (stop boundary) |
required |
fs
|
AsyncFileSystem
|
Filesystem to use for file operations |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The resolved root directory, or None if this LSP shouldn't be used |