mirror of https://github.com/NvChad/NvChad
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
948 B
Lua
34 lines
948 B
Lua
local on_attach = require("plugins.configs.lspconfig").on_attach
|
|
local capabilities = require("plugins.configs.lspconfig").capabilities
|
|
|
|
local lspconfig = require "lspconfig"
|
|
|
|
-- if you just want default config for the servers then put them in a table
|
|
local servers = { "html", "cssls", "tsserver", "clangd", "pyright", "yamlls", "gopls", "bashls", "terraformls" }
|
|
|
|
for _, lsp in ipairs(servers) do
|
|
lspconfig[lsp].setup {
|
|
on_attach = on_attach,
|
|
capabilities = capabilities,
|
|
}
|
|
end
|
|
local util = require "lspconfig/util"
|
|
lspconfig.gopls.setup {
|
|
on_attach = on_attach,
|
|
capabilities = capabilities,
|
|
cmd = { "gopls" },
|
|
filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
|
root_dir = util.root_pattern("go.work", "go.mod", ".git"),
|
|
settings = {
|
|
gopls = {
|
|
completeUnimported = true,
|
|
usePlaceholders = true,
|
|
analyses = {
|
|
unusedparams = true,
|
|
},
|
|
},
|
|
},
|
|
}
|
|
--
|
|
-- lspconfig.pyright.setup { blabla}
|