-
Notifications
You must be signed in to change notification settings - Fork 200
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
RFC: find-workspace-symol iteratively #832
base: master
Are you sure you want to change the base?
Conversation
Would this make sense to upstream into |
I'm not sure. (A gif would help, BTW). It sounds like a different UI, more like what ivy/counsel/vertico would provide. Whether that would be added cleanly to Xref, I suppose, is yet to be demonstrated with a patch. |
I've created a .gif (using huge font-sizes somehow), but I'm not sure about its usefulness. It hopefully shows that the user is searching for a workspace symbol, the partially entered symbol name has more than one matches, and the matches have location information attached to them. When there is only one match, RET in the minibuffer leads to the location of the match. When there are many matches, RET jumps to the xref buffer.
I haven't used any of ivy/counsel/vertico, so I don't really know. I'm still not sure if it's generally useful. I have another experiment with xref. There's a language server that sends "runnalbe" commands corresponding to different file locations. An Thank you. |
Sounds similar to I was more referring to a different change in behavior, though: the list being updated as you type. That's the common feature of frameworks like Helm/Ivy/Vertico. Not sure what would be the best place to add it. Whether it could be applicable to all xref commands, etc.
Nope, never considered that the value would be interesting for extensions. You can refer to this name, but it's probably a good idea to rename it (with a compatibility alias, I guess). We can move this to the bug tracker. |
Yes, one can look at this feature as
OK, thank you. |
There is such field, but it works differently: to show the location of the current completion. And anything Company does works when you start typing something, in some buffer. Even if we turn it on in the minibuffer, which command would activate it? But there is a related feature of Xref which Eglot does not support: identifier completion. When you call It sounds like this is somewhat similar, in both workflow and purpose. I'm not sure if it's currently feasible to implement |
I have to admit I haven't look at the capabilities of currently available third party completion packages. Nevertheless, the way I understand it, there are two basic kinds of completion. There is completion-at-point, which works in normal buffers. And there's completing-read for the minibuffer. Completion items for completion-at-point can be annotated [1] and company-mode extends the simple annotation with additional metadata fields like location [2]. It seems these extensions are so popular that other completion packages also support them. I wonder whether it makes sense to use some of these extended metadata fields for completing-read as well. And what is the best UI for presenting the location info in case of completing-read. Maybe if emacs "codifies" company's additional metadata fields, it will inspire 3rd party developers to create innovative interfaces.
I need to look into this, but my guess it is possible to implement a xref-backend-identifier-completion-table for eglot. However, then the workflow would be the following: the user selects a possible symbol to search for from a list of non-annotated strings and then xrefs shows a list of locations for that selected symbol. What I'm interested in is to show locations of the possible symbols/identifiers in the first phase when the users selects the symbol to search for. (Thank you for your patience, it seems it's hard for me to write about this clearly.) |
I think a bunch of those get used already -- at least Corfu does use them. But like Company, it specializes on in-buffer completion. In both cases that can be changed, but if we look at Ivy/Helm/Vertico, none of them do that. Though they could indeed make use of But I guess one problem, when we talk about
IMHO the former is more important than the latter. But of course your priorities are your own.
No problem, it's usually not easy to narrow down the potential set of all changes to something actionable. |
Could it still be an improvement over what we have now? Even if the completion table produced this way is incomplete, it could contain whatever is reachable this way (perhaps global constants; maybe fully-qualifier method names as well), and the symbol at point as additional member (perhaps specially annotated for the user and the program to be able to distinguish it). |
I had this idea to iteratively search for workspace-symbols. It's somewhat like ido-switch-buffer, but as you type or when you stop typing, eglot displays the current candidates with xref. The implementation works for me, but I'm curious about your thoughts of the user interface. The code can be cleaned up later.