Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String-output #36

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ https://user-images.githubusercontent.com/29210090/145628508-0a793f71-dc62-4b4c-

https://user-images.githubusercontent.com/29210090/145628481-97b2d6ee-9ef6-4a72-82f5-2e488cf2e6cd.mp4

The new commands `jsonnet: Evaluate File (String)` and `jsonnet: Evaluate Expression (String)` interpret
the result as a JSON string, or an array which is recursively flattened to a string. (This can be useful
to examine intermediate results).

The non-JSON output formats check the first line for a string of the form `Output: <name.ext>`. Only the
file extension is used, to construct the name of the preview buffer, `result.<ext>`. This allows proper
syntax highlighting of the result file. For example, a script to produce a shell script might begin:

```jsonnet
// Output: .sh
```

and syntax highlighting for `.sh` files will be enabled.

## To use this

1. Install the extension from [the VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=Grafana.vscode-jsonnet) or [Open VSX](https://open-vsx.org/extension/Grafana/vscode-jsonnet)
Expand Down
Loading