This VSCode extension enhances YAML file formatting by:
- Inheriting the default YAML formatter rules.
- Automatically formatting YAML values that are valid JSON strings.
Features
- Formats YAML using VSCode's default YAML formatter.
- Detects and reformats JSON strings in YAML to a pretty-printed JSON format.
Usage
- Open a YAML file.
- Use the Format Document command (
Shift+Alt+F or right-click and select "Format Document").
- JSON strings within the YAML will be reformatted automatically.
Example
Before formatting:
key: { "name": "John", "age": 30, "city": "New York" }
After formatting:
key:
{
"name": "John",
"age": 30,
"city": "New York"
}
| |