.dotfiles/nvim/lua/configs/lspconfig.lua

36 lines
787 B
Lua
Raw Normal View History

2024-04-01 10:41:54 +03:00
-- EXAMPLE
local on_attach = require("nvchad.configs.lspconfig").on_attach
local on_init = require("nvchad.configs.lspconfig").on_init
local capabilities = require("nvchad.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
-- local servers = { "gopls" }
-- lsps with default config
-- for _, lsp in ipairs(servers) do
-- lspconfig[lsp].setup {
-- on_attach = on_attach,
-- on_init = on_init,
-- capabilities = capabilities,
-- }
-- end
--
lspconfig.gopls.setup({
settings = {
gopls = {
analyses = {
unusedparams = true,
},
staticcheck = true,
gofumpt = true,
},
},
})
-- typescript
-- lspconfig.tsserver.setup {
-- on_attach = on_attach,
-- on_init = on_init,
-- capabilities = capabilities,
-- }