grafana / vscode-jsonnet

Full code support (formatting, highlighting, navigation, etc) for Jsonnet
Apache License 2.0
70 stars 9 forks source link

How does formatting works? #8

Closed darox closed 2 years ago

darox commented 2 years ago

How can the formatting feature be triggered? It seems not working in my case. Linting and error indication are working. Thank you!

leejones commented 2 years ago

I had the same question and discovered 2 ways to run the formatter:

On demand: Go to View -> Command Palette. Type Format to limit results. Click Format Document:

Screen Shot 2022-05-11 at 4 21 00 PM

Automatically on save: Go to the global settings for VS Code and search for Format. Enable Editor: Format On Save:

Screen Shot 2022-05-11 at 4 22 18 PM
darox commented 2 years ago

@leejones Wow, thank you!