/ nvim / lua / lsp / servers / helm.lua
helm.lua
 1  return {
 2    {
 3      'neovim/nvim-lspconfig',
 4      opts = {
 5        codelens = {
 6          enabled = true,
 7        },
 8        servers = {
 9          helm_ls = {
10            logLevel = 'info',
11            valuesFiles = {
12              mainValuesFile = 'values.yaml',
13              lintOverlayValuesFile = 'values.lint.yaml',
14              additionalValuesFilesGlobPattern = 'values*.yaml',
15            },
16            command = 'helm_ls',
17            filetypes = {
18              'helm',
19              'helmfile',
20              '*helpers.tpl',
21            },
22            root_patterns = {
23              'Chart.lock',
24              'Chart.yaml',
25            },
26            args = {
27              'serve',
28            },
29            yamlls = {
30              LazyVim.lsp.on_attach(function(_, buffer)
31                if vim.bo[buffer].filetype == 'helm' then
32                  vim.schedule(function()
33                    vim.cmd('LspStop ++force yamlls')
34                  end)
35                end
36              end),
37              enabled = true,
38              diagnosticsLimit = 50,
39              showDiagnosticsDirectly = false,
40              path = 'yaml-language-server',
41              config = {
42                schemas = {
43                  kubernetes = {
44                    -- 'templates/**',
45                    'Chart.yaml',
46                    'values.local.yaml',
47                    'values.yaml',
48                  },
49                },
50                completion = true,
51                hover = true,
52              },
53            },
54          },
55        },
56      },
57    },
58    {
59      'towolf/vim-helm',
60      event = 'VeryLazy',
61    },
62  }