summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/lsp.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/lsp.lua')
-rw-r--r--.config/nvim/lua/lsp.lua96
1 files changed, 23 insertions, 73 deletions
diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua
index 89fbc58..1e9cdec 100644
--- a/.config/nvim/lua/lsp.lua
+++ b/.config/nvim/lua/lsp.lua
@@ -1,73 +1,23 @@
-local lspconfig = require('lspconfig')
-local capabilities = require('cmp_nvim_lsp').default_capabilities()
-
-local servers = require('language-servers')
-for name, config in pairs(servers) do
- if config == false then
- goto continue
- end
- if config == true then
- ---@diagnostic disable-next-line: cast-local-type
- config = {}
- end
-
- -- NOTE: there must be a better way to do it, but it will do for now
- if name == 'markdown_oxide' then
- ---@diagnostic disable-next-line: cast-local-type
- config = vim.tbl_deep_extend('force', {}, {
- capabilities = vim.tbl_deep_extend('force', capabilities, {
- workspace = {
- didChangeWatchedFiles = {
- dynamicRegistration = true,
- },
- },
- }),
- }, config)
- else
- ---@diagnostic disable-next-line: cast-local-type
- config = vim.tbl_deep_extend('force', {}, {
- capabilities = capabilities,
- }, config)
- end
-
- lspconfig[name].setup(config)
- ::continue::
-end
-
-vim.api.nvim_create_autocmd('LspAttach', {
- callback = function(args)
- local bufnr = args.buf
- local client = assert(vim.lsp.get_client_by_id(args.data.client_id), 'must have valid client')
-
- local settings = servers[client.name]
- if type(settings) ~= 'table' then
- ---@diagnostic disable-next-line: cast-local-type
- settings = {}
- end
-
- -- Override server capabilities
- if settings.server_capabilities then
- for k, v in pairs(settings.server_capabilities) do
- if v == vim.NIL then
- v = nil
- end
- client.server_capabilities[k] = v
- end
- end
-
- -- Workaround for semantic tokens apparently?
- -- https://www.lazyvim.org/extras/lang/go
- -- https://github.com/golang/go/issues/54531#issuecomment-1464982242
- if client.name == 'gopls' and not client.server_capabilities.semanticTokensProvider then
- local semantic = client.config.capabilities.textDocument.semanticTokens
- client.server_capabilities.semanticTokensProvider = {
- full = true,
- legend = { tokenModifiers = semantic.tokenModifiers, tokenTypes = semantic.tokenTypes },
- range = true,
- }
- end
-
- -- Register buffer local LSP keymaps
- require('lsp-keymaps').setup(bufnr)
- end,
-})
+return {
+ asm_lsp = true,
+ astro = true,
+ basedpyright = true, -- python
+ bashls = true,
+ clangd = true,
+ cssls = true,
+ gopls = true,
+ html = true,
+ jsonls = true,
+ lemminx = true, -- xml
+ lua_ls = true,
+ markdown_oxide = true,
+ marksman = false, -- markdown
+ mdx_analyzer = true,
+ neocmake = true,
+ nil_ls = true, -- nix
+ tailwindcss = true,
+ taplo = true, -- toml
+ ts_ls = true, -- typescript and yavashit
+ yamlls = true,
+ zls = true, -- zig
+}