nvim: 調整 lsp_servers 結構將清單拉出來,並增加判斷是否有go執行環境

This commit is contained in:
2025-05-05 22:19:11 +08:00
parent f451e0e0fa
commit 1d824b92c0
3 changed files with 34 additions and 28 deletions

View File

@@ -1,21 +1,11 @@
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 = {
-- "lua_ls", "rust_analyzer" -- 官方範例
"phpactor",
"sqls",
"pyright",
"gopls",
"html",
"cssls",
"volar",
-- "ts_ls",
"marksman",
"yamlls",
},
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.