diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-01-11 00:41:17 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-01-11 00:41:17 +0100 |
commit | f318452070d42e51231f7880a5d0eaa93d978a1e (patch) | |
tree | c76f35889ebc7a4e52bbd06e07c8f33f9bf68f5d /fnl/plugins/lsp/diagnostics.fnl | |
parent | 433952cf3efa8e2b5e23ff0e76a4afe6f95d44b5 (diff) |
Rip aniseed, hail hotpot
Diffstat (limited to 'fnl/plugins/lsp/diagnostics.fnl')
-rw-r--r-- | fnl/plugins/lsp/diagnostics.fnl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/fnl/plugins/lsp/diagnostics.fnl b/fnl/plugins/lsp/diagnostics.fnl new file mode 100644 index 0000000..1ac2e42 --- /dev/null +++ b/fnl/plugins/lsp/diagnostics.fnl @@ -0,0 +1,33 @@ +;; Handlers for the requests and responses from and to the lsp server. + +(local signs [{:name :DiagnosticSignError :text ""} + {:name :DiagnosticSignWarn :text ""} + {:name :DiagnosticSignHint :text ""} + {:name :DiagnosticSignInfo :text ""}]) + +(fn apply-signs [] + (each [_ sign (ipairs signs)] + (vim.fn.sign_define sign.name {:texthl sign.name :text sign.text :numhl ""}))) + +(local 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 ""}}) + +(fn 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}))) + +{: setup} |