-
Notifications
You must be signed in to change notification settings - Fork 38
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
Combine completion candidates with metadata regarding them #16
Comments
I know about this feature, I'd be happy to bring it back if it is possible to do without hampering the performance. Perhaps the backend could return candidates in groups, according to their category. Although I'm not sure how then you can use it in Also, what about the ns/package of the candidate? It is already given out in the popup doc that is requested per candidate. Is it important to have it in completion, for all candidates at once? |
I think that only the nREPL calls are expensive and doing some type checks in Java should be fairly fast. Once a client receives the candidates and the metadata grouping them on the client side should be pretty fast as well. @gtrak suggested returning a list of maps for the candidates in a similar issue for ClojureScript completion. This seems like a good idea to me. Initially the map could have only two elements - the name and the type of the candidate.
I just mentioned this as some other metadata we might need (theoretically) beside the candidate's type. |
Yes. What I'm saying is that the only way (at least that I'm aware about) in |
Don't know about auto-complete, but if you're using completion-at-point every candidate is simply passed to an annotation function with adds the extra data for it (here's an example). This works transparently for company-mode and guess auto-complete-mode should start respecting completion-at-point instead of defining its own abstractions. |
I'm afraid you are addressing the wrong person with this claim:). |
@alexander-yakushev So, shall we do this or no? People keep asking me about showing candidate type data for a while now and I have to know whether I'll have to do in the middleware or you'll do it in compliment. |
Yeah, perhaps this needs to be done after all. So, does it mean instead of Also, in company mode do you plan just to attach the type tag to candidate name? How will it know not to insert that tag into buffer when completing? |
There's some standard Emacs support for this. See https://github.com/clojure-emacs/cider/blob/master/cider-interaction.el#L798 |
OK, it will be easier just to " |
:-) Guess so. |
Ping :-) |
OK, I need some more time for this. I haven't yet figured the correct way to do this to preserve compatibility with the old method, and to keep the code nice. But I'll get to it soon. |
Emacs has a feature that allows you to annotate a completion candidate with addition information - e.g. the type of the candidate (
function
,macro
,interface
, etc). You can see the feature in action for Emacs Lisp completions. For this to effectively used, however, it'd be beneficial if one could retrieve a completion candidate together with some metadata regarding it (perhaps the type and the ns/package of the candidate, maybe others make sense as well), so avoid having to do one of two things:Obviously this is not a must-have feature, but it'd be nice to have something like this in tools like CIDER. I'm also not quite sure if packages like compliment should handle this or their clients, but I wanted to start a discussion on the subject.
The text was updated successfully, but these errors were encountered: