style(lsp-config.lua): improve code formatting for better readability

feat(lsp-config.lua): add configuration for astro and kotlin language servers to enhance language support
This commit is contained in:
David Ibia
2024-06-21 12:54:20 +01:00
parent b1737abd9d
commit 2e5c3a7f35

View File

@@ -7,7 +7,7 @@ local on_attach = function(client, bufnr)
opts.buffer = bufnr opts.buffer = bufnr
-- Enable completion triggered by <c-x><c-o> -- Enable completion triggered by <c-x><c-o>
-- vim.bo[opts.buffer].omnifunc = "v:lua.vim.lsp.omnifunc" vim.bo[opts.buffer].omnifunc = "v:lua.vim.lsp.omnifunc"
opts.desc = "Go to declaration" opts.desc = "Go to declaration"
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
@@ -54,7 +54,13 @@ end
local capabilities = cmp_nvim_lsp.default_capabilities() local capabilities = cmp_nvim_lsp.default_capabilities()
-- Change the Diagnostic symbols in the sign column (gutter) -- Change the Diagnostic symbols in the sign column (gutter)
local signs = { Error = "", Warn = "", Hint = "󰠠 ", Info = "" } local signs = {
Error = "",
Warn = "",
Hint = "󰠠 ",
Info = "",
}
for type, icon in pairs(signs) do for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
@@ -214,6 +220,19 @@ lspconfig["eslint"].setup({
on_attach = on_attach, on_attach = on_attach,
}) })
-- configure astro server
lspconfig["astro"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- configure kotlin server
lspconfig["kotlin_language_server"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- configure biome server -- configure biome server
lspconfig["biome"].setup({ lspconfig["biome"].setup({
capabilities = capabilities, capabilities = capabilities,