about summary refs log tree commit diff stats
path: root/.emacs.d/lisp/init-lsp.el
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2021-09-18 15:30:52 +0100
committerDavid Morgan <djm_uk@protonmail.com>2021-09-18 15:30:52 +0100
commitdddd349714e282a0bcf5b9593e90d38d22ce1616 (patch)
tree03de1d2ed9859f9f8abdb7287179a954a498aeb0 /.emacs.d/lisp/init-lsp.el
parented43c29090b74e85ba35c0453cf67c4a6fa5076b (diff)
downloaddotfiles-dddd349714e282a0bcf5b9593e90d38d22ce1616.tar.gz
Re-organise lsp config
Diffstat (limited to '.emacs.d/lisp/init-lsp.el')
-rw-r--r--.emacs.d/lisp/init-lsp.el30
1 files changed, 19 insertions, 11 deletions
diff --git a/.emacs.d/lisp/init-lsp.el b/.emacs.d/lisp/init-lsp.el
index 3c44367..ff4b4ee 100644
--- a/.emacs.d/lisp/init-lsp.el
+++ b/.emacs.d/lisp/init-lsp.el
@@ -4,7 +4,17 @@
 
 (use-package lsp-ui
   :config
-  (require 'lsp-ui-imenu))
+  (require 'lsp-ui-imenu)
+  (setq lsp-ui-sideline-enable t
+        lsp-ui-peek-enable t
+        lsp-ui-peek-always-show t
+        lsp-ui-doc-delay 1
+        lsp-ui-doc-enable t
+        lsp-ui-doc-show-with-mouse t
+        lsp-ui-doc-show-with-cursor nil
+        lsp-ui-sideline-show-diagnostics t
+        lsp-ui-sideline-show-code-actions nil
+        lsp-ui-doc-position 'at-point))
 
 (use-package lsp-treemacs)
 
@@ -13,31 +23,29 @@
   :hook
   (clojure-mode . lsp)
   (lsp-lens-mode . really-diminish-lsp-lens-mode)
+  (lsp-mode . xref-prefer-cider)
   :config
   (defun really-diminish-lsp-lens-mode ()
     (diminish 'lsp-lens-mode)
     (remove-hook 'lsp-lens-mode-hook 'really-diminish-lsp-lens-mode))
+  (defun xref-prefer-cider ()
+    (when (and lsp-mode
+               (eq 'lsp--xref-backend (car xref-backend-functions))
+               (memq 'cider--xref-backend xref-backend-functions))
+      (remove-hook 'xref-backend-functions 'cider--xref-backend 'local)
+      (add-hook 'xref-backend-functions 'cider--xref-backend nil 'local)))
   (if (eq system-type 'darwin)
       (setq lsp-keymap-prefix "s-l")
     (setq lsp-keymap-prefix "C-c C-l"))
   (define-key lsp-mode-map (kbd lsp-keymap-prefix) lsp-command-map)
   (setq read-process-output-max (* 1024 1024)
-        lsp-ui-sideline-enable t
-        lsp-ui-peek-enable t
-        lsp-ui-peek-always-show t
-        lsp-ui-doc-delay 1
+        lsp-log-io nil
         lsp-lens-enable t
-        lsp-ui-doc-enable t
-        lsp-ui-doc-show-with-cursor t
-        lsp-ui-doc-show-with-mouse t
         lsp-headerline-breadcrumb-enable t
         lsp-enable-symbol-highlighting t
         lsp-headerline-breadcrumb-enable-diagnostics nil
-        lsp-ui-sideline-show-diagnostics t
-        lsp-ui-sideline-show-code-actions nil
         lsp-modeline-code-actions-enable nil
         lsp-modeline-diagnostics-enable nil
-        lsp-ui-doc-position 'top
         lsp-treemacs-theme "Iconless"
         ;; user cider for indendation and completion instead
         lsp-enable-indentation nil