Sarcasm / irony-mode

A C/C++ minor mode for Emacs powered by libclang
GNU General Public License v3.0
901 stars 98 forks source link

Is it possible to improve the completion API? #538

Open ema2159 opened 5 years ago

ema2159 commented 5 years ago

I've been improving the company-box package adding support for several company backends such as company-tern or company-anaconda. I also started working with company-irony but I found that I had to do kinda weird workarounds to find out the kind of completion candidate (i.e. if it is a class, a function, a struct, a variable etc). Other modes that provide completion just as anaconda-mode provide a nice API with information that tells you exactly the kind of the candidate (keyword, function, instance, class etc...). Am I missing something? Is there a way to extract that kind of information from company-irony candidates?

Sarcasm commented 5 years ago

I guess it's just a matter of exposing clang_getCompletionParent():

Which I think returns this list of possibilities:

You could try to add this information as a new member of the completion candidates:

ema2159 commented 5 years ago

I guess it's just a matter of exposing clang_getCompletionParent():

Which I think returns this list of possibilities:

You could try to add this information as a new member of the completion candidates:

This is just what I need. I'll try to explore it and then I'll open a PR.