Open tidux opened 9 months ago
Any eta on this one, very annoying
A workaround is to select "Format Document With..." on the context menu, and choose "YAML" rather than "Kubernetes YAML". Seems it is the latter extension that's responsible for this problem.
Thats not a workaround. Its the fix. The "kennylong.io" "kubernetes yaml formatter" overrides the RedHat formatter and unwraps multiline strings. Uninstall it and everything starts working.
Pasting this here to improve discoverability of this issue: "#magic_^^line"
It looks like the issue causing this issue is the above extension (which uses https://github.com/google/yamlfmt underneath the hood) and also if there is a trailing space at the end of a multiline yaml string
Describe the bug
I'm attempting to embed a 50+ line INI file in a ConfigMap as a string. Whenever I save the file that section loses all of its formatting and it gets squashed into a single line sprinkled with literal \n and "magic line" comment blocks. This makes the embedded INI file unreadable for editing the configuration values so I have to go in and manually find-replace the formatting back how it was and re-indent the block.
Expected Behavior
Format-on-save should not mangle multiline strings. Newlines exist for a reason.
Current Behavior
Format-on-save mangles my strings.
Steps to Reproduce
Environment