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

Formatter should not squash multiline string values #987

Open
2 of 4 tasks
tidux opened this issue Nov 27, 2023 · 2 comments
Open
2 of 4 tasks

Formatter should not squash multiline string values #987

tidux opened this issue Nov 27, 2023 · 2 comments

Comments

@tidux
Copy link

tidux commented Nov 27, 2023

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

  1. Create the following YAML file in VSCode:
apiVersion: v1
kind: ConfigMap
metadata:
  name: foo
  namespace: bar
data:
  baz.ini: |+
    "[section1]
    a = b
    x = y
    [section2]
    foo=bar"
  1. Save the file.

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)
@asmirnoff
Copy link

Any eta on this one, very annoying

@EronWright
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants