30 lines
1.3 KiB
Lua
30 lines
1.3 KiB
Lua
local lsp = require("lsp.config.lsp_servers")
|
||
|
||
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 = lsp.lsp_servers,
|
||
|
||
-- 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<string, fun(server_name: string)>?
|
||
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 {}
|
||
-- -- ...
|