feature/lookup: fix lookup commands skipping to project text search
This commit is contained in:
parent
cf99f29ee0
commit
7579110534
2 changed files with 16 additions and 5 deletions
|
@ -25,7 +25,8 @@
|
||||||
((xref-backend-identifier-at-point (xref-find-backend)))))
|
((xref-backend-identifier-at-point (xref-find-backend)))))
|
||||||
|
|
||||||
(defun +lookup--jump-to (prop identifier)
|
(defun +lookup--jump-to (prop identifier)
|
||||||
(cl-loop for fn in (plist-get '(:definition +lookup-definition-functions
|
(cl-loop with origin = (point-marker)
|
||||||
|
for fn in (plist-get (list :definition +lookup-definition-functions
|
||||||
:references +lookup-references-functions
|
:references +lookup-references-functions
|
||||||
:documentation +lookup-documentation-functions)
|
:documentation +lookup-documentation-functions)
|
||||||
prop)
|
prop)
|
||||||
|
@ -38,6 +39,16 @@
|
||||||
('error (ignore (message "%s" e))))
|
('error (ignore (message "%s" e))))
|
||||||
return it))
|
return it))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +lookup-xref-definitions (identifier)
|
||||||
|
"Non-interactive wrapper for `xref-find-definitions'"
|
||||||
|
(xref-find-definitions identifier))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +lookup-xref-references (identifier)
|
||||||
|
"Non-interactive wrapper for `xref-find-references'"
|
||||||
|
(xref-find-references identifier))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Main commands
|
;; Main commands
|
||||||
|
|
|
@ -33,12 +33,12 @@ produces an url. Used by `+lookup/online'.")
|
||||||
(defvar +lookup-open-url-fn #'browse-url
|
(defvar +lookup-open-url-fn #'browse-url
|
||||||
"Function to use to open search urls.")
|
"Function to use to open search urls.")
|
||||||
|
|
||||||
(defvar +lookup-definition-functions '(xref-find-definitions)
|
(defvar +lookup-definition-functions '(+lookup-xref-definitions)
|
||||||
"Functions for `+lookup/definition' to try, before resorting to `dumb-jump'.
|
"Functions for `+lookup/definition' to try, before resorting to `dumb-jump'.
|
||||||
Stops at the first function to return non-nil or change the current
|
Stops at the first function to return non-nil or change the current
|
||||||
window/point.")
|
window/point.")
|
||||||
|
|
||||||
(defvar +lookup-references-functions '(xref-find-references)
|
(defvar +lookup-references-functions '(+lookup-xref-references)
|
||||||
"Functions for `+lookup/references' to try, before resorting to `dumb-jump'.
|
"Functions for `+lookup/references' to try, before resorting to `dumb-jump'.
|
||||||
Stops at the first function to return non-nil or change the current
|
Stops at the first function to return non-nil or change the current
|
||||||
window/point.")
|
window/point.")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue