You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Grafana Jsonnet formatter in VS Code incorrectly rewrites syntactically valid object merging (+) inside a list comprehension. It replaces an object concatenation operation with an explicit key-value pair, which is a destructive change that alters the code's meaning and assumptions about the data structure.
Steps to Reproduce:
VSCode plugin grafana.vscode-jsonnet 0.7.2
Use the VS Code command "Format Document" (or allow formatting on save).
env: [{ name: e.key } + e.value for e in std.objectKeysValues(env_)]
Actual Behavior
The formatter aggressively rewrites the line, changing the logic from object merging to direct key assignment. The code is incorrectly changed to:
env: [ { name: e.key, value: e.value } for e in std.objectKeysValues(env_) ]