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

Initial attempt at xref forward and backward commands #1137

Closed
wants to merge 1 commit into from

Conversation

brett-lempereur
Copy link

@brett-lempereur brett-lempereur commented Nov 24, 2024

Since switching to eglot, in large codebases I've noticed that Xref lacks a good way to quickly traverse back up through the stack. By the time you're ten or twenty files deep it's quite painful. Consult defines consult-global-mark which nearly works for navigating the xref stack (try (consult-global-mark (car (xref--get-history)))), but doesn't properly update the state of the stack.

This is an initial attempt at defining consult commands for navigating backward and forwards through the stack, and I'm opening it early to gauge interest and for discussion. It's probably not very idiomatic and shipping it might need modifications to xref itself, so we don't need to hit a private API for the history.

@brett-lempereur
Copy link
Author

Moved this into an extension package and fixed it up. Something like it probably belongs in Emacs and Consult, but this will do for now: https://github.com/brett-lempereur/consult-xref-stack.

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

Successfully merging this pull request may close these issues.

1 participant