2024-07-29 05:04:34 -05:00
|
|
|
--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
|
2024-06-02 09:31:22 -05:00
|
|
|
|
2024-06-04 01:20:18 +00:00
|
|
|
local lspconfig = require("lspconfig")
|
2024-07-29 05:04:34 -05:00
|
|
|
local util = require("lspconfig/util")
|
2024-06-04 01:20:18 +00:00
|
|
|
--local servers = { "html", "cssls" }
|
2024-06-02 09:31:22 -05:00
|
|
|
|
|
|
|
|
-- lsps with default config
|
2024-06-04 01:20:18 +00:00
|
|
|
--for _, lsp in ipairs(servers) do
|
|
|
|
|
-- lspconfig[lsp].setup {
|
|
|
|
|
-- on_attach = on_attach,
|
|
|
|
|
-- on_init = on_init,
|
|
|
|
|
-- capabilities = capabilities,
|
|
|
|
|
-- }
|
|
|
|
|
--end
|
2024-06-02 09:31:22 -05:00
|
|
|
|
|
|
|
|
-- typescript
|
2024-07-29 05:04:34 -05:00
|
|
|
lspconfig.tsserver.setup({
|
2024-06-02 09:31:22 -05:00
|
|
|
on_attach = on_attach,
|
|
|
|
|
on_init = on_init,
|
|
|
|
|
capabilities = capabilities,
|
2024-07-29 05:04:34 -05:00
|
|
|
})
|
2024-06-04 01:20:18 +00:00
|
|
|
|
2024-07-29 05:04:34 -05:00
|
|
|
lspconfig.gopls.setup({
|
2024-06-04 01:20:18 +00:00
|
|
|
on_attach = on_attach,
|
|
|
|
|
capabilities = capabilities,
|
2024-07-29 05:04:34 -05:00
|
|
|
cmd = { "gopls" },
|
2024-06-04 01:20:18 +00:00
|
|
|
filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
|
|
|
|
root_dir = util.root_pattern("go.work", "go.mod", ".git"),
|
|
|
|
|
settings = {
|
|
|
|
|
gopls = {
|
|
|
|
|
completeUnimported = true,
|
|
|
|
|
usePlaceholders = true,
|
|
|
|
|
analyses = {
|
|
|
|
|
unusedparams = true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-07-29 05:04:34 -05:00
|
|
|
})
|
2024-06-04 01:20:18 +00:00
|
|
|
|
|
|
|
|
lspconfig.pyright.setup({
|
|
|
|
|
on_attach = on_attach,
|
|
|
|
|
capabilities = capabilities,
|
2024-07-29 05:04:34 -05:00
|
|
|
filetypes = { "python" },
|
2024-06-04 01:20:18 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
lspconfig.powershell_es.setup({
|
2025-09-27 07:13:57 -05:00
|
|
|
bundle_path = vim.fn.stdpath("data")
|
|
|
|
|
.. "/mason/packages/powershell-editor-services",
|
2024-06-04 01:20:18 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
lspconfig.bashls.setup({})
|
|
|
|
|
|
2025-09-27 07:13:57 -05:00
|
|
|
omnisharp_bin = vim.fn.stdpath("data")
|
|
|
|
|
.. "/mason/packages/omnisharp/omnisharp"
|
2024-06-04 01:20:18 +00:00
|
|
|
|
|
|
|
|
lspconfig.omnisharp.setup({
|
|
|
|
|
on_attach = on_attach,
|
|
|
|
|
capabilities = capabilities,
|
2024-07-29 05:04:34 -05:00
|
|
|
filetypes = { "cs" },
|
2025-09-27 07:13:57 -05:00
|
|
|
cmd = {
|
|
|
|
|
omnisharp_bin,
|
|
|
|
|
"--languageserver",
|
|
|
|
|
"--hostPID",
|
|
|
|
|
tostring(pid),
|
|
|
|
|
},
|
2024-06-04 01:20:18 +00:00
|
|
|
})
|