|
From: | Dmitry Gutov |
Subject: | Re: Xref completion |
Date: | Tue, 17 Nov 2020 23:38:18 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 17.11.2020 23:16, William Xu wrote:
(defun my-xref--show-defs-minibuffer (fetcher alist) (let* ((xrefs (funcall fetcher)) (xref-alist (xref--analyze xrefs)) (xref (if (not (cdr xrefs)) (car xrefs) (cadr (assoc (completing-read "Jump to definition: " xref-alist) xref-alist))))) (xref-pop-to-location xref (assoc-default 'display-action alist))))
A solid try, but note you might have a problem when there are several matches in the same file: you won't be able to navigate to any but the first one.
Of course, depending on your current programming language, this might be not important.
[Prev in Thread] | Current Thread | [Next in Thread] |