4 "neovim/nvim-lspconfig",
5 ---@class PluginLspOpts
8 local keys = require("lazyvim.plugins.lsp.keymaps").get()
10 -- TODO: setup a new mapping for this
11 -- { "gr", "<cmd>Telescope lsp_references<cr>", desc = "References" },
12 keys[#keys+1] = { "gr", false }
15 -- Automatically format on save
16 -- autoformat = false,
17 -- LSP Server Settings
18 ---@type lspconfig.options
24 disable = { "missing-fields", },
29 -- Add clangd extensions
30 -- https://github.com/p00f/clangd_extensions.nvim
32 -- you can do any additional lsp server setup here
33 -- return true if you don't want this server to be setup with lspconfig
34 ---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
36 -- example to setup with typescript.nvim
37 -- tsserver = function(_, opts)
38 -- require("typescript").setup({ server = opts })
41 -- Specify * to use this function as a fallback for any server
42 -- ["*"] = function(server, opts) end,
47 -- cmdline tools and lsp servers
50 "williamboman/mason.nvim",
52 keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } },
60 ---@param opts MasonSettings | {ensure_installed: string[]}
61 config = function(_, opts)
62 require("mason").setup(opts)
63 local mr = require("mason-registry")
64 local function ensure_installed()
65 for _, tool in ipairs(opts.ensure_installed) do
66 local p = mr.get_package(tool)
67 if not p:is_installed() then
73 mr.refresh(ensure_installed)