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 }
17 update_in_insert = false,
26 [vim.diagnostic.severity.ERROR] = " ",
27 [vim.diagnostic.severity.WARN] = " ",
28 [vim.diagnostic.severity.HINT] = " ",
29 [vim.diagnostic.severity.INFO] = " ",
33 inlay_hints = { enabled = false, },
34 codelens = { enabled = false, },
35 document_highlight = { enabled = true, },
45 formatting_options = nil,
48 -- Automatically format on save
49 -- autoformat = false,
50 -- LSP Server Settings
51 ---@type lspconfig.options
56 workspace = { checkThirdParty = false, },
57 codeLens = { enable = true, },
58 completion = { callSnippet = "Replace", },
59 doc = { privateName = { "^_" }, },
64 paramName = "Disable",
65 semicolon = "Disable",
66 arrayIndex = "Disable",
69 disable = { "missing-fields", },
74 -- Add clangd extensions
75 -- https://github.com/p00f/clangd_extensions.nvim
77 -- you can do any additional lsp server setup here
78 -- return true if you don't want this server to be setup with lspconfig
79 ---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
81 -- example to setup with typescript.nvim
82 -- tsserver = function(_, opts)
83 -- require("typescript").setup({ server = opts })
86 -- Specify * to use this function as a fallback for any server
87 -- ["*"] = function(server, opts) end,
92 -- cmdline tools and lsp servers
95 "williamboman/mason.nvim",
97 keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } },
105 ---@param opts MasonSettings | {ensure_installed: string[]}
106 config = function(_, opts)
107 require("mason").setup(opts)
108 local mr = require("mason-registry")
109 local function ensure_installed()
110 for _, tool in ipairs(opts.ensure_installed) do
111 local p = mr.get_package(tool)
112 if not p:is_installed() then
118 mr.refresh(ensure_installed)