Conversation
I don't think
These errors come from original YAML language server. You can disable it and errors will be gone. |
|
Any news on this would love to use it ^^ for more kubernetes with rust |
Need some help on getting this to "work". First up, the CI tests are failing, but this extension mostly works. Second... @yodatak do you know how to get |
Hey there, thanks for working on this, great work so far. Unfortunately I cannot support you. But just said, {{ }} is not automatically Helm. I am using a tool which has Jinja2 templating, so I can template my kubernetes manifests with it. I have also this issue of bracket space with Zed not only, but also for Helm. |
|
@cabrinha What I have generally seen from neovim autocmds to load helm-ls as language server automatically, is that it looks for the following:
If both are true, it is pretty safe to assume user is working with Helm. Hope this helps. |
Thanks for those ideas, but how does that implementation look in Zed? |
|
a bit of nuance, sometimes Chart.yaml isn't located in project root. UPD. also there is related issue, which will make working with helm kinda painful |
|
I know in vscode it use the json shema for help https://json.schemastore.org/kustomization.json Via the yaml language server https://github.com/redhat-developer/vscode-yaml and helm chart is supported by like redhat-developer/vscode-yaml#464 the textmate language of vscode |
|
@yodatak I believe this is correct according to both documentations {
"lsp": {
"yaml-language-server": {
"initialization_options": {
"yaml.schemas": {
"http://json.schemastore.org/chart.json": "templates/*.yaml"
}
}
}
}
}{
"lsp": {
"yaml-language-server": {
"initialization_options": {
"yaml": {
"schemas": {
"http://json.schemastore.org/chart.json": "templates/*.yaml"
}
}
}
}
}
}However I could only apply a schema with inline comments |
|
I think we need to fix zed-industries/zed#7636 before merging ? i would love to have more kubernetes autocompletion with flux2 and so one but |
I don't find any way seem to be a bug from yaml lsp i think for me for flux2 i need to do # yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2.json
---
apiVersion: helm.toolkit.fluxcd.io/v2or for kustomisation # yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
apiVersion: kustomize.config.k8s.io/v1beta1or for namespace # yaml-language-server: $schema=https://kubernetesjsonschema.dev/v1.14.0/Namespace-v1.json
---
apiVersion: v1
kind: Namespace |
|
I think that LanguageMatcher should be extended with something like |
I think you should be able to use |
5e2e32f to
b685047
Compare
Tried to do this here: cabrinha/helm.zed@6f2ac46 ... Still not working. |
I think also that some charts also create sub-charts under the |
Those charts are tar'd up, so they don't really need to be opened and rendered. |
|
Hey, Like mentioned many posts above, this is no explicit helm issue, but more like a templating include issue in the yaml lsp. |
not always, it can be custom sub chart which written in plain yaml files. This directory "multipurpose", subcharts can be in form of tar.gz, and in form of directory |
This is all valid, but how do we get closer to getting Zed to support helm syntax? |
I would argue that properly supporting jsonschema overrides in yaml-language-server is the best place to divert focus towards. It is working with an inline comment today, if it can be made to work in |
Not sure I have much to offer there... Should we close this PR? |
@mikeymop I didn't get what did you mean on Moreover jsonschema provided above by @yodatak is a schema of @cabrinha Here is what we need to do to get Helm support in Zed (from my point of view). We need some option, that would tell Zed to use |
|
@cabrinha I figured it out. By some reason in your local |
@aohoyd nice find, but why is the CI still failing? What needs to happen in this PR to get this extension merged in and natively supported in Zed? |
Since those globs are not supported can you remove them from here: We should also add a I fixed the sort order so tests should pass now. |
|
Thank you, it does work! But I encourage everyone who's waiting for this to be merged, in the meantime, to also visit the upstream issue ngalaiko/tree-sitter-go-template#23 and motivate the dev to review and fix it. Since it's likely that your helm charts use dash (-) to combine 2 templates into a single value. |
|
@cabrinha you might want to add |
I'm sure I will be flamed for "doing it wrong" but, here you go: zed-industries/zed#19095 |
|
@cabrinha nice work :D. Here are some of my viewpoints for the discussed topics:
@selfisch yaml-language-server will probably never implement support for templating languages, it would be better to use a specific lsp for the template language like helm-ls.
@mikeymop this PR may be interesting for you: redhat-developer/yaml-language-server#962
@hedgieinsocks I just opened tree-sitter-grammars/tree-sitter-yaml#12 for this, as its a problem with the yaml tree-sitter grammar. If anyone has some tree-sitter and/or C knowledge you could help there. |
maxdeviant
left a comment
There was a problem hiding this comment.
Thank you for your work on this! Glad to see it finally land 😄
Merge after this: - zed-industries/extensions#746 Release Notes: - N/A --------- Co-authored-by: Peter Tripp <peter@zed.dev> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Merge after this: - zed-industries/extensions#746 Release Notes: - N/A --------- Co-authored-by: Peter Tripp <peter@zed.dev> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
I've got this extension to a point now where all highlights seem to be working properly, but there are still a couple issues I need some help with:
*.yamlfile is located in a directory namedtemplates:templates/*.yaml, is this possible?