[lsp] set jump handler per lsp-managed buffer

Previously, this would try to add the lsp jump handler to the mode's jump
handler list every time lsp started managing a buffer of that mode. Now, we only
use the lsp jump handler for buffers managed by lsp.
This commit is contained in:
Steven Allen 2019-03-25 10:47:46 +00:00 committed by Maximilian Wolff
parent 6781dfe157
commit 2088eb67a9
No known key found for this signature in database
GPG key ID: 2DD07025BFDBD89A
2 changed files with 3 additions and 5 deletions

View file

@ -9,11 +9,9 @@
;; ;;
;;; License: GPLv3 ;;; License: GPLv3
(defun spacemacs//setup-lsp-jump-handler (&rest modes) (defun spacemacs//setup-lsp-jump-handler ()
"Set jump handler for LSP with the given MODE." "Set jump handler for LSP with the given MODE."
(dolist (m modes) (add-to-list 'spacemacs-jump-handlers '(lsp-ui-peek-find-definitions :async t)))
(add-to-list (intern (format "spacemacs-jump-handlers-%S" m))
'(lsp-ui-peek-find-definitions :async t))))
;; Key bindings ;; Key bindings

View file

@ -28,7 +28,7 @@
(spacemacs/lsp-bind-keys) (spacemacs/lsp-bind-keys)
(add-hook 'lsp-after-open-hook (lambda () (add-hook 'lsp-after-open-hook (lambda ()
"Setup xref jump handler and declare keybinding prefixes" "Setup xref jump handler and declare keybinding prefixes"
(spacemacs//setup-lsp-jump-handler major-mode) (spacemacs//setup-lsp-jump-handler)
(spacemacs//lsp-declare-prefixes-for-mode major-mode)))))) (spacemacs//lsp-declare-prefixes-for-mode major-mode))))))
(defun lsp/init-lsp-ui () (defun lsp/init-lsp-ui ()