--- @type LazyPluginSpec return { "neovim/nvim-lspconfig", dependencies = { "hrsh7th/cmp-nvim-lsp", }, event = { "BufReadPre", "BufNewFile" }, config = function() local lspconfig = require("lspconfig") local cmp_nvim_lsp = require("cmp_nvim_lsp") local on_attach = require("taken.utils.on_attach") local capabilities = cmp_nvim_lsp.default_capabilities() local signs = { Error = " ", Warn = " ", Hint = "ﴞ ", Info = " " } for type, icon in pairs(signs) do local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) end local defaultLsps = { "html", "cssls", "pyright", "jsonls", "rust_analyzer", "yamlls", "eslint", "bashls" } for _, lsp in ipairs(defaultLsps) do lspconfig[lsp].setup({ capabilities = capabilities, on_attach = on_attach, }) end lspconfig["lua_ls"].setup({ capabilities = capabilities, on_attach = on_attach, settings = { Lua = { hint = { enable = true, }, runtime = { version = "LuaJIT", }, diagnostics = { globals = { "vim" }, }, completion = { callSnippet = "Replace", }, format = { enable = false, }, }, }, }) lspconfig["powershell_es"].setup({ capabilities = capabilities, on_attach = on_attach, bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services", }) end, }