Bug 422236 - Integrate Mylyn with Recommenders
Summary: Integrate Mylyn with Recommenders
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Recommenders (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks: 430018
  Show dependency tree
 
Reported: 2013-11-21 05:54 EST by Marcel Bruch CLA
Modified: 2019-07-24 14:36 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Bruch CLA 2013-11-21 05:54:24 EST
Recommenders and Mylyn content assist cannot be used at the same time.

Recommenders 2.0 offers a simple mechanism to integrate "session processors" to its content assist engine. Mylyn integration could be implemented with that API.


Because the completion API is not 100% stable, we'd like to create a new plugin at the Recommenders project that integrates Mylyn (latest after EclipseCon NA 2014, i.e. in April).

Steffen,
is there a public API that can be used to query the relevance of a proposal?
Comment 1 Sam Davis CLA 2013-11-21 13:04:17 EST
I am not familiar with the implementation, but it looks like Mylyn content assist for Java is implemented by FocusedJavaProposalProcessor and FocusedJavaAllProposalComputer in the org.eclipse.mylyn.java.ui plugin. Those classes don't appear to have any significant dependencies on Mylyn internals, but they are internal themselves and they do define some thresholds. Getting the relevance of a proposal seems to be a matter of getting its interest (for which there is API) and comparing it with the thresholds. Since the same thresholds are defined in FocusedCProposalProcessor, perhaps it would make sense to provide API to get the thresholds.
Comment 2 Marcel Bruch CLA 2013-12-11 02:33:45 EST
I just looked into FocusedJavaProposalProcessor briefly. Looks like everything is there to create the Mylyn integration. We only need ContextCore which seems to provide static access to all information we need (relevance and important thresholds).

If that's all, this is a no-brainer.
Andreas, can you add this to the schedule for in the beginning of February and before 2.1?


>> relevant lines we'll need.


AbstractJavaCompletionProposal proposal;
IJavaElement javaElement = proposal.getJavaElement();
IInteractionElement interactionElement = ContextCore.getContextManager().getElement(javaElement.getHandleIdentifier());
float interest = interactionElement.getInterest().getValue();

if (interest > ContextCore.getCommonContextScaling().getInteresting()) {
proposal.setRelevance(...);
...
Comment 3 Andreas Sewe CLA 2013-12-11 09:05:02 EST
(In reply to Marcel Bruch from comment #2)
> If that's all, this is a no-brainer.
> Andreas, can you add this to the schedule for in the beginning of February
> and before 2.1?

Sure. Will schedule this.
Comment 4 Steffen Pingel CLA 2014-02-20 15:08:57 EST
Were you able to make this work?
Comment 5 Marcel Bruch CLA 2014-02-21 12:28:07 EST
https://twitter.com/MarcelBruch/status/436912572642902016

We have to fiddle around with the scores a bit more.
Comment 6 Marcel Bruch CLA 2014-02-21 13:08:16 EST
Steffen, Sam
the current prototype is available here [1]. Can you take a look and tell me whether this code does what you'd expect it to do - or whether I missed some fundamental feature?

It's not a complete copy of FocusedJavaProposalProcessor. I didn't get the meaning of the "implicit interest" LoCs (see isImplicitlyInteresting()). Thus, I skipped that code for now.

[1] https://git.eclipse.org/r/#/c/22378/
[2] https://git.eclipse.org/r/#/c/22378/2/plugins/org.eclipse.recommenders.mylyn.rcp/src/org/eclipse/recommenders/internal/mylyn/rcp/MylynSessionProcessor.java
Comment 7 Sam Davis CLA 2014-02-21 14:35:22 EST
It looks good to me, but I don't know what the implicit interest is either so it would be good to get feedback from Steffen. It looks like you don't need the dependency on org.eclipse.mylyn.java.ui. Also, I'm not sure if Recommenders supports languages other than Java but I think you could use a structure bridge to get the handle and remove the dependency on JDT so that this would work for more than just Java. Finally, I wonder why there is .rcp in the bundle name.
Comment 8 Marcel Bruch CLA 2014-02-22 04:08:06 EST
(In reply to Sam Davis from comment #7)
> It looks like you don't
> need the dependency on org.eclipse.mylyn.java.ui.

I cleaned the dependencies section. It only requires org.eclipse.mylyn.context.core now.


> Also, I'm not sure if
> Recommenders supports languages other than Java but I think you could use a
> structure bridge to get the handle and remove the dependency on JDT so that
> this would work for more than just Java.

We currently support Java only. Thus, I'd say we should think about this again at a later time.

> Finally, I wonder why there is .rcp
> in the bundle name.

Because there is more than one "ui" ;)

Thanks Sam.
Comment 9 Marcel Bruch CLA 2014-02-24 02:01:31 EST
Regarding Release:
------------------

Andreas,
I added/updated the poms and create a new o.e.r.mylyn.rcp.feature for Tycho. Can you please review the change and add the feature to the head update site? After that, I'd like to ask mylyn users/devs to test it and provide improvement suggestions.


Regarding roadmap:
------------------

I'd like to release the mylyn integration with 2.1 (Luna) as second feature to snipmatch. For that we'll need some feedback from mylyn users to be sure it works as intended.

Steffen,
can you imagine that we write two short blog posts, one published on the recommenders blog the other on the mylyn blog, to announce the availability of the integration and requests for comments? We'd provide a couple of screenshots and a short text you may adapt.
Comment 10 Andreas Sewe CLA 2014-03-02 12:53:31 EST
FWIW, once this is properly tested, the Java and RCP/RAP package maintainers should be notified so that they can include not only org.eclipse.recommenders.rcp.feature, but also org.eclipse.recommenders.mylyn.rcp.feature in their respective packages.
Comment 11 Andreas Sewe CLA 2014-03-02 13:12:18 EST
(In reply to Marcel Bruch from comment #9)
> Andreas,
> I added/updated the poms and create a new o.e.r.mylyn.rcp.feature for Tycho.
> Can you please review the change and add the feature to the head update
> site? After that, I'd like to ask mylyn users/devs to test it and provide
> improvement suggestions.

Done.

Should be part of <http://download.eclipse.org/recommenders/updates/head/> in a few minutes.
Comment 12 Steffen Pingel CLA 2014-03-03 07:41:35 EST
(In reply to comment #9)
> Steffen,
> can you imagine that we write two short blog posts, one published on the
> recommenders blog the other on the mylyn blog, to announce the availability of
> the integration and requests for comments? We'd provide a couple of screenshots
> and a short text you may adapt.

That sounds great to me! We can include that in the Mylyn release blog post once the feature is available. This could either be for 3.11 (scheduled for mid March) or 3.12 which is part of Luna (sounds like that would make the most sense).
Comment 13 Marcel Bruch CLA 2014-03-04 14:23:59 EST
I'll publish a small blog post next tuesday morning announcing that an experimental Mylyn integration is ready for testing.
Comment 14 Marcel Bruch CLA 2014-03-05 05:06:02 EST
Steffen,

which feature should the Code Recommenders Mylyn Integration depend on best?

I currently use:

   <requires>
      <import feature="org.eclipse.mylyn.context_feature" version="3.8.0"/>
      <import feature="org.eclipse.recommenders.rcp.feature" version="2.0.0"/>
   </requires>


But it looks like that this dependency only pulls in Mylyn context features that tracks Java types in its context but not visited methods. Is there a particular Java feature I should depend on?
Comment 15 Marcel Bruch CLA 2014-03-05 05:08:06 EST
org.eclipse.mylyn.java-feature sounds too easy...
Comment 16 Steffen Pingel CLA 2014-03-05 08:25:25 EST
org.eclipse.mylyn.java_feature sounds right since you depend on JDT anyways.
Comment 17 Marcel Bruch CLA 2014-03-05 11:02:32 EST
The first version of the blog post is available here [1]. The screenshots will be updated and annotated with some additional info over the weekend.

Steffen,
feel free to comment or edit the article until Sunday night - in particular the section about Mylyn. I'll finalize it on Monday morning.



Andreas,
I changed the dependency to <import feature="org.eclipse.mylyn.java_feature" version="3.8.0"/>. See https://git.eclipse.org/r/22942.



[1] https://docs.google.com/a/codetrails.com/document/d/1bvQEo--ZSds2aryHkj250U_2fW0GPloyHuNpb99x-yk/edit#
Comment 18 Marcel Bruch CLA 2014-03-28 02:49:41 EDT
I don't get any feedback nor error reports. We had ~30 downloads in the last 10 days. I'm closing this now.