jsonnet-language-server icon indicating copy to clipboard operation
jsonnet-language-server copied to clipboard

Lint alway warning when use std.get

Open Dreamacro opened this issue 3 years ago • 1 comments

When I use std.get, LSP get two warning from lint

local getValue(obj, key) = std.get(obj, key, null);

it always reports Indexed object has no field "get" and Called value must be a function, but it is assumed to be void

Dreamacro avatar Sep 09 '22 08:09 Dreamacro

Yeah, unfortunately this is the same issue as https://github.com/grafana/tanka/issues/744 The get function is new-ish and it's missing from the linter map: https://github.com/google/go-jsonnet/blob/master/linter/internal/types/stdlib.go#L22-L172

julienduchesne avatar Sep 12 '22 11:09 julienduchesne

This is fixed in the latest release with the update to go-jsonnet 0.19.1

julienduchesne avatar Dec 19 '22 14:12 julienduchesne