Open tabish-javed opened 8 months ago
This is a compatible issue with the YAML extension. We have default formatting set up in our extension, and we do not want to rely on the YAML extension to do it.
Having said that, you can always set up a default extension for ansible
language and point it to the YAML extension
or prettier.
prettier
seems to work well with the ansible
language. If the YAML extension is not formatting it, you might have to raise an issue with their extension to support formatting for ansible
language.
Here's how you can set up the formator. Add these to your settings configuration:
"[ansible]": {
"editor.autoIndent": "advanced",
"editor.defaultFormatter": "redhat.vscode-yaml",
"editor.formatOnSave": true
}
@priyamsahoo - Thanks for the note!
"editor.defaultFormatter": "redhat.vscode-yaml"
in yellow and say, Value is not accepted. Thanks!
Problem
No formatter support on ansible playbooks in VS-Code.
Solution
Add formatter support to ansible's extension.
Alternatives
Tweak ansible extension to use YAML extension as default formatter.
Additional context
No response