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

Question: how to apply it to helm-template files? #8

Closed
RafalSkolasinski opened this issue Feb 18, 2023 · 3 comments
Closed

Question: how to apply it to helm-template files? #8

RafalSkolasinski opened this issue Feb 18, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request question Further information is requested
Milestone

Comments

@RafalSkolasinski
Copy link

This is great, finally sane indent for list in Kubernetes / Ansible yaml files.
Just a question - how can I make it also work if file is recognized as helm-template?

I tried to set

    "[helm-template]": {
        "editor.defaultFormatter": "kennylong.kubernetes-yaml-formatter"
    },

but VS Code still complains that "There is no formatter for 'helm' files installed.".

@pie-r
Copy link

pie-r commented Feb 22, 2023

I did it in this way:

  "[yaml]": {
    "editor.defaultFormatter": "kennylong.kubernetes-yaml-formatter",
    "editor.formatOnSave": true
  },
  "files.associations": {
    "*.yml": "yaml",
    "*.yaml": "yaml"
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode",

@longkai
Copy link
Owner

longkai commented Sep 21, 2024

Hi!

Sorry for the delay.

I use helm very often. But since helm is not really yaml but a template-engine we cannot format the mixed two directly.

However, for the template part you can use builtin function like indentn.

for the yaml part, the new v2 version has implemented a range format, so just select range code and the extension will format those region.

@longkai longkai self-assigned this Sep 21, 2024
@longkai longkai added the bug Something isn't working label Sep 21, 2024
@longkai longkai added this to the v2 milestone Sep 21, 2024
@longkai
Copy link
Owner

longkai commented Oct 26, 2024

You can config with(which is the default value):

"[helm]": {
  "editor.defaultFormatter": "kennylong.kubernetes-yaml-formatter",
  "editor.formatOnSave": false
},
"[ansible]": {
  "editor.defaultFormatter": "kennylong.kubernetes-yaml-formatter",
  "editor.formatOnSave": false
}

@longkai longkai added enhancement New feature or request question Further information is requested and removed bug Something isn't working labels Oct 26, 2024
@longkai longkai closed this as completed in d0a518e Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants