Summary
v0.17.0 and current main pin github.com/google/go-jsonnet v0.21.0, which panics during static analysis on any file containing super[e] where e is not a plain variable reference. DidOpen/DidChange call jsonnet.SnippetToAST directly, so the panic kills the process. The client restarts the server, re-opens the same document, and it panics again — an unrecoverable crash loop that disables Jsonnet support for the whole workspace while such a file exists in it.
Reproducer
local f = { key: 'a' };
{ a: 1 } + { a: super[f.key] }
Opening this with vscode-jsonnet 0.7.4 kills the server on didOpen:
panic: Unexpected node <nil>
...
github.com/google/go-jsonnet/internal/program.analyzeVisit(...)
go-jsonnet@v0.21.0/internal/program/static_analyzer.go:155
...
github.com/grafana/jsonnet-language-server/pkg/server.(*Server).DidOpen(...)
pkg/server/server.go:117
Root cause
In go-jsonnet v0.21.0 the desugarer's *ast.SuperIndex case never recurses into node.Index, so a computed index survives desugaring as a raw ast.Index with Id set and Index == nil. The static analyzer then reaches case *ast.Index -> visitNext(a.Index, ...) (static_analyzer.go:106) with that nil and falls through to default: panic(...) on line 155.
Fix
Fixed upstream in google/go-jsonnet#849 (commit google/go-jsonnet@fb23cdf), closing google/go-jsonnet#679, released in go-jsonnet v0.22.0 on 2026-03-24.
The bump is clean
Verified on tag v0.17.0 with go mod edit -require=github.com/google/go-jsonnet@v0.22.0 && go mod tidy:
- Compiles with no source changes;
go test ./... fully passes.
- go.mod side effects are only the
go directive moving to 1.24.5 (go-jsonnet v0.22.0 requires Go 1.24, which this repo already targets) and three transitive golang.org/x/* bumps.
- Verified end to end by driving both builds over stdio with
initialize + didOpen of a file containing super[e]: the v0.21.0 build exits 2 with the panic above, the v0.22.0 build stays alive.
Prior attempt
Renovate already opened #258 for this bump and it was autoclosed. The only failure reported there was a transient go mod tidy TLS timeout fetching the Go toolchain, not an incompatibility. That thread also has a user asking for v0.22.0 for the new numeric-underscore literals (1_500_000), which v0.21.0 rejects.
Summary
v0.17.0and currentmainpingithub.com/google/go-jsonnet v0.21.0, which panics during static analysis on any file containingsuper[e]whereeis not a plain variable reference.DidOpen/DidChangecalljsonnet.SnippetToASTdirectly, so the panic kills the process. The client restarts the server, re-opens the same document, and it panics again — an unrecoverable crash loop that disables Jsonnet support for the whole workspace while such a file exists in it.Reproducer
Opening this with vscode-jsonnet 0.7.4 kills the server on
didOpen:Root cause
In go-jsonnet v0.21.0 the desugarer's
*ast.SuperIndexcase never recurses intonode.Index, so a computed index survives desugaring as a rawast.IndexwithIdset andIndex == nil. The static analyzer then reachescase *ast.Index->visitNext(a.Index, ...)(static_analyzer.go:106) with that nil and falls through todefault: panic(...)on line 155.Fix
Fixed upstream in google/go-jsonnet#849 (commit google/go-jsonnet@fb23cdf), closing google/go-jsonnet#679, released in go-jsonnet v0.22.0 on 2026-03-24.
The bump is clean
Verified on tag
v0.17.0withgo mod edit -require=github.com/google/go-jsonnet@v0.22.0 && go mod tidy:go test ./...fully passes.godirective moving to 1.24.5 (go-jsonnet v0.22.0 requires Go 1.24, which this repo already targets) and three transitivegolang.org/x/*bumps.initialize+didOpenof a file containingsuper[e]: the v0.21.0 build exits 2 with the panic above, the v0.22.0 build stays alive.Prior attempt
Renovate already opened #258 for this bump and it was autoclosed. The only failure reported there was a transient
go mod tidyTLS timeout fetching the Go toolchain, not an incompatibility. That thread also has a user asking for v0.22.0 for the new numeric-underscore literals (1_500_000), which v0.21.0 rejects.