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

Adding helm_ls is a pain: Cannot access configuration for helm_ls #154

Open
xcfw opened this issue Sep 20, 2023 · 1 comment
Open

Adding helm_ls is a pain: Cannot access configuration for helm_ls #154

xcfw opened this issue Sep 20, 2023 · 1 comment

Comments

@xcfw
Copy link

xcfw commented Sep 20, 2023

I get this error:

[lspconfig] Cannot access configuration for helm_ls. Ensure this server is listed in `server_configurations.md` or added as a custom server.

With the following config:

$ cat utils/init.lua
local M = {}

M.servers = {
  "lua_ls",
  "cssls",
  "html",
  "docker_compose_language_service",
  "tsserver",
  "pyright",
  "dockerls",
  "solargraph",
  "bashls",
  "jsonls",
  "helm_ls",
  "terraformls"
}

return M
$ cat settings/helm_ls.lua
local lspconfig = require('lspconfig')
local util = require('lspconfig.util')

return {
  settings = {
    helm = {
      cmd = {"helm_ls", "serve"},
      filetypes = {'helm'},
      root_dir = function(fname)
        return util.root_pattern('Chart.yaml')(fname)
      end,
    },
  },
  lspconfig.helm_ls.setup {
    filetypes = {"helm"},
    cmd = {"helm_ls", "serve"},
  },
}
$ cat user/null-ls.lua
local M = {
  "jose-elias-alvarez/null-ls.nvim",
  event = "BufReadPre",
  commit = "60b4a7167c79c7d04d1ff48b55f2235bf58158a7",
  dependencies = {
    {
      "nvim-lua/plenary.nvim",
      commit = "9a0d3bf7b832818c042aaf30f692b081ddd58bd9",
      lazy = true,
    },
  },
}

function M.config()
  local null_ls = require "null-ls"
  -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
  local formatting = null_ls.builtins.formatting
  -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
  local diagnostics = null_ls.builtins.diagnostics

  -- https://github.com/prettier-solidity/prettier-plugin-solidity
  null_ls.setup {
    debug = false,
    sources = {
      formatting.prettier.with {
        extra_filetypes = { "toml" },
        extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" },
      },
      formatting.black.with { extra_args = { "--fast" } },
      formatting.stylua,
      formatting.google_java_format,
      formatting.rubocop,
      diagnostics.flake8,
      diagnostics.rubocop,
    },
  }
end

return M
$ cat user/vim-helm.lua
local M = {
  "towolf/vim-helm",
  commit = "c2e7b85711d410e1d73e64eb5df7b70b1c4c10eb",
  event = "VeryLazy",
}

return M

Mason successfully installed helm_ls and it's accessible in console:

$ helm_ls
  /\  /\___| |_ __ ___   / / ___ 
 / /_/ / _ \ | '_ ' _ \ / / / __|
/ __  /  __/ | | | | | / /__\__ \
\/ /_/ \___|_|_| |_| |_\____/___/

Usage:
  helm_ls [flags]
  helm_ls [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  lint        Lint a helm project
  serve       Start helm lint language server
  version     Print current version of helm_ls

Flags:
  -h, --help   help for helm_ls

Use "helm_ls [command] --help" for more information about a command.

image

@xcfw
Copy link
Author

xcfw commented Oct 17, 2023

Hey all! Any news on this issue? It maybe my misunderstanding and lack of lua knowledge, please advise.

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

No branches or pull requests

1 participant