-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Helm (kubernetes) support #7259
Conversation
We require contributors to sign our Contributor License Agreement, and we don't have @cabrinha on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
2734ec8
to
8fc91cf
Compare
8fc91cf
to
e2467ca
Compare
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
@caius I see you've added Make support in another PR, would you mind taking a look here and seeing if there is anything needs changing for helm support? |
@SomeoneToIgnore mind taking a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need a docs entry for that, as all the other languages do.
I've tested this on https://github.com/helm/examples and https://github.com/helm/charts-repo-actions-demo and not sure I've liked what I saw:
- highlights break right after the first yaml error
- due to the same issue, outlines do not work as expected:
] | ||
|
||
increase_indent_pattern = ":\\s*[|>]?\\s*$" | ||
prettier_parser_name = "yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep newlines at the end of the files, as we do in the rest of the files around.
Funny that you did that in one of the *.scm files but not here and other *.scm files.
This is because Helm is combination of YAML syntax with Go templates mixed in. Everything between |
@SomeoneToIgnore I would enjoy learning how to combine yaml w/ go-templating with your help if possible! |
Had a quick glance but not sure what you wanted me to look at specifically? None of it looks related to Make. |
Just figured you knew how to implement language support in Zed. I'm lost, but really want to get Kubernetes Helm support added in, there doesn't seem to be an easy tree-sitter plugin available here. |
I also started a discussion trying to get some attention on this issue: #7260 |
I have no good idea how to combine those, mainly due to the fact that helm is context-dependent, if I understand it correctly? So I see two ways to consider:
Do note that Zed currently has zero ways to combine multiple syntax highlights in a single file: at best (if it even works), two associated grammars with a single file type will try to highlight it entirely, without splitting it into logical regions. Sees like a big task, to be honest, I would start with something stadalone and a bit simpler: #6905 as Docker does not break with its tree-sitter grammar, but would benefit from highlighting some of the things with |
I do think it's possible to add correct syntax highlighting for Helm. We would need to parse the file primarily as a Go template, and then use language injection to parse all of the content outside of a |
Going to close this for now, but it should be possible to package this as an extension. |
No idea what I'm doing, just trying to get Helm support added in.
Helm is a combo of YAML and go-templating. There is no "helm" tree-sitter at the moment.
YAML: https://github.com/ikatyang/tree-sitter-yaml
Go Template: https://github.com/ngalaiko/tree-sitter-go-template
helm-ls: https://github.com/mrjosh/helm-ls
I'm not sure how to implement the helm language server or combine the YAML and go-template tree sitters, but I'd love to see it in here. If someone could help me through the process, I'd appreciate it.
Zed Issue: zed-industries/extensions#186