diff --git a/.config/nvim/lua/plugins/language-server.lua b/.config/nvim/lua/plugins/language-server.lua index 24488c3..f11a65b 100644 --- a/.config/nvim/lua/plugins/language-server.lua +++ b/.config/nvim/lua/plugins/language-server.lua @@ -1,122 +1,140 @@ return { - { - "mason-org/mason.nvim", - tag = "v1.11.0", - config = function() - require("mason").setup({}) - end, - }, - { - "WhoIsSethDaniel/mason-tool-installer.nvim", - config = function() - require("mason-tool-installer").setup({ - ensure_installed = { - "stylua", - "mdformat", - "hadolint", - "yamllint", - "gh-actions-language-server", - "ansible-language-server", - "ansible-lint", - }, - }) - end, - }, - { - "mason-org/mason-lspconfig.nvim", - tag = "v1.32.0", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { - "lua_ls", - "bashls", - "helm_ls", - "jsonls", - "nginx_language_server", - "basedpyright", - "ruff", - "yamlls", - }, - }) - end, - }, - { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.formatting.mdformat, - null_ls.builtins.diagnostics.hadolint, - null_ls.builtins.diagnostics.yamllint.with({ - extra_args = { "-d", "rules:\n document-start: disable" }, - }), - }, - }) - vim.keymap.set("n", "af", vim.lsp.buf.format, { desc = "Auto-Format File" }) - end, - }, - { - "neovim/nvim-lspconfig", - tag = "v1.8.0", - lazy = true, - event = { "BufReadPost", "BufNewFile" }, - dependencies = { - "mason-org/mason.nvim", - "mason-org/mason-lspconfig.nvim", - "WhoIsSethDaniel/mason-tool-installer.nvim", - }, - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() - local lspconfig = require("lspconfig") - lspconfig.ts_ls.setup({ - capabilities = capabilities, - }) - lspconfig.lua_ls.setup({ capabilities = capabilities }) - lspconfig.bashls.setup({ - capabilities = capabilities, - cmd = { "bash-language-server", "start" }, - filetypes = { "sh", "bash" }, - }) - lspconfig.gh_actions_ls.setup({ capabilities = capabilities }) - lspconfig.helm_ls.setup({ - capabilities = capabilities, - filetypes = { "tpl", "helm"}, - }) - lspconfig.jsonls.setup({ capabilities = capabilities }) - lspconfig.basedpyright.setup({ - capabilities = capabilities, - settings = { - basedpyright = { - analysis = { - typeCheckingMode = "off", - diagnosticSeverityOverrides = { - reportUnusedImport = false, - reportUnusedVariable = false, - }, - }, - }, - }, - }) - lspconfig.nginx_language_server.setup({ capabilities = capabilities }) - lspconfig.ruff.setup({ - capabilities = capabilities, - init_options = { - settings = { - lineLength = 79, - }, - }, - }) - lspconfig.yamlls.setup({ capabilities = capabilities }) - lspconfig.ansiblels.setup({ capabilities = capabilities }) - vim.keymap.set("n", "vd", vim.lsp.buf.hover, { desc = "View Docstring" }) - vim.keymap.set("n", "gt", vim.lsp.buf.definition, { desc = "Go To Definition" }) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" }) - vim.keymap.set("n", "cr", vim.lsp.buf.rename, { desc = "Refactor Name" }) - vim.keymap.set("n", "vr", vim.lsp.buf.references, { desc = "View References" }) - vim.keymap.set("n", "pp", vim.diagnostic.goto_prev, { desc = "Previous Issue" }) - vim.keymap.set("n", "pn", vim.diagnostic.goto_next, { desc = "Next Issue" }) - end, - }, + { + "mason-org/mason.nvim", + tag = "v1.11.0", + config = function() + require("mason").setup({}) + end, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + config = function() + require("mason-tool-installer").setup({ + ensure_installed = { + "stylua", + "mdformat", + "hadolint", + "yamllint", + "gh-actions-language-server", + "ansible-language-server", + "ansible-lint", + }, + }) + end, + }, + { + "mason-org/mason-lspconfig.nvim", + tag = "v1.32.0", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "bashls", + "helm_ls", + "jsonls", + "nginx_language_server", + "basedpyright", + "ruff", + "yamlls", + }, + }) + end, + }, + { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.mdformat, + null_ls.builtins.diagnostics.hadolint, + null_ls.builtins.diagnostics.yamllint.with({ + extra_args = { "-d", "rules:\n document-start: disable" }, + }), + }, + }) + vim.keymap.set("n", "af", vim.lsp.buf.format, { desc = "Auto-Format File" }) + end, + }, + { + "qvalentin/helm-ls.nvim", + ft = "helm", + opts = { + conceal_templates = { enabled = true }, + indent_hints = { enabled = true }, + }, + { "neovim/nvim-lspconfig", event = { "BufReadPre", "BufNewFile", "BufEnter" } }, + }, + { + "neovim/nvim-lspconfig", + tag = "v1.8.0", + lazy = true, + event = { "BufReadPost", "BufNewFile" }, + dependencies = { + "mason-org/mason.nvim", + "mason-org/mason-lspconfig.nvim", + "WhoIsSethDaniel/mason-tool-installer.nvim", + }, + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require("lspconfig") + lspconfig.ts_ls.setup({ + capabilities = capabilities, + }) + lspconfig.lua_ls.setup({ capabilities = capabilities }) + lspconfig.bashls.setup({ + capabilities = capabilities, + cmd = { "bash-language-server", "start" }, + filetypes = { "sh", "bash" }, + }) + lspconfig.gh_actions_ls.setup({ capabilities = capabilities }) + lspconfig.helm_ls.setup({ + capabilities = capabilities, + -- filetypes = { "tpl", "helm" }, + settings = { + ["helm_ls"] = { + yamlls = { + path = "yaml-language-server", + }, + }, + }, + }) + lspconfig.jsonls.setup({ capabilities = capabilities }) + lspconfig.basedpyright.setup({ + capabilities = capabilities, + settings = { + basedpyright = { + analysis = { + typeCheckingMode = "off", + diagnosticSeverityOverrides = { + reportUnusedImport = false, + reportUnusedVariable = false, + }, + }, + }, + }, + }) + lspconfig.nginx_language_server.setup({ capabilities = capabilities }) + lspconfig.ruff.setup({ + capabilities = capabilities, + init_options = { + settings = { + lineLength = 79, + }, + }, + }) + lspconfig.yamlls.setup({ + capabilities = capabilities, + }) + lspconfig.ansiblels.setup({ capabilities = capabilities }) + vim.keymap.set("n", "vd", vim.lsp.buf.hover, { desc = "View Docstring" }) + vim.keymap.set("n", "gt", vim.lsp.buf.definition, { desc = "Go To Definition" }) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" }) + vim.keymap.set("n", "cr", vim.lsp.buf.rename, { desc = "Refactor Name" }) + vim.keymap.set("n", "vr", vim.lsp.buf.references, { desc = "View References" }) + vim.keymap.set("n", "pp", vim.diagnostic.goto_prev, { desc = "Previous Issue" }) + vim.keymap.set("n", "pn", vim.diagnostic.goto_next, { desc = "Next Issue" }) + end, + }, }