diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-01-08 09:58:56 +0100 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-01-08 09:58:56 +0100 |
| commit | f7bcac5ee5db56081981bb946a66d3fc34807988 (patch) | |
| tree | 2cfc8d60054508d5297cd392d6df1e540057bcc7 /lua/alpha/lsp/setups.lua | |
| parent | fb9196e7766f53115009c081f0b4308ca6c081b4 (diff) | |
| download | nvim-conf-f7bcac5ee5db56081981bb946a66d3fc34807988.tar.gz nvim-conf-f7bcac5ee5db56081981bb946a66d3fc34807988.zip | |
feat: refactor lsp & cmp to lua folder from after
Diffstat (limited to 'lua/alpha/lsp/setups.lua')
| -rw-r--r-- | lua/alpha/lsp/setups.lua | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/lua/alpha/lsp/setups.lua b/lua/alpha/lsp/setups.lua new file mode 100644 index 0000000..646eec1 --- /dev/null +++ b/lua/alpha/lsp/setups.lua @@ -0,0 +1,65 @@ +local lsp_attach = require("alpha.lsp.attach") + +local lsp_flags = { + debounce_text_changes = 150, +} + +return setmetatable({ + rust_analyzer = function() + return { + on_attach = lsp_attach, + flags = lsp_flags, + settings = { + ["rust-analyzer"] = {}, + }, + } + end, + phpactor = function() + return { + on_attach = lsp_attach, + flags = lsp_flags, + filetypes = { "php", "cucumber" }, + } + end, + 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, + sumneko_lua = 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), + }, + telemetry = { + enable = false, + }, + }, + }, + } + end, +}, { + __index = function() + return function () + return { + on_attach = lsp_attach, + flags = lsp_flags, + } + end + end, +}) |