2024-01-18 18:23:20 +01:00
|
|
|
(local mztenv (require :mzte_nv))
|
2023-02-19 21:23:55 +01:00
|
|
|
(local lspc (require :lspconfig))
|
2023-05-07 15:53:25 +02:00
|
|
|
(local lsp-configs (require :lspconfig.configs))
|
2023-02-19 21:23:55 +01:00
|
|
|
|
|
|
|
(macro setup [conf args]
|
|
|
|
(var args args)
|
|
|
|
(when (not args)
|
|
|
|
(set args {}))
|
2024-01-18 18:23:20 +01:00
|
|
|
(tset args :on_attach (if args.on_attach
|
2024-02-26 16:19:03 +01:00
|
|
|
`(fn [client# bufnr#]
|
|
|
|
(mztenv.lsp.onAttach client# bufnr#)
|
2024-01-18 18:23:20 +01:00
|
|
|
(,args.on_attach client# bufnr#))
|
|
|
|
`mztenv.lsp.onAttach))
|
2023-02-19 21:23:55 +01:00
|
|
|
(tset args :capabilities `caps)
|
|
|
|
`((. lspc ,conf :setup) ,args))
|
|
|
|
|
2023-05-07 15:53:25 +02:00
|
|
|
(tset lsp-configs :cl-lsp {:default_config {:cmd [:cl-lsp]
|
2023-05-07 21:50:18 +02:00
|
|
|
:filetypes [:lisp :commonlisp]
|
2023-05-07 15:53:25 +02:00
|
|
|
:root_dir lspc.util.find_git_ancestor
|
|
|
|
:single_file_support true}
|
|
|
|
:settings {}})
|
|
|
|
|
2023-02-19 21:23:55 +01:00
|
|
|
(var caps
|
|
|
|
((. (require :cmp_nvim_lsp) :default_capabilities) (vim.lsp.protocol.make_client_capabilities)))
|
|
|
|
|
|
|
|
(tset caps :textDocument :foldingRange
|
|
|
|
{:dynamicRegistration false :lineFoldingOnly true})
|
|
|
|
|
2023-07-01 19:19:42 +02:00
|
|
|
(tset caps :offsetEncoding [:utf-8])
|
2023-06-16 16:01:20 +02:00
|
|
|
|
2023-02-19 21:23:55 +01:00
|
|
|
(fn disable-formatter [client _]
|
|
|
|
(tset client :server_capabilities :documentFormattingRangeProvider false))
|
|
|
|
|
2023-05-07 15:53:25 +02:00
|
|
|
(setup :cl-lsp)
|
2023-06-16 16:01:20 +02:00
|
|
|
(setup :clangd {:on_attach disable-formatter})
|
2023-04-22 17:26:08 +02:00
|
|
|
|
2023-02-19 21:23:55 +01:00
|
|
|
(setup :cssls)
|
|
|
|
(setup :elixirls {:cmd [:elixir-ls]})
|
|
|
|
(setup :eslint)
|
2024-01-26 18:39:29 +01:00
|
|
|
(setup :glsl_analyzer)
|
2023-02-19 21:23:55 +01:00
|
|
|
(setup :haxe_language_server)
|
|
|
|
(setup :html)
|
2023-10-28 18:42:22 +02:00
|
|
|
(setup :jsonls {:on_attach disable-formatter})
|
2023-02-19 21:23:55 +01:00
|
|
|
(setup :lua_ls {:settings {:Lua {:runtime {:version :LuaJIT
|
|
|
|
:path (do
|
|
|
|
(var p
|
|
|
|
(vim.split package.path
|
|
|
|
";"))
|
|
|
|
(table.insert p :lua/?.lua)
|
|
|
|
(table.insert p
|
|
|
|
:lua/?/init.lua))}
|
|
|
|
:diagnostics {:globals [:vim]}
|
|
|
|
:workspace [(vim.api.nvim_get_runtime_file ""
|
|
|
|
true)]
|
|
|
|
:telemetry {:enable false}}}})
|
|
|
|
|
2024-02-26 16:19:03 +01:00
|
|
|
(setup :nil_ls {:settings {:nil {:formatting {:command [:nixpkgs-fmt]}}}})
|
2023-02-19 21:23:55 +01:00
|
|
|
(setup :ocamllsp)
|
2024-04-01 23:16:53 +02:00
|
|
|
(setup :openscad_lsp)
|
2023-02-19 21:23:55 +01:00
|
|
|
(setup :prosemd_lsp)
|
|
|
|
(setup :racket_langserver)
|
|
|
|
(setup :rust_analyzer
|
|
|
|
{:settings {:rust-analyzer {:checkOnSave {:command :clippy}}}})
|
|
|
|
|
|
|
|
(setup :taplo)
|
|
|
|
(setup :zls)
|