Community
Participate
Working Groups
b = new Button(null, 0); b.setText("test"); b<^Space> context.getReceiverType() etc. are null, I have to search for the variable using ((IntelligentCompletionContext) context).findMatchingVariable("b"). For the resulting variable the method getReceiverCalls() is empty. For all variables which are detected by the context the receiver calls are not obtained using getReceiverCalls(), but with this: for (final IVariableUsageResolver resolver : usageResolvers.get()) { if (resolver.canResolve(context)) { receiverMethodInvocations = resolver.getReceiverMethodInvocations(); return true; } } (...templates.PatternRecommender)
The context's getVariable method is a *handle-only* operation the returns the search key that may be used to lookup the real variable (with its usages) in a resolver. Clearly there is a confusion which should be solved somehow. The context, however, should IMHO not be responsible to resolve the variable usages. We may return a new Variable-subtype that throws exceptions whenever another method than getVariableName and -Type is called. Are there any other design proposals? Added Johannes to the discussion.
closing this issue. API has been changed. The store based approach is completely gone.