From be910efb9e059a962cffc030dec7ea1ea3771e7c Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sun, 10 Apr 2022 23:34:21 +0200 Subject: fix(lsp): remove do add opts return --- fnl/config/lsp/handlers.fnl | 27 ++++++++++++++------------- fnl/config/lsp/init.fnl | 5 ++--- fnl/config/lsp/lsp-installer.fnl | 5 +++-- fnl/config/lsp/null-ls.fnl | 4 ++-- fnl/config/lsp/settings/pyright.fnl | 2 -- fnl/config/lsp/settings/sumneko-lua.fnl | 2 -- 6 files changed, 21 insertions(+), 24 deletions(-) (limited to 'fnl/config/lsp') diff --git a/fnl/config/lsp/handlers.fnl b/fnl/config/lsp/handlers.fnl index 6c3566e..950f3fb 100644 --- a/fnl/config/lsp/handlers.fnl +++ b/fnl/config/lsp/handlers.fnl @@ -29,22 +29,21 @@ :prefix ""}}) (defn setup [] - (do - (apply-signs) - (vim.diagnostic.config config) - (set vim.lsp.handlers.textDocument/hover (vim.lsp.with { :border "rounded"} )) - (set vim.lsp.handlers.textDocument/signatureHelp (vim.lsp.with vim.lsp.handlers.signature_help { :border "rounded"} )))) + (apply-signs) + (vim.diagnostic.config config) + (set vim.lsp.handlers.textDocument/hover (vim.lsp.with { :border "rounded"} )) + (set vim.lsp.handlers.textDocument/signatureHelp + (vim.lsp.with vim.lsp.handlers.signature_help { :border "rounded"} ))) (defn- lsp-keymaps [bufnr] (let [opts { :noremap true :silent true }] - (do - (nvim.buf_set_keymap bufnr :n :gD "lua vim.lsp.buf.declaration()" opts) - (nvim.buf_set_keymap bufnr :n :gd "lua vim.lsp.buf.definition()" opts) - (nvim.buf_set_keymap bufnr :n :K "lua vim.lsp.buf.hover()" opts) - (nvim.buf_set_keymap bufnr :n :gI "lua vim.lsp.buf.implementation()" opts) - (nvim.buf_set_keymap bufnr :n :gr "lua vim.lsp.buf.references()" opts) - (nvim.buf_set_keymap bufnr :n :gl "lua vim.diagnostic.open_float()" opts) - (nvim.buf_set_keymap bufnr :n :q "lua vim.diagnostic.setloclist()" opts)))) + (nvim.buf_set_keymap bufnr :n :gD "lua vim.lsp.buf.declaration()" opts) + (nvim.buf_set_keymap bufnr :n :gd "lua vim.lsp.buf.definition()" opts) + (nvim.buf_set_keymap bufnr :n :K "lua vim.lsp.buf.hover()" opts) + (nvim.buf_set_keymap bufnr :n :gI "lua vim.lsp.buf.implementation()" opts) + (nvim.buf_set_keymap bufnr :n :gr "lua vim.lsp.buf.references()" opts) + (nvim.buf_set_keymap bufnr :n :gl "lua vim.diagnostic.open_float()" opts) + (nvim.buf_set_keymap bufnr :n :q "lua vim.diagnostic.setloclist()" opts))) (defn on-attach [client bufnr] (if (= client.name :html) @@ -57,3 +56,5 @@ (let [cmp-nvim-lsp (util.load-plugin :cmp_nvim_lsp)] (cmp-nvim-lsp.update_capabilities capabilities)) capabilities)) + +(setup) diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl index aa61f61..b26dd7a 100644 --- a/fnl/config/lsp/init.fnl +++ b/fnl/config/lsp/init.fnl @@ -3,7 +3,6 @@ {autoload {util util}}) (let [_ (util.load-plugin :lspconfig)] - (do (require :config.lsp.lsp-installer) - ((require :config.lsp.handlers).setup) - (require :config.lsp.null-ls))) + (require :config.lsp.handlers) + (require :config.lsp.null-ls)) diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl index 116f637..3649566 100644 --- a/fnl/config/lsp/lsp-installer.fnl +++ b/fnl/config/lsp/lsp-installer.fnl @@ -13,10 +13,11 @@ (vim.tbl_deep_extend :force jsonls-opts opts))) (when (= server.name :sumneko_lua) (let [sumneko-lua-opts (require :config.lsp.settings.sumneko-lua)] - (vim.tbl_deep_extend :force sumneko-lua-opts opts))) + (vim.tbl_deep_extend :force sumneko-lua-opts.settings opts))) (when (= server.name :pyright) (let [pyright-opts (require :config.lsp.settings.pyright)] - (vim.tbl_deep_extend :force pyright-opts opts)))) + (vim.tbl_deep_extend :force pyright-opts.settings opts))) + opts) (let [lsp-installer (util.load-plugin :nvim-lsp-installer)] diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl index d1f1af1..c5b4aef 100644 --- a/fnl/config/lsp/null-ls.fnl +++ b/fnl/config/lsp/null-ls.fnl @@ -13,14 +13,14 @@ diagnostics.jsonlint diagnostics.shellcheck diagnostics.yamllint - (formatting.black.with { extra_args [ "--fast" ] }) + (formatting.black.with { :extra_args [ "--fast" ] }) formatting.erlfmt formatting.fourmolu formatting.gofmt formatting.goimports formatting.nixfmt (formatting.prettier.with { - extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ] + :extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ] }) formatting.rustfmt formatting.shfmt diff --git a/fnl/config/lsp/settings/pyright.fnl b/fnl/config/lsp/settings/pyright.fnl index 369fa36..bb39ab5 100644 --- a/fnl/config/lsp/settings/pyright.fnl +++ b/fnl/config/lsp/settings/pyright.fnl @@ -6,5 +6,3 @@ {:python {:analysis {:typeCheckingMode "off"}}}}) - -(settings) diff --git a/fnl/config/lsp/settings/sumneko-lua.fnl b/fnl/config/lsp/settings/sumneko-lua.fnl index 5498f7e..e39c801 100644 --- a/fnl/config/lsp/settings/sumneko-lua.fnl +++ b/fnl/config/lsp/settings/sumneko-lua.fnl @@ -17,5 +17,3 @@ :Lua { :diagnostics diagnostics :workspace workspace}}}) - -(settings) -- cgit v1.2.3-70-g09d2