mirror of
https://github.com/tuxdotrs/tnvim.git
synced 2025-10-10 11:41:54 +05:30
refactor(lsp): migrate to built in lsp server
This commit is contained in:
@@ -1,23 +1,7 @@
|
|||||||
local configs = require("nvchad.configs.lspconfig")
|
local servers = { "eslint", "gopls", "templ", "pyright", "ruff", "svelte", "tailwindcss", "nil_ls", "html", "htmx" }
|
||||||
local on_attach = configs.on_attach
|
|
||||||
local capabilities = configs.capabilities
|
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
vim.lsp.config("nil_ls", {
|
||||||
|
|
||||||
local servers = { "eslint", "gopls", "templ", "pyright", "ruff", "svelte" }
|
|
||||||
|
|
||||||
for _, lsp in ipairs(servers) do
|
|
||||||
lspconfig[lsp].setup({
|
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
lspconfig.nil_ls.setup({
|
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
filetypes = { "nix" },
|
filetypes = { "nix" },
|
||||||
cmd = { "nil" },
|
|
||||||
settings = {
|
settings = {
|
||||||
["nil"] = {
|
["nil"] = {
|
||||||
flake = {
|
flake = {
|
||||||
@@ -27,21 +11,12 @@ lspconfig.nil_ls.setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.html.setup({
|
vim.lsp.config("html", {
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
filetypes = { "html", "templ" },
|
filetypes = { "html", "templ" },
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.htmx.setup({
|
vim.lsp.config("htmx", {
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
filetypes = { "html", "templ" },
|
filetypes = { "html", "templ" },
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.tailwindcss.setup({
|
vim.lsp.enable(servers)
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
filetypes = { "templ", "astro", "javascript", "typescript", "react", "typescriptreact", "svelte" },
|
|
||||||
init_options = { userLanguages = { templ = "html" } },
|
|
||||||
})
|
|
||||||
|
Reference in New Issue
Block a user