RuntimeRequirements returns the set of runtime requirements for all configured LSP servers. These are returned as [RuntimeRequirement] values so that the caller can feed them into the standard runtime manager (DetectRuntimeRequirements / GenerateRuntimeSetupSteps), which emits properly SHA-pinned se
()
| 219 | // DetectRuntimeRequirements deduplicates by runtime ID, so at most one Node.js setup |
| 220 | // step is emitted regardless of how many node-based LSP servers are configured. |
| 221 | func (m *LSPManager) RuntimeRequirements() []RuntimeRequirement { |
| 222 | if !m.HasServers() { |
| 223 | return nil |
| 224 | } |
| 225 | |
| 226 | seen := make(map[string]bool) |
| 227 | var result []RuntimeRequirement |
| 228 | |
| 229 | langs := make([]string, 0, len(m.servers)) |
| 230 | for language := range m.servers { |
| 231 | langs = append(langs, language) |
| 232 | } |
| 233 | sort.Strings(langs) |
| 234 | |
| 235 | for _, language := range langs { |
| 236 | spec, ok := lspInstallSpecs[language] |
| 237 | if !ok || spec.RuntimeID == "" { |
| 238 | continue |
| 239 | } |
| 240 | if seen[spec.RuntimeID] { |
| 241 | continue |
| 242 | } |
| 243 | seen[spec.RuntimeID] = true |
| 244 | runtime := findRuntimeByID(spec.RuntimeID) |
| 245 | if runtime == nil { |
| 246 | lspManagerLog.Printf("LSP language %q specifies unknown runtime ID %q; skipping runtime requirement", language, spec.RuntimeID) |
| 247 | continue |
| 248 | } |
| 249 | result = append(result, RuntimeRequirement{ |
| 250 | Runtime: runtime, |
| 251 | Version: "", |
| 252 | Cooldown: true, |
| 253 | }) |
| 254 | } |
| 255 | return result |
| 256 | } |
| 257 | |
| 258 | type lspInstallSpec struct { |
| 259 | StepName string |