Author: vrubezhny
Date: 2009-09-17 12:41:17 -0400 (Thu, 17 Sep 2009)
New Revision: 17639
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java
Log:
JBIDE-4860: Improve/refactor JBT EL resolvers.
JavaElements are set for the segments
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java 2009-09-17
15:48:54 UTC (rev 17638)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java 2009-09-17
16:41:17 UTC (rev 17639)
@@ -488,7 +488,8 @@
proposal.setContextInfo(attachedJavaDoc);
proposals.add(proposal);
}
- segment.setMemberInfo(bijectedAttribute!=null?bijectedAttribute:getMemberInfoByVariable(var,
true));
+ segment.setMemberInfo(bijectedAttribute!=null?bijectedAttribute:member);
+ segment.setElement(bijectedAttribute!=null?bijectedAttribute.getJavaElement():member!=null?member.getJavaElement():null);
segment.getVariables().add(var);
}
// <<<=== JBIDE-512, JBIDE-2541 related changes
@@ -507,6 +508,7 @@
if (member != null && !members.contains(member)) {
members.add(member);
segment.setMemberInfo(member);
+ segment.setElement(member.getJavaElement());
segment.getVariables().add(var);
segment.setResolved(true);
}
@@ -532,7 +534,8 @@
members = resolveSegment(left, members, resolution, returnEqualedVariablesOnly,
varIsUsed, segment);
}
if(!members.isEmpty()) {
- segment.setMemberInfo(members.get(0));
+ segment.setMemberInfo(members.get(0)); // TODO: This is a buggy way to select a
member to setup in a segment
+ segment.setElement(members.get(0).getJavaElement());
}
resolution.addSegment(segment);
} else { // Last segment
@@ -773,6 +776,7 @@
proposalsToFilter.addAll(infos.getMethodPresentations());
proposalsToFilter.addAll(infos.getPropertyPresentations(segment.getUnpairedGettersOrSetters()));
segment.setMemberInfo(mbr);
+ segment.setElement(mbr!=null?mbr.getJavaElement():null);
}
for (TypeInfoCollector.MemberPresentation proposal : proposalsToFilter) {
// We do expect nothing but name for method tokens (No round brackets)
@@ -789,6 +793,7 @@
kbProposals.add(kbProposal);
segment.setMemberInfo(proposal.getMember());
+ segment.setElement(proposal.getMember()!=null?proposal.getMember().getJavaElement():null);
if(segment.getUnpairedGettersOrSetters()!=null) {
TypeInfoCollector.MethodInfo unpirMethod =
segment.getUnpairedGettersOrSetters().get(filter);
segment.clearUnpairedGettersOrSetters();
@@ -850,6 +855,7 @@
WebKbPlugin.getDefault().logError(jme);
}
segment.setMemberInfo(mbr);
+ segment.setElement(mbr!=null?mbr.getJavaElement():null);
}
String filter = expr.getMemberName();
@@ -882,6 +888,7 @@
kbProposals.add(kbProposal);
segment.setMemberInfo(proposal.getMember());
+ segment.setElement(proposal.getMember()!=null?proposal.getMember().getJavaElement():null);
if(segment.getUnpairedGettersOrSetters()!=null) {
TypeInfoCollector.MethodInfo unpirMethod =
segment.getUnpairedGettersOrSetters().get(filter);
segment.clearUnpairedGettersOrSetters();
Show replies by date