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,3 +1,5 @@
local servers = require("lsp.config.lsp_servers").lsp_servers
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
@@ -9,21 +11,6 @@ local on_attach = function(_, bufnr)
map("n", "K", vim.lsp.buf.hover)
end
-- 程式語言所需要的與語言伺服器名稱對照表
-- <https://wiki.archlinux.org/title/Language_Server_Protocol>
local servers = {
"phpactor", -- PHP
"sqls", -- SQL
"pyright", -- Python
"gopls", -- Go
"html", -- HTML
"cssls", -- CSS
"volar", -- Vue3
-- "ts_ls", -- TypeScript目前暫時不需要先註解掉
"marksman", -- Markdown
"yamlls", -- YAML
}
-- 載入所有的對應的 LSP server 設定
--
-- 相關設定請看