local TOOLCHAIN = require('toolchain') return { { 'williamboman/mason.nvim', lazy = false, config = function() require('mason').setup() end, }, { 'williamboman/mason-lspconfig.nvim', lazy = false, opts = { auto_install = true, }, config = function() require('mason-lspconfig').setup({ ensure_installed = TOOLCHAIN.get_lsp_autoinstalls(), }) end, }, { 'neovim/nvim-lspconfig', lazy = false, config = function() -- Setup -- local capabilities = require('cmp_nvim_lsp').default_capabilities() local lspconfig = require('lspconfig') TOOLCHAIN.setup_lsps(lspconfig, capabilities) -- Keybinding -- vim.keymap.set( 'n', 'cd', vim.lsp.buf.hover, { desc = 'Show Code Definition' } ) vim.keymap.set( 'n', 'gd', vim.lsp.buf.definition, { desc = 'Go to Definition' } ) vim.keymap.set( 'n', 'gr', vim.lsp.buf.references, { desc = 'Go to References' } ) vim.keymap.set( 'n', 'ca', vim.lsp.buf.code_action, { desc = 'Do Code Actions' } ) end, }, { 'nvimtools/none-ls.nvim', dependencies = { 'nvim-lua/plenary.nvim', 'nvimtools/none-ls-extras.nvim', }, config = function() -- Setup -- local null_ls = require('null-ls') null_ls.setup({ sources = TOOLCHAIN.get_null_ls_source(null_ls), }) -- Keybinding -- vim.keymap.set( 'n', 'fc', vim.lsp.buf.format, { desc = 'Format Code' } ) end, }, { 'nvimdev/lspsaga.nvim', after = 'nvim-lspconfig', dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons', }, config = function() require('lspsaga').setup({ symbol_in_winbar = { enable = false }, lightbulb = { enable = false } }) -- Keybinding -- vim.keymap.set( 'n', 'cr', ':Lspsaga rename', { desc = 'Rename Variable' } ) vim.keymap.set( 'n', 'cp', ':Lspsaga peek_definition', { desc = 'Peek Code Definition' } ) end, }, }