return { 'neovim/nvim-lspconfig', version = '^2.3.0', dependencies = { 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', 'saghen/blink.cmp', 'L3MON4D3/LuaSnip', 'j-hui/fidget.nvim', 'rafamadriz/friendly-snippets', { 'towolf/vim-helm', ft = 'helm' }, { 'folke/lazydev.nvim', ft = 'lua', -- only load on lua files opts = { library = { -- See the configuration section for more details -- Load luvit types when the `vim.uv` word is found { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, }, }, }, }, config = function() vim.diagnostic.config({ virtual_text = false }) local lspconfig = require('lspconfig') -- load snippets from friendly-snippets require('luasnip.loaders.from_vscode').lazy_load() require('fidget').setup({}) require('mason').setup({}) ---@module 'mason-lspconfig' ---@type MasonLspconfigSettings require('mason-lspconfig').setup({ automatic_enable = true, -- Replace the language servers listed here -- with the ones you want to install ensure_installed = { 'ts_ls', 'lua_ls', 'gopls', 'pylsp', 'gitlab_ci_ls', 'yamlls', 'ansiblels', 'terraformls', 'helm_ls', 'marksman', }, }) local lazydev = require('lazydev') lazydev.setup() vim.lsp.config('lua_ls', { root_dir = function(bufnr, on_dir) on_dir(lazydev.find_workspace(bufnr)) end }) ---@type lspconfig.Config vim.lsp.config('pylsp', { settings = { ['pylsp'] = { plugins = { autopep8 = { enabled = false, }, yapf = { enabled = true, }, pycodestyle = { ignore = { 'W391' }, maxLineLength = 95, } } } } }) vim.lsp.config('helm-ls', { settings = { ['helm-ls'] = { helmLint = { enabled = false }, yamlls = { enabled = false }, }, } }) vim.lsp.config('terraformls', { filetypes = { 'terraform', 'terraform-vars', 'tf' } }) end }