mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-19 13:43:36 -05:00
feature/lookup: fix lookup commands skipping to project text search
This commit is contained in:
@@ -25,9 +25,10 @@
|
|||||||
((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)
|
||||||
:references +lookup-references-functions
|
for fn in (plist-get (list :definition +lookup-definition-functions
|
||||||
:documentation +lookup-documentation-functions)
|
:references +lookup-references-functions
|
||||||
|
:documentation +lookup-documentation-functions)
|
||||||
prop)
|
prop)
|
||||||
for fn = (or (command-remapping fn) fn)
|
for fn = (or (command-remapping fn) fn)
|
||||||
if (condition-case e
|
if (condition-case e
|
||||||
@@ -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.")
|
||||||
|
Reference in New Issue
Block a user