GNU bug report logs -
#25593
Feature request: xref-find-definitions in current file
Previous Next
Reported by: Joel Ekström <joel <at> ekstrom.io>
Date: Tue, 31 Jan 2017 22:01:02 UTC
Severity: wishlist
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 25593 <at> debbugs.gnu.org (full text, mbox):
Hi Joel,
On 31.01.2017 23:43, Joel Ekström wrote:
> I often find myself needing to jump to a definition I know is in the
> file I'm currently working on.
Normally, I'd use M-x imenu for that. Or actually counsel-imenu, the
third-party frontend to this information.
IME this is most useful when the language in question doesn't have a
smart navigation backend, and the project is not indexed with TAGS.
> xref-find-definitions can make this hard
> if there are many candidates.
Sounds about right.
> What I would like is to be able to filter xref-find-definitions to only
> show definitions in the currently open buffer. Sort of like what
> list-tags does already, but without having to specify the file and
> switch to another buffer.
There are multiple possible ways to solve that problem.
One that you are directly requesting would involve creating a new
backend-agnostic command, as well as either a way to hint the backend
that we only want xrefs from a particular file, or codyfing that the
"group" field in xrefs is always a file name, and filtering by it.
On the other hand, we could create a dedicated command like
xref-show-imenu which will pull information from imenu specifically.
Does that sound appealing to you?
Personally, Counsel's UI feels best for displaying IMenu entries, and
I'd be happy to use something like that for xref-find-definitions as
well. Unfortunately, there's no similar UI in the core so far.
If you haven't known about imenu before, does me mentioning it actually
solve your problem already?
This bug report was last modified 4 years and 290 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.