dotfiles/mzte-nv/conf/lua/pluginconf/p-lspconf.fnl

60 lines
2.2 KiB
Text
Raw Normal View History

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 {}))
2023-02-23 13:56:06 +01:00
(when (not (. args :on_attach))
(tset args :on_attach `check-conjure))
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})
(fn disable-formatter [client _]
(tset client :server_capabilities :documentFormattingRangeProvider false))
2023-05-07 15:53:25 +02:00
(setup :cl-lsp)
2023-02-23 13:56:06 +01:00
(setup :clangd {:on_attach (fn [c b] (disable-formatter c b)
(check-conjure c b))})
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)
(setup :haxe_language_server)
(setup :html)
(setup :jsonls)
(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}}}})
(setup :ocamllsp)
(setup :prosemd_lsp)
(setup :racket_langserver)
(setup :rust_analyzer
{:settings {:rust-analyzer {:checkOnSave {:command :clippy}}}})
(setup :taplo)
(setup :yamlls)
(setup :zls)