Skip to content

Commit 2c77d59

Browse files
committed
Impl code jump using smart-jump using PHP-UI Phpactor
1 parent a5d24aa commit 2c77d59

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: lisp/php-ui-phpactor.el

+10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
;;; Code:
2929
(require 'phpactor nil t)
3030
(require 'popup nil t)
31+
(require 'smart-jump nil t)
3132

3233
(defvar-local php-ui-phpactor-buffer nil)
3334
(defvar-local php-ui-phpactor-hover-last-pos nil)
@@ -64,6 +65,11 @@
6465
(defun php-ui-phpactor-activate ()
6566
"Activate PHP-UI using phpactor.el."
6667
(interactive)
68+
(if (not (fboundp 'smart-jump-go))
69+
(local-set-key [remap xref-find-definitions] #'phpactor-goto-definition)
70+
(local-set-key [remap xref-find-definitions] #'smart-jump-go)
71+
(local-set-key [remap xref-pop-marker-stack] #'smart-jump-back)
72+
(local-set-key [remap xref-find-references] #'smart-jump-references))
6773
(unless php-ui-phpactor-timer
6874
(setq php-ui-phpactor-timer (run-with-timer 1.0 1 #'php-ui-phpactor-hover)))
6975
(setq php-ui-phpactor-buffer t))
@@ -72,6 +78,10 @@
7278
(defun php-ui-phpactor-deactivate ()
7379
"Dectivate PHP-UI using phpactor.el."
7480
(interactive)
81+
(local-unset-key [remap xref-find-definitions])
82+
(local-unset-key [remap xref-pop-marker-stack])
83+
(local-unset-key [remap xref-find-references])
84+
7585
(when php-ui-phpactor-timer
7686
(cancel-timer php-ui-phpactor-timer)
7787
(setq php-ui-phpactor-timer nil))

0 commit comments

Comments
 (0)