diff options
Diffstat (limited to '')
| -rw-r--r-- | dot_config/nvim/fnl/plugins/lsp/init.fnl | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/dot_config/nvim/fnl/plugins/lsp/init.fnl b/dot_config/nvim/fnl/plugins/lsp/init.fnl index 445eae1..0522c32 100644 --- a/dot_config/nvim/fnl/plugins/lsp/init.fnl +++ b/dot_config/nvim/fnl/plugins/lsp/init.fnl @@ -1,4 +1,6 @@ (import-macros {:mixed-table · : recc} :toast.macros) +(local {: assoc} (require :toast.core)) +(local {: executable?} (require :toast.nvim)) (fn gopts [plist] {:clangd {} @@ -16,20 +18,13 @@ :zls {}}) (local attach (require :plugins.lsp.attach)) -(local caps (require :plugins.lsp.capabilities)) [(· :neovim/nvim-lspconfig & :config (fn [_ opts] (each [k v (pairs opts)] - (set v.on_attach (or attach v.on_attach)) - (when (= :table (type caps)) - (set v.capabilities (or v.capabilities caps))) (let [s (. (require :lspconfig) k) - c (or v.cmd s.document_config.default_config.cmd)] - (when (not= 0 (vim.fn.executable (. c 1))) - (s.setup v))))) - :opts (fn [] - (let [plist (fn [...] - (local p (recc :lspconfig.util :root_pattern ...)) - #(p $))] - (gopts plist))))] + c (or v.cmd s.document_config.default_config.cmd) + att (or attach v.on_attach)] + (when (executable? (. c 1)) + (s.setup (assoc v :on_attach att)))))) + :opts #(gopts (partial recc :lspconfig.util :root_pattern)))] |
