require("mason").setup() require("mason-lspconfig").setup { -- A list of servers to automatically install if they're not already installed. Example: { "rust_analyzer@nightly", "lua_ls" } -- This setting has no relation with the `automatic_installation` setting. ---@type string[] ensure_installed = { -- "lua_ls", "rust_analyzer" -- 官方範例 "phpactor", "sqls", "pyright", "gopls", "html", "cssls", "volar", -- "ts_ls", "marksman", "yamlls", }, -- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed. -- This setting has no relation with the `ensure_installed` setting. -- Can either be: -- - false: Servers are not automatically installed. -- - true: All servers set up via lspconfig are automatically installed. -- - { exclude: string[] }: All servers set up via lspconfig, except the ones provided in the list, are automatically installed. -- Example: automatic_installation = { exclude = { "rust_analyzer", "solargraph" } } ---@type boolean automatic_installation = false, -- See `:h mason-lspconfig.setup_handlers()` ---@type table? handlers = nil, } -- 下面這段先註解掉,由lspconfig.lua來處理 -- -- After setting up mason-lspconfig you may set up servers via lspconfig -- require("lspconfig").lua_ls.setup {} -- require("lspconfig").rust_analyzer.setup {} -- -- ...