Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [recommenders-dev] Need help to collect completion proposals made by code recommenders programetically

Hi Marcel,
Thanks again. To explain what I want to do and make sure I am doing
that correctly here is a simple scenario.

Class A{
       public A(){
       Text T=new Text();
       T.setText();
       T.setLayout();
       }

}

Lets say a file A.java contain a class and there are two method calls
in there (T.setText and T.setLayout()). Lets say, I am in the position
of first method call and I will determine what completion proposals
are made by code recommender at that point and continue the steps with
all other method calls. (for now, I will only focus on the methods
belongs to swt classes and ignore other method calls).

Can I create an appropriate query for each method call? If its
possible then I can use the recommender.computeRecommendations(query)
to collect the completion proposals.
After taking a look on the ObjectUsage class, It appears to me that it
takes the following input:
calls (list of method calls), definition, kind, overridesFirst,
overridesSuper and type. If I can fill this information for each
method calls then I can call the computeRecommendations(query)
method.

Sorry for my long mail. I try to explain what I am planning to do.
Please correct me if I am wrong.

After reading your paper (Learning from example to improve code
completion systems), it appears to me that you also considered various
statements before the target method call. Does Code Recommenders also
considers them (like object creation.. )?

Thanks again for your kind help and support. I will take a look on
those classes.

-Muhammad Asaduzzaman





On Wed, Aug 7, 2013 at 12:15 PM, Marcel Bruch
<marcel.bruch@xxxxxxxxxxxxxx> wrote:
> Great. Update to the latest version of master to get rid of the NPE.
>
>
>> Now I need to create the right query and call
>> the recommender.computeRecommendations(query) method.
>
> I'm not sure what you want to do, but please note that the ObjectUsage class and the method EclipseOrgCallRecommender are *solely for demo purpose*.
>
>
> To make clear:
> The API to look at is ICallModel. Forget about the rest if you want to learn *how* recommendations are computed and what information is considered when computing recommendations.
>
>
>
> If you are interested to learn where the inputs into ICallModel *in Eclipse* come from:
> Have a look at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.java or org.eclipse.recommenders.internal.calls.rcp.CallsApidocProvider.handle(IJavaElement, String, String, JavaElementSelectionEvent, Composite). The show how clients of ICallModel look like.
>
>
> Let me know if you need more information. I'll update the documentation accordingly.
>
> HTH
> Marcel
>
>
> _______________________________________________
> recommenders-dev mailing list
> recommenders-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/recommenders-dev


Back to the top