Skip to content

Combine completion candidates with metadata regarding them #12

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

Closed
bbatsov opened this issue Sep 9, 2014 · 5 comments
Closed

Combine completion candidates with metadata regarding them #12

bbatsov opened this issue Sep 9, 2014 · 5 comments

Comments

@bbatsov
Copy link
Member

bbatsov commented Sep 9, 2014

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:

retrieve the metadata for each candidate individually (which is slow)
retrieve all candidates and then do a second function call to retrieve the metadata for all of them
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.

I've opened a similar issue for compliment (alexander-yakushev/compliment#16).

@gtrak
Copy link
Contributor

gtrak commented Sep 9, 2014

I agree, we should probably return a list of info maps out of cljs-tooling,
then let cider figure out what it wants.

On Tue, Sep 9, 2014 at 5:21 AM, Bozhidar Batsov [email protected]
wrote:

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:

retrieve the metadata for each candidate individually (which is slow)
retrieve all candidates and then do a second function call to retrieve the
metadata for all of them
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.

I've opened a similar issue for compliment (
alexander-yakushev/compliment#16
alexander-yakushev/compliment#16).


Reply to this email directly or view it on GitHub
https://github.com/gtrak/cljs-tooling/issues/12.

@cichli
Copy link
Member

cichli commented Sep 9, 2014

Candidate name, type and ns should all be trivial to return - but what ns should be returned for special forms? Will cljs.core suffice?

@bbatsov
Copy link
Member Author

bbatsov commented Sep 9, 2014

Will cljs.core suffice?

Yeah, I think that special forms are usually considered part of the core ns.

I'm not sure what other data people might like to see as a completion annotation. (I'm planning to make this user customizable in CIDER and show only the type by default, but providing a few examples of adding more data like the ns to the annotation).

cichli added a commit to cichli/cljs-tooling that referenced this issue Feb 25, 2015
cichli added a commit to cichli/cljs-tooling that referenced this issue Feb 25, 2015
cichli added a commit to cichli/cljs-tooling that referenced this issue Feb 25, 2015
cichli added a commit to cichli/cljs-tooling that referenced this issue Feb 26, 2015
@gtrak gtrak closed this as completed in 161506f Feb 28, 2015
@gtrak
Copy link
Contributor

gtrak commented Feb 28, 2015

I pushed a snapshot release that contains this for 0.1.5-SNAPSHOT. Seems like there's still churn upstream cider and compliment wrt these changes?

@cichli
Copy link
Member

cichli commented Mar 1, 2015

@gtrak should all be working now if you get latest cider-nrepl 0.9.0-SNAPSHOT and cider MELPA :-).

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

3 participants