summaryrefslogtreecommitdiff
path: root/fnl/config
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-04-06 23:50:11 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-04-06 23:50:11 +0200
commit72f533bdbf04ecd6f29b84d3025d6f55154a4260 (patch)
treec8cf35904ea4c291d0913d30453a51e00c621d3e /fnl/config
parent5655b344260449c5a955d0f5c6e2dc52ab5004a8 (diff)
feat(handlers): add config
Diffstat (limited to 'fnl/config')
-rw-r--r--fnl/config/lsp/handlers.fnl35
1 files changed, 35 insertions, 0 deletions
diff --git a/fnl/config/lsp/handlers.fnl b/fnl/config/lsp/handlers.fnl
index e69de29..fc0b006 100644
--- a/fnl/config/lsp/handlers.fnl
+++ b/fnl/config/lsp/handlers.fnl
@@ -0,0 +1,35 @@
+(module config.lsp.handlers)
+
+(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 true
+ :underline true
+ :severity_sort true
+ :float {
+ :focusable false
+ :style "minimal"
+ :border "rounded"
+ :source "always"
+ :header ""
+ :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"} ))))
+