MCPcopy Create free account
hub / github.com/github/gh-aw / detectFromLSPServers

Function detectFromLSPServers

pkg/workflow/runtime_detection.go:251–260  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
251func 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
263func updateRequiredRuntime(runtime *Runtime, newVersion string, requirements map[string]*RuntimeRequirement) {

Callers 1

Calls 4

RuntimeRequirementsMethod · 0.95
NewLSPManagerFunction · 0.85
updateRequiredRuntimeFunction · 0.85
PrintfMethod · 0.45

Tested by

no test coverage detected