( server: LspServerDefinition, )
| 566 | } |
| 567 | |
| 568 | async function readServerVersion( |
| 569 | server: LspServerDefinition, |
| 570 | ): Promise<string | null> { |
| 571 | const command = server.launcher?.versionCommand; |
| 572 | if (!command) return null; |
| 573 | |
| 574 | try { |
| 575 | const output = await runQuickCommand(command); |
| 576 | const version = String(output || "") |
| 577 | .split("\n") |
| 578 | .map((line) => line.trim()) |
| 579 | .find(Boolean); |
| 580 | return version || null; |
| 581 | } catch { |
| 582 | return null; |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | export function getInstallCommand( |
| 587 | server: LspServerDefinition, |
no test coverage detected