vscode-jsonnet icon indicating copy to clipboard operation
vscode-jsonnet copied to clipboard

String-output

Open BobKerns opened this issue 1 year ago • 2 comments

In using the plugin to generate non-JSON/YAML files, I found it frustrating to only be able to see the output as a single JSON string.

This PR adds two new commands, and one related feature.

  • Jsonnet: Evaluate Expression (String)
  • Jsonnet: Evaluate File (String)
  • If the first line contains "Output: [name].", is used as the extension for the preview file. This enables syntax highlighting in the target language, if applicable.

I was unable to test the "Evaluate Expression (String)" variant, because I was unable to find an incantation for "Evaluate Expression" that did not give an error, for example, rejecting any simple input with a demand for an identifier. I don't know if this is an LSP bug or my misunderstanding, but Expression works the same as File so I believe my addition to be correct.

BobKerns avatar Dec 20 '23 00:12 BobKerns

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 20 '23 00:12 CLAassistant

I'll test it out! 👁️ 👁️

julienduchesne avatar Dec 21 '23 13:12 julienduchesne