Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider implementing xref-backend-references #433

Open
harto opened this issue Mar 31, 2023 · 2 comments
Open

Consider implementing xref-backend-references #433

harto opened this issue Mar 31, 2023 · 2 comments

Comments

@harto
Copy link

harto commented Mar 31, 2023

Hello, thanks for this very useful library. I was wondering if you had considered implementing the "find references to symbol" part of xref.

Right now, M-. works great for jumping to a symbol. But once I'm there, if I type M-?, xref falls back to a really slow find … | grep thing. I was wondering if it would be feasible to reuse the same ag/rg searching instead.

I don't know much about the internals of either xref or dumb-jump, but I'm happy to poke at this if it seems like something you would consider merging.

@catern
Copy link

catern commented Apr 13, 2023

I'm very interested in this too. Specifically, I have a somewhat interesting use case: I have another xref backend which supports jump-to-definition efficiently, but doesn't support jump-to-references, so it would be nice to use dump-jump to provide that latter functionality.

That being said, after you mentioned this I looked at the default xref-backend-references implementation, and it actually looks like it might be plausible to improve the default in upstream Emacs. Like, instead of using find | grep, use something based on ag/rg when those commands are avilable, automatically, upstream. I say this because the semantic backend which xref is using seems to already have decent support for fallbacks like that.

@catern
Copy link

catern commented Apr 14, 2023

FWIW I went ahead and did exactly what I just said, just improved the default xref-backend-references implementation to not be slow https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62837

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants