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

Yaml Syntax Highlighting not working for Helm templates #8487

Open
1 task done
0xDones opened this issue Feb 27, 2024 · 8 comments
Open
1 task done

Yaml Syntax Highlighting not working for Helm templates #8487

0xDones opened this issue Feb 27, 2024 · 8 comments
Labels
defect [core label] language An umbrella label for all programming languages syntax behaviors yaml YAML data format support

Comments

@0xDones
Copy link

0xDones commented Feb 27, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Helm/go templates break the yaml syntax highlighting feature as you can see in the screenshot below.

Environment

Zed: v0.123.6 (Zed)
OS: macOS 14.3.1
Memory: 16 GiB
Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

image

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

No response

@0xDones 0xDones added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Feb 27, 2024
@TerminalFi
Copy link

This is a issue known issue ikatyang/tree-sitter-yaml#36

You can enclose the template syntax in single quotes as a workaround

@0xDones
Copy link
Author

0xDones commented Feb 27, 2024

I understand, but it doesn't make sense all the time to enclose the template with quotes, for example:

{{- if .Values.serviceMonitorEnabled }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
...
{{- end }}

On VSCode it works as expected:
image

@JosephTLyons JosephTLyons added language An umbrella label for all programming languages syntax behaviors yaml YAML data format support and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Feb 27, 2024
@yasithab
Copy link

yasithab commented Mar 9, 2024

I want this new feature too. It would be greatly appreciated if you could prioritize its implementation in upcoming releases 👍

@Moshyfawn
Copy link
Member

I want this new feature too. It would be greatly appreciated if you could prioritize its implementation in upcoming releases 👍

It appears to be an upstream issue according to #8487 (comment), so there's not much we can prioritise.

@object88
Copy link

Relatively new Zed user here. Is there a way to tell Zed to ignore a subset of files? I added a helm chart to my project, and now I have 315 errors..., which makes it difficult to see my very real errors.

@cabrinha
Copy link
Contributor

cabrinha commented May 16, 2024

I believe that tree-sitter-go-template is the better approach, because they even support helm dialect: https://github.com/ngalaiko/tree-sitter-go-template/blob/master/dialects/helm

I tried to get helm language support added earlier this year here: #7259

And I started a discussion for it here: #7260

Now, I'm just trying to get Helm supported via extensions: zed-industries/extensions#443

@malikbenkirane
Copy link

malikbenkirane commented Jun 24, 2024

@cabrinha Please let us now if you find out how to package this as an extension. Hopefully we can get this working.

I see there is a closed pull request for #7259 ending with

Going to close this for now, but it should be possible to package this as an extension.
@ConradIrwin

As well as a new currently open issue at zed-industries/extensions/issues/186

Should we close this issue and follow up to the latter issue?

Finally I see that the business is going on at zed-industries/extensions/pull/746 but I can't unfortunately help at the moment.

@cabrinha
Copy link
Contributor

@malikbenkirane zed-industries/extensions#186 should stay open until the editor supports Helm.

zed-industries/extensions#746 is where the business is going on, but I need some help with:

  • Making sure Zed identifies certain .yaml files as Helm and knows the difference and when to use Helm vs. YAML
  • Getting the CI tests to pass
  • Making sure the language server is being used correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] language An umbrella label for all programming languages syntax behaviors yaml YAML data format support
Projects
None yet
Development

No branches or pull requests

8 participants