Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 422639

Summary: Models are downloaded before Intelligend Code Completion is enabled
Product: z_Archived Reporter: Johannes Dorn <johannes.dorn>
Component: RecommendersAssignee: Project inbox <recommenders-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P5 CC: marcel.bruch
Version: unspecifiedKeywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Johannes Dorn CLA 2013-11-27 04:10:38 EST
When triggering code completion for the first time, a popup appears, asking to enable Intelligent Code Completion.
In the meantime, the index and potentially model artifacts are downloaded.

I would expect this only to happen after the user has activated Intelligent Code Completion.
In cases where he chooses to disable Code Recommenders, his IDE shouldn't have downloaded anything.
Comment 1 Marcel Bruch CLA 2013-11-27 04:34:08 EST
The problematic line is in IntelligentCompletionProposalComputer#computeCompletionProposals:

 @Override
    public List<ICompletionProposal> computeCompletionProposals(ContentAssistInvocationContext context,
            IProgressMonitor monitor) {
        List<ICompletionProposal> res = super.computeCompletionProposals(context, monitor);

We have to call super to know whether we have to emit an "empty proposal" to shield against automatic application of the "enable recommenders?" proposal.


To make this work as expected, we could clear the list of session processors in #sessionStarted . Then only JDT default proposal are triggered.

The fix should be straight forward. Patch welcome.
Comment 2 Johannes Dorn CLA 2013-11-27 05:12:58 EST
While this would prevent model downloads, it does not prevent the download of the index.

The case where the index is already available but Intelligent Code completion hasn't been activated is possible, when opening the models preference page or the model coordinates view before activating. This will trigger the index download.

Clearing the session processors in the ProposalComputer would prevent a model download if the index is already present.

I think a proper fix should also prevent the index download.
Comment 3 Marcel Bruch CLA 2013-12-01 09:16:25 EST
This would require a a significant amount of work for a very small enhancement. If someone steps up to implement it or it raises significant issues, we could consider  fixing it.