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 inlay_hints = { enabled = false },
16 -- Automatically format on save
17 -- autoformat = false,
18 -- LSP Server Settings
19 ---@type lspconfig.options
25 disable = { "missing-fields", },
30 -- Add clangd extensions
31 -- https://github.com/p00f/clangd_extensions.nvim
33 -- you can do any additional lsp server setup here
34 -- return true if you don't want this server to be setup with lspconfig
35 ---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
37 -- example to setup with typescript.nvim
38 -- tsserver = function(_, opts)
39 -- require("typescript").setup({ server = opts })
42 -- Specify * to use this function as a fallback for any server
43 -- ["*"] = function(server, opts) end,
48 -- cmdline tools and lsp servers
51 "williamboman/mason.nvim",
53 keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } },
61 ---@param opts MasonSettings | {ensure_installed: string[]}
62 config = function(_, opts)
63 require("mason").setup(opts)
64 local mr = require("mason-registry")
65 local function ensure_installed()
66 for _, tool in ipairs(opts.ensure_installed) do
67 local p = mr.get_package(tool)
68 if not p:is_installed() then
74 mr.refresh(ensure_installed)