From f845a7b0588559750b1cb7eede1b3aecb450cdfe Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 1 May 2022 23:06:03 +0200 Subject: style: fmt with fnlfmt --- fnl/config/lsp/handlers.fnl | 106 +++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 56 deletions(-) (limited to 'fnl/config/lsp/handlers.fnl') diff --git a/fnl/config/lsp/handlers.fnl b/fnl/config/lsp/handlers.fnl index 34e1ac7..04f8297 100644 --- a/fnl/config/lsp/handlers.fnl +++ b/fnl/config/lsp/handlers.fnl @@ -1,66 +1,60 @@ ;; Handlers for the requests and responses from and to the lsp server. -(module config.lsp.handlers - {autoload {util util - nvim aniseed.nvim}}) +(module config.lsp.handlers {autoload {util util nvim aniseed.nvim}}) -(def- signs - [{:name :DiagnosticSignError :text ""} - {:name :DiagnosticSignWarn :text ""} - {:name :DiagnosticSignHint :text ""} - {:name :DiagnosticSignInfo :text ""}]) +(def- signs [{:name :DiagnosticSignError :text ""} + {:name :DiagnosticSignWarn :text ""} + {:name :DiagnosticSignHint :text ""} + {:name :DiagnosticSignInfo :text ""}]) -(defn- apply-signs [] - (each [_ sign (ipairs signs)] - (vim.fn.sign_define sign.name - {:texthl sign.name - :text sign.text - :numhl ""}))) +(defn- apply-signs [] (each [_ sign (ipairs signs)] + (vim.fn.sign_define sign.name + {:texthl sign.name + :text sign.text + :numhl ""}))) -(def- config - {:virtual_text false - :signs {:active signs} - :update_in_insert true - :underline true - :severity_sort true - :float {:focusable false - :style :minimal - :border :rounded - :source :always - :header "" - :prefix ""}}) +(def- config {:virtual_text false + :signs {:active signs} + :update_in_insert true + :underline true + :severity_sort true + :float {:focusable false + :style :minimal + :border :rounded + :source :always + :header "" + :prefix ""}}) -(defn setup [] - (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 setup [] (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}] - (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))) + (let [opts {:noremap true :silent true}] + (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) - (set client.resolved_capabilities.document_formatting false)) - (lsp-keymaps bufnr)) +(defn on-attach [client bufnr] (if (= client.name :html) + (set client.resolved_capabilities.document_formatting + false)) + (lsp-keymaps bufnr)) (defn capabilities [] - (let [capabilities (vim.lsp.protocol.make_client_capabilities)] - (set capabilities.textDocument.completion.completionItem.snippetSupport true) - (let [cmp-nvim-lsp (util.load-plugin :cmp_nvim_lsp)] - (cmp-nvim-lsp.update_capabilities capabilities)))) + (let [capabilities (vim.lsp.protocol.make_client_capabilities)] + (set capabilities.textDocument.completion.completionItem.snippetSupport + true) + (let [cmp-nvim-lsp (util.load-plugin :cmp_nvim_lsp)] + (cmp-nvim-lsp.update_capabilities capabilities)))) -- cgit v1.2.3-70-g09d2