vscode-jsonnet
vscode-jsonnet copied to clipboard
String-output
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.
I'll test it out! 👁️ 👁️