4 "neovim/nvim-lspconfig",
5 ---@class PluginLspOpts
7 local keys = require("lazyvim.plugins.lsp.keymaps").get()
8 -- TODO: setup a new mapping for this
9 -- { "gr", "<cmd>Telescope lsp_references<cr>", desc = "References" },
10 keys[#keys+1] = { "gr", false }
15 update_in_insert = false,
24 [vim.diagnostic.severity.ERROR] = " ",
25 [vim.diagnostic.severity.WARN] = " ",
26 [vim.diagnostic.severity.HINT] = " ",
27 [vim.diagnostic.severity.INFO] = " ",
31 inlay_hints = { enabled = false, },
32 codelens = { enabled = false, },
33 document_highlight = { enabled = true, },
43 formatting_options = nil,
46 -- Automatically format on save
47 -- autoformat = false,
48 -- LSP Server Settings
49 ---@type lspconfig.options
54 workspace = { checkThirdParty = false, },
55 codeLens = { enable = true, },
56 completion = { callSnippet = "Replace", },
57 doc = { privateName = { "^_" }, },
62 paramName = "Disable",
63 semicolon = "Disable",
64 arrayIndex = "Disable",
67 disable = { "missing-fields", },
72 -- Add clangd extensions
73 -- https://github.com/p00f/clangd_extensions.nvim
75 -- you can do any additional lsp server setup here
76 -- return true if you don't want this server to be setup with lspconfig
77 ---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
79 -- example to setup with typescript.nvim
80 -- tsserver = function(_, opts)
81 -- require("typescript").setup({ server = opts })
84 -- Specify * to use this function as a fallback for any server
85 -- ["*"] = function(server, opts) end,
91 -- cmdline tools and lsp servers
94 "williamboman/mason.nvim",
96 keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } },
104 ---@param opts MasonSettings | {ensure_installed: string[]}
105 config = function(_, opts)
106 require("mason").setup(opts)
107 local mr = require("mason-registry")
108 local function ensure_installed()
109 for _, tool in ipairs(opts.ensure_installed) do
110 local p = mr.get_package(tool)
111 if not p:is_installed() then
117 mr.refresh(ensure_installed)