nvim: 調整 lsp_servers 結構將清單拉出來,並增加判斷是否有go執行環境
This commit is contained in:
@@ -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 設定
|
||||
--
|
||||
-- 相關設定請看
|
||||
|
||||
Reference in New Issue
Block a user