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

Add helmfile support #27

Open
DrummyFloyd opened this issue Apr 21, 2023 · 5 comments
Open

Add helmfile support #27

DrummyFloyd opened this issue Apr 21, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@DrummyFloyd
Copy link

Would be great to add the support of this wrapper

Which is mostly the same syntax as helm

http://github.com/helmfile/helmfile

@mrjosh mrjosh added the enhancement New feature or request label Jun 4, 2023
@hinricht
Copy link

hinricht commented Jul 10, 2023

That would be awesome indeed !
Right now helm-ls breaks when it can't find any values.yaml or Chart.yaml:

[START][2023-07-10 13:42:19] LSP logging initiated
[ERROR][2023-07-10 13:42:19] .../vim/lsp/rpc.lua:734	"rpc"	"/home/varac/.local/share/nvim/mason/bin/helm_ls"	"stderr"	'{"level":"info","msg":"helm-lint-langserver: connections opened","time":"2023-07-10T13:42:19+02:00"}\n'
[ERROR][2023-07-10 13:42:19] .../vim/lsp/rpc.lua:734	"rpc"	"/home/varac/.local/share/nvim/mason/bin/helm_ls"	"stderr"	'{"level":"info","msg":"Error loaing values.yaml file open /home/varac/.../mastodon-helmfiles/values.yaml: no such file or directory","time":"2023-07-10T13:42:19+02:00"}\n'
[ERROR][2023-07-10 13:42:19] .../vim/lsp/rpc.lua:734	"rpc"	"/home/varac/.local/share/nvim/mason/bin/helm_ls"	"stderr"	'panic: request "initialize" was never replied to\n\ngoroutine 7 [running]:\n'
[ERROR][2023-07-10 13:42:19] .../vim/lsp/rpc.lua:734	"rpc"	"/home/varac/.local/share/nvim/mason/bin/helm_ls"	"stderr"	"go.lsp.dev/jsonrpc2.ReplyHandler.func1({0x1a33478, 0xc000046160}, 0xc00051f360, {0x7ffaf8285cd8?, 0xc000520b40?})\n\t/go/pkg/mod/go.lsp.dev/jsonrpc2@v0.10.0/handler.go:44 +0x165\ngo.lsp.dev/jsonrpc2.(*conn).run(0xc000523a90, {0x1a33478, 0xc000046160}, 0xc000135a20)\n\t/go/pkg/mod/go.lsp.dev/jsonrpc2@v0.10.0/conn.go:206 +0x22b\ncreated by go.lsp.dev/jsonrpc2.(*conn).Go\n\t/go/pkg/mod/go.lsp.dev/jsonrpc2@v0.10.0/conn.go:189 +0xb0\n"

@qvalentin
Copy link
Collaborator

Can someone provide a example project, so the bug can be reproduced? The official examples seem to be working (e.g. https://github.com/helmfile/helmfile/tree/main/examples/charts/argocd-helmfile-deployment).

@hinricht
Copy link

@qvalentin: I can reproduce the issue with the
helmfile.yaml.txt example from the docs: https://github.com/helmfile/helmfile/blob/main/docs/index.md#configuration

(renamed to .yaml.txt to be able to upload here)

@qvalentin
Copy link
Collaborator

qvalentin commented Jul 28, 2023

@hinricht, thank you, I think I now understand the problem.

The bug occurs under the following condition:

  1. I open a file with the name helmfile*.yaml -> vim-helm detects that it is a file with the filetype helm (as defined here)
  2. nvim-lspconfig checks for the root directory of the project. The root directory is defined as a directory containing a file called Chart.yaml
  3. If no Chart.yaml is found nothing happens and helm-ls does not work
  4. If a Chart.yaml file is found helm-ls is started and looks for a values.yaml file. If the file is not found, helm-ls crashes. If a values.yaml file is found, helm-ls works.

It should be possible to fix the crash, but we have to seem what features of helm-ls will work on helmfile files.

Edit: I can confirm basic features, such as hover documentation (but only for functions that are also used in helm) are working.

qvalentin added a commit to qvalentin/helm-ls that referenced this issue Jul 28, 2023
Instead the default values are used, this would be the same as if the
file was empty.

This makes it possible to use helm-ls for helmfile projects that don't
have a values.yaml file (mrjosh#27).
@qvalentin
Copy link
Collaborator

qvalentin commented Feb 3, 2024

For now you can already get autocompletion by adding

# yaml-language-server: $schema=https://json.schemastore.org/helmfile.json

to your helmfile.yaml

Edit: Should not be required anymore with v0.0.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants