From e3ef0791e7462c95c77ec9014d92ec97484789c8 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 5 Jan 2023 02:52:05 +0100 Subject: Refactor lsp --- fnl/config/lsp/diagnostics.fnl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 fnl/config/lsp/diagnostics.fnl (limited to 'fnl/config/lsp/diagnostics.fnl') diff --git a/fnl/config/lsp/diagnostics.fnl b/fnl/config/lsp/diagnostics.fnl new file mode 100644 index 0000000..adf098d --- /dev/null +++ b/fnl/config/lsp/diagnostics.fnl @@ -0,0 +1,32 @@ +;; Handlers for the requests and responses from and to the lsp server. +(module config.lsp.handlers {autoload {util config.util nvim aniseed.nvim}}) + +(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 ""}))) + +(def- config {:virtual_text false + :signs {:active signs} + :update_in_insert false + :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 :width 60})) + (set vim.lsp.handlers.textDocument/signatureHelp + (vim.lsp.with vim.lsp.handlers.signature_help + {:border :rounded :width 60}))) -- cgit v1.2.3-70-g09d2