Bug 422639 - Models are downloaded before Intelligend Code Completion is enabled
Summary: Models are downloaded before Intelligend Code Completion is enabled
Status: CLOSED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Recommenders (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2013-11-27 04:10 EST by Johannes Dorn CLA
Modified: 2019-07-24 14:37 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.