detectFromLSPServers adds runtime requirements for the runtimes needed by configured LSP servers. Each entry in lspInstallSpecs declares the runtime ID it needs (e.g. "go" for gopls, "ruby" for solargraph, "node" for npm-based servers). Feeding these through the runtime manager ensures that the runt
(lsp map[string]LSPServerConfig, requirements map[string]*RuntimeRequirement)
| 249 | // SHA-pinned setup action (e.g. actions/setup-go, ruby/setup-ruby) and with a pinned |
| 250 | // version, rather than relying on whatever happens to be pre-installed on the runner. |
| 251 | func detectFromLSPServers(lsp map[string]LSPServerConfig, requirements map[string]*RuntimeRequirement) { |
| 252 | if len(lsp) == 0 { |
| 253 | return |
| 254 | } |
| 255 | manager := NewLSPManager(lsp) |
| 256 | for _, req := range manager.RuntimeRequirements() { |
| 257 | runtimeSetupLog.Printf("LSP server requires runtime: %s", req.Runtime.ID) |
| 258 | updateRequiredRuntime(req.Runtime, req.Version, requirements) |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | // updateRequiredRuntime updates the version requirement, choosing the highest version |
| 263 | func updateRequiredRuntime(runtime *Runtime, newVersion string, requirements map[string]*RuntimeRequirement) { |
no test coverage detected