diff options
author | aktersnurra <grydholm@kth.se> | 2022-04-10 23:34:21 +0200 |
---|---|---|
committer | aktersnurra <grydholm@kth.se> | 2022-04-10 23:34:21 +0200 |
commit | be910efb9e059a962cffc030dec7ea1ea3771e7c (patch) | |
tree | ce6733d6167b7d3ee3852530437b21656bbee81f | |
parent | a8ef65821f7fd7e2cdae39579e4a7dfabd75e58a (diff) |
fix(lsp): remove do add opts return
-rw-r--r-- | fnl/config/lsp/handlers.fnl | 27 | ||||
-rw-r--r-- | fnl/config/lsp/init.fnl | 5 | ||||
-rw-r--r-- | fnl/config/lsp/lsp-installer.fnl | 5 | ||||
-rw-r--r-- | fnl/config/lsp/null-ls.fnl | 4 | ||||
-rw-r--r-- | fnl/config/lsp/settings/pyright.fnl | 2 | ||||
-rw-r--r-- | fnl/config/lsp/settings/sumneko-lua.fnl | 2 |
6 files changed, 21 insertions, 24 deletions
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 "<cmd>lua vim.lsp.buf.declaration()<CR>" opts) - (nvim.buf_set_keymap bufnr :n :gd "<cmd>lua vim.lsp.buf.definition()<CR>" opts) - (nvim.buf_set_keymap bufnr :n :K "<cmd>lua vim.lsp.buf.hover()<CR>" opts) - (nvim.buf_set_keymap bufnr :n :gI "<cmd>lua vim.lsp.buf.implementation()<CR>" opts) - (nvim.buf_set_keymap bufnr :n :gr "<cmd>lua vim.lsp.buf.references()<CR>" opts) - (nvim.buf_set_keymap bufnr :n :gl "<cmd>lua vim.diagnostic.open_float()<CR>" opts) - (nvim.buf_set_keymap bufnr :n :<leader>q "<cmd>lua vim.diagnostic.setloclist()<CR>" opts)))) + (nvim.buf_set_keymap bufnr :n :gD "<cmd>lua vim.lsp.buf.declaration()<CR>" opts) + (nvim.buf_set_keymap bufnr :n :gd "<cmd>lua vim.lsp.buf.definition()<CR>" opts) + (nvim.buf_set_keymap bufnr :n :K "<cmd>lua vim.lsp.buf.hover()<CR>" opts) + (nvim.buf_set_keymap bufnr :n :gI "<cmd>lua vim.lsp.buf.implementation()<CR>" opts) + (nvim.buf_set_keymap bufnr :n :gr "<cmd>lua vim.lsp.buf.references()<CR>" opts) + (nvim.buf_set_keymap bufnr :n :gl "<cmd>lua vim.diagnostic.open_float()<CR>" opts) + (nvim.buf_set_keymap bufnr :n :<leader>q "<cmd>lua vim.diagnostic.setloclist()<CR>" 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) |