From fb1de6d77474e283c47eca595d43d984e5c7a6f9 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Mon, 14 Nov 2022 09:14:28 -0800 Subject: [PATCH] fennel-ls --- .config/nvim/fnl/lsp.fnl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.config/nvim/fnl/lsp.fnl b/.config/nvim/fnl/lsp.fnl index a358b1b..5ae23b2 100644 --- a/.config/nvim/fnl/lsp.fnl +++ b/.config/nvim/fnl/lsp.fnl @@ -1,5 +1,18 @@ +(local lspconfig (require :lspconfig)) (local {: lsp} vim) +;;; fennel-ls + +(let [configs (require :lspconfig.configs)] + (tset configs :fennel-ls + {:default_config {:cmd [:/opt/homebrew/bin/fennel-ls] + :filetypes [:fennel] + :root_dir #(lspconfig.util.find_git_ancestor $1) + :settings {}}})) + +(let [{: fennel-ls} lspconfig] + (fennel-ls.setup (vim.lsp.protocol.make_client_capabilities))) + ;; (lsp.set_log_level :debug) ;; default hover windows to have borders @@ -47,8 +60,7 @@ (set client.resolved_capabilities.document_formatting false)) (fn setup-lsp [lsp config] - (let [lspconfig (require :lspconfig) - {: setup} (. lspconfig lsp)] + (let [{: setup} (. lspconfig lsp)] (setup (or config {:on_attach on-attach})))) (let [fmt #{:formatCommand $1 :formatStdin true} @@ -84,6 +96,7 @@ :typescriptreact :vue]}) (setup-lsp :elmls) + (setup-lsp :fennel-ls) (setup-lsp :pylsp {:on_attach (on-attach-do attach-navic disable-fmt)}) (setup-lsp :pyright {:on_attach on-attach @@ -95,3 +108,4 @@ (setup-lsp :tsserver {:on_attach (on-attach-do attach-navic disable-fmt)}) (setup-lsp :typeprof) (setup-lsp :vuels {:on_attach (on-attach-do attach-navic disable-fmt)})) +