Open mickaelistria opened 4 years ago
What is needed for this to be added - how we can help? There is https://github.com/Azure/vscode-kubernetes-tools/blob/master/syntaxes/helm.tmLanguage.json which VSCode uses to correctly highlight Helm template syntax.
There seems to be a tree-sitter grammar for go templates. It might be useful here.
With tree-sitter and this grammar, the template blocks can be fully parsed into an AST that could be used for functionality beyond highlighting, such as diagnostics, autocomplete, etc.
It would be nice to make this work with templates in general and not just helm templates, {{...}}
is the default delimiter set but it can be customised, and we also have Jinja and ERB....
Just revisiting after nearly a year. Any new solutions or workarounds? @luisdavim any thoughts?
Would be nice to see this feature.
There is there now: https://github.com/mrjosh/helm-ls
This is the setup I landed on, install these 2 plugins:
helm
(this is the important part)Then configure the language server to run helm-ls for helm files, in my case, I use https://github.com/neoclide/coc.nvim so I have:
"languageserver": {
"helm": {
"command": "helm_ls",
"args": ["serve"],
"filetypes": ["helm", "helmfile"],
"rootPatterns": ["Chart.yaml"]
}
}
This solves the problems with all the diagnostics errors from yaml ls but still uses it under the covers if installed. There's a TreeSitter gramar for helm so that also works out nicely.
It seems like Helm Chart files are basically Kubernetes yaml files with templating capability in
{{...}}
blocks. It would be nice if Yaml Language Server could provide support for those files (by pre-setting schema, allowing validation/completion in{{...}}
and so on.