mirror of
https://github.com/josean-dev/dev-environment-files.git
synced 2025-01-08 17:21:23 +01:00
refactor(lspconfig): function for default server config
This commit is contained in:
parent
1bcf8bfd53
commit
1107f97277
1 changed files with 18 additions and 34 deletions
|
@ -70,30 +70,26 @@ return {
|
||||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- configure html server
|
-- configure list of servers with default configs
|
||||||
lspconfig["html"].setup({
|
local servers = {
|
||||||
capabilities = capabilities,
|
"html",
|
||||||
on_attach = on_attach,
|
"tsserver",
|
||||||
})
|
"cssls",
|
||||||
|
"tsserver",
|
||||||
|
"tailwindcss",
|
||||||
|
"prismals",
|
||||||
|
"pyright",
|
||||||
|
}
|
||||||
|
|
||||||
-- configure typescript server with plugin
|
for _, lsp in ipairs(servers) do
|
||||||
lspconfig["tsserver"].setup({
|
lspconfig[lsp].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
end
|
||||||
-- configure css server
|
|
||||||
lspconfig["cssls"].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- configure tailwindcss server
|
|
||||||
lspconfig["tailwindcss"].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
|
-- Here the servers with custom configs.
|
||||||
|
--
|
||||||
-- configure svelte server
|
-- configure svelte server
|
||||||
lspconfig["svelte"].setup({
|
lspconfig["svelte"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
@ -111,12 +107,6 @@ return {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure prisma orm server
|
|
||||||
lspconfig["prismals"].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- configure graphql language server
|
-- configure graphql language server
|
||||||
lspconfig["graphql"].setup({
|
lspconfig["graphql"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
@ -131,12 +121,6 @@ return {
|
||||||
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
|
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
|
||||||
})
|
})
|
||||||
|
|
||||||
-- configure python server
|
|
||||||
lspconfig["pyright"].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- configure lua server (with special settings)
|
-- configure lua server (with special settings)
|
||||||
lspconfig["lua_ls"].setup({
|
lspconfig["lua_ls"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
|
Loading…
Reference in a new issue