Improves jump-to-definition for Clojure modes
This commit is contained in:
parent
19b42377bb
commit
2be8400975
|
@ -170,3 +170,12 @@ If called with a prefix argument, uses the other-window instead."
|
|||
(when (memq dotspacemacs-editing-style '(hybrid vim))
|
||||
(evil-make-overriding-map cider--debug-mode-map 'normal)
|
||||
(evil-normalize-keymaps)))
|
||||
|
||||
(defun spacemacs/clj-find-var ()
|
||||
"Attempts to jump-to-definition of the symbol-at-point. If CIDER fails, or not available, falls back to dumb-jump"
|
||||
(interactive)
|
||||
(let ((var (cider-symbol-at-point)))
|
||||
(if (and (cider-connected-p) (cider-var-info var))
|
||||
(unless (eq 'symbol (type-of (cider-find-var nil var)))
|
||||
(dumb-jump-go))
|
||||
(dumb-jump-go))))
|
||||
|
|
|
@ -47,7 +47,12 @@
|
|||
spacemacs-jump-handlers-clojurescript-mode
|
||||
spacemacs-jump-handlers-clojurex-mode
|
||||
spacemacs-jump-handlers-cider-repl-mode))
|
||||
(add-to-list x 'cider-find-var))
|
||||
(add-to-list x 'spacemacs/clj-find-var))
|
||||
|
||||
(add-hook 'clojure-mode-hook #'spacemacs//init-jump-handlers-clojure-mode)
|
||||
(add-hook 'clojurescript-mode-hook #'spacemacs//init-jump-handlers-clojurescript-mode)
|
||||
(add-hook 'clojurec-mode-hook #'spacemacs//init-jump-handlers-clojurec-mode)
|
||||
(add-hook 'cider-repl-mode-hook #'spacemacs//init-jump-handlers-cider-repl-mode)
|
||||
|
||||
;; TODO: having this work for cider-macroexpansion-mode would be nice,
|
||||
;; but the problem is that it uses clojure-mode as its major-mode
|
||||
|
|
Loading…
Reference in a new issue