Summary: | CompletionContext not automatically accepted when using IEvaluationContext | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Max Rydahl Andersen <manderse> | ||||
Component: | Core | Assignee: | David Audel <david_audel> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | daniel_megert, darin.eclipse, david_audel, eclipse | ||||
Version: | 3.2 | ||||||
Target Milestone: | 3.2 RC3 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Max Rydahl Andersen
2006-05-03 08:58:22 EDT
I think that this problem is caused by a bug in JDT/Core. When IEvaluationContext#codeComplete() is used, the given requestor is wrapped inside another requestor (see CodeSnippetToCuMapper#getCompletionRequestor()) and the wrapper doesn't call acceptContect(), beginReporting() and endReporting() of the original requestor. This bug already exists in 3.1 but the usage of the context in JDT/Text seems to have change in 3.2 (usage of getContext().isInJavadoc()). >ResultCollector does not have any CoreContext.
To what 'ResultCollector' do you refer?
sorry, old habit of using the old api names ;) The HibernateResultCollector extends CompletionProposalCollector. The bug is in JDT/Core. Move to JDT/Core. Created attachment 40240 [details] Proposed fix As said in comment 1, the problem is in the wrapper. The wrapper doesn't do a callback of acceptContext(). To fix the problem i add this missing method call. There are also other missing callbacks of beginReporting(), endReporting and isIgnored(). But as this bug exists in 3.1 and that we are late in 3.2 plan, the patch only fix the missing acceptContext() to avoid to potentially broke clients. Dani and Darin, please approve for RC3. +1 for RC3 Approving for 3.2 RC3. Fix released and test added CompletionTests#testEvaluationContextCompletion() I opened a new bug for missing beginReporting() and endReporting(): bug 140123 Verified using N20060504-0010 + JDT/Core v_663 Verified for 3.2RC3 using I20060504-1600 (checking the source code). |