-
Notifications
You must be signed in to change notification settings - Fork 18
yamlls and helm_ls #44
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
Comments
Hi, My issue is close because i was too busy to respond in time … Sorry my bad But problem is still there … I use lazyvim setup and i get errors on every lines even if deployment is ok in k8s ... oh! and i have add { "towolf/vim-helm", lazy = false } even if it seems to be no more maintained |
To answer the original issue: yamlls should be disabled for helm files. |
If you run |
thank you. if there is any way i can assist with development (testing,coding,etc.) please let me know. i'd be more than happy. perhaps a note/caveat section in the readme on how to use this LS with yamlls will be helpful, no? |
Feel free to take a look at the code for reviewing or look for more bugs. I just stated a list with todos and bugs in the first merge request comment. |
@qvalentin Yes lazyvim use lspconfig LspInfo return yamlls and helm_ls on a deployment.yaml
feel free to ask me other debug comment no problem … |
I had the same issue, but found a solution for it. I exclude yaml support when filetype |
@rgruyters thanks no more red yamlls errors :-D now is there a way to have auto-format or just auto-indent on save ? |
how do you exclude yamlls when setting up yamlls through lspconfig i can't really figure that out at the moment |
This is really a little bit complicated, because there is a lot of filetype detection magic going on: I found two solutions to fix it:
Check out the minimal config example: https://github.com/mrjosh/helm-ls/blob/master/examples/nvim/init.lua
|
Hey all, I am having some trouble getting yamlls to play nice with Helm chart files. I had I have now uninstalled Here is my config for LSP's: https://github.com/Mo0rBy/nvim_config/blob/fix-helmls-lsp/lua/moorby/plugins/lsp/lspconfig.lua And here is part of a Helm chart file that is still getting a few too many LSP errors for my liking: First of all, I want to check if what I'm doing is correct, and if not what am I doing wrong? If I'm not doing anything wrong, can someone help me out in getting yamlls and helm_ls to work together properly. Also, is there currently any work/idea to make this installation process easier and more user friendly. I'd be interested in helping to test this as a minimum contribution, but if I have time and energy I could even try and contribute code to this project as it seems to be the only one around that is trying to get Helm implementation done properly in neovim (and I really don't want to go back to VSCode). I was also wondering, would it be possible to configure helmls or yamlls to warn/error for your own formatting, for example in my team, we like to have indents on array values, e.g. someKeyForArray:
- arrayItem1
- arrayItem2 Rather than having it inline with the key value: someKeyForArray:
- arrayItem1
- arrayItem2 |
Hi @Mo0rBy, thanks for the detailed description. There a two type of problems currently known:
Those diagnostics are caused by the yamlls integration of helm-ls which can be disabled via the config. The wrong diagnostics seem to be a bug, please send me all helm template files that caused wrong diagnostics starting with "Yamlls" so I can try to fix the bugs. |
Thanks for the quick response @qvalentin , I've set the configuration to disable yamlls and now I get no errors (nice!), but I think without yamlls enabled, there are A LOT of features missing. With this initial look, it seems all I can get is documentation for go template stuff, for example: I'll revert this change so I can get you the info on the LSP bugs that you describe, but I will need some time to modify the charts slightly as I can't share them as they are right now. Give me some time to do this (probably this weekend) and then I'll get them to you. Do you just want them posted here? I have a lot of examples, so it will be a big post. |
Sounds good, maybe open a seperate issue and post the files as gists/pastebins or a new git repo. |
One short edit: You can also set the configuration option |
I've decided not to post my own Helm charts as I'm a little worried my company would come after me! Instead, can I suggest looking at the Bitnami Helm charts repo? There are looooooads of examples available on there that can be worked with. 1 question I have to see if this would even be possible. So with Helm Library charts, they can be stored and referenced within the local machines filesystem and I imagine that with this method, it would be possible to get the LSP to find definitions for Helm templates, however, would this be possible for library charts hosted in online repositories? For example, Bitnami have a common library which contains a bunch of useful utility templates that are heavily used in their own Helm charts and can easily be used in your own custom Helm charts. Furthermore, would it be possible to setup the LSP to get template definitions from private repositories? (my initial guess would be no without setting up some authentication stuff which I think would be kind of advanced for any LSP to do). I would love to contribute to this so if you could point me to something that needs doing, let me know! |
I understand that You can't share the whole charts of you company, maybe you could pick a file where helm-ls breaks and try to delete stuff until you find out what causes the problem? Then you can narrow it down an make it easier to remove private information of your company. |
I've disabled the yamlls, using this code in my LSP: ["helm-ls"] = {
logLevel = "info",
valuesFiles = {
mainValuesFile = "values.yaml",
lintOverlayValuesFile = "values.lint.yaml",
additionalValuesFilesGlobPattern = "values*.yaml",
},
yamlls = {
enabled = false,
diagnosticsLimit = 50,
showDiagnosticsDirectly = false,
path = "yaml-language-server",
filetypes_exclude = { "helm" },
config = {
schemas = {
kubernetes = "templates/**",
},
completion = true,
hover = true,
-- any other config from https://github.com/redhat-developer/yaml-language-server#language-server-settings
},
},
}, And I'm getting this weird behavior that it shows some Yamlls errors, and each time I save the file the errors change until they disapear. Did anyone else encounter this? |
Had the issue, too... After staring on my The |
This config block helped me figure out what's going on: https://github.com/mrjosh/helm-ls/blob/master/examples/nvim/init.lua#L29-L38 In my config I was doing this: Not Working:
Working:
Notice there is 1 additional layer of key indirection: |
Hi @eshepelyuk, this is a problem with the filetype detection. It seem like the filetype is set to yaml first, after that it is changed to helm. You might also try my experimental helm-ls neovim plugin instead of towolf/vim-helm to see if this fixes the problem (my plugin uses lua to configure the filetype). Another option would be to try vim-polyglot instead of towolf/vim-helm, but this seems unmaintained. |
Hello @qvalentin
|
I just tested it, and my plugin seems to fix the issue with vim-plug. I opened #117 (wip) and will update the docs etc. soon. |
Great news, thank you. |
@qvalentin - some updates
|
hi, thank you for this language server!
should yamlls be enabled for ft=helm? for example if a file begins with
{{- if .Values...}}
yamlls diagnostics are useless.what's the recommended way to use this LS with yamlls?
The text was updated successfully, but these errors were encountered: