aboutsummaryrefslogtreecommitdiffstats
path: root/lua/alpha/lsp/servers.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/alpha/lsp/servers.lua')
-rw-r--r--lua/alpha/lsp/servers.lua101
1 files changed, 88 insertions, 13 deletions
diff --git a/lua/alpha/lsp/servers.lua b/lua/alpha/lsp/servers.lua
index fc18153..56e4a76 100644
--- a/lua/alpha/lsp/servers.lua
+++ b/lua/alpha/lsp/servers.lua
@@ -1,15 +1,90 @@
+local lsp_attach = require "alpha.lsp.attach"
+
+local lsp_flags = {
+ debounce_text_changes = 150,
+}
+
+local default = function()
+ return {
+ on_attach = lsp_attach,
+ flags = lsp_flags,
+ }
+ end
+
return {
- "emmet_ls",
- "gopls",
- "html",
- "jsonls",
- "lua_ls",
- "marksman",
- "nil_ls",
- "phpactor",
- "rust_analyzer",
- "svelte",
- "tailwindcss",
- "tsserver",
- "volar",
+ ["emmet_ls"] = function()
+ local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
+
+ return {
+ on_attach = lsp_attach,
+ flags = lsp_flags,
+ capabilities = capabilities,
+ filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "blade", "vue" },
+ }
+ end,
+ ["gopls"] = function()
+ return {
+ on_attach = lsp_attach,
+ flags = lsp_flags,
+ }
+ end,
+ ["html"] = default,
+ ["jsonls"] = default,
+ ["lua_ls"] = function()
+ return {
+ on_attach = lsp_attach,
+ flags = lsp_flags,
+ settings = {
+ Lua = {
+ runtime = {
+ version = "LuaJIT",
+ },
+ diagnostics = {
+ globals = { "vim" },
+ },
+ workspace = {
+ library = vim.api.nvim_get_runtime_file("", true),
+ checkThirdParty = false,
+ },
+ telemetry = {
+ enable = false,
+ },
+ },
+ },
+ }
+ end,
+ ["marksman"] = default,
+ ["nil_ls"] = default,
+ ["phpactor"] = function()
+ return {
+ on_attach = lsp_attach,
+ flags = lsp_flags,
+ filetypes = { "php", "cucumber" },
+ }
+ end,
+ ["rust_analyzer"] = function()
+ return {
+ on_attach = lsp_attach,
+ flags = lsp_flags,
+ settings = {
+ ["rust-analyzer"] = {
+ checkOnSave = {
+ allFeatures = true,
+ overrideCommand = {
+ "cargo",
+ "clippy",
+ "--workspace",
+ "--message-format=json",
+ "--all-targets",
+ "--all-features",
+ },
+ },
+ },
+ },
+ }
+ end,
+ ["svelte"] = default,
+ ["tailwindcss"] = default,
+ ["tsserver"] = default,
+ ["volar"] = default,
}