Author: vrubezhny
Date: 2008-11-20 13:18:11 -0500 (Thu, 20 Nov 2008)
New Revision: 11924
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java
Log:
JBIDE-3189 CA remove first entered el expression
Issue is fixed
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java 2008-11-20
18:13:51 UTC (rev 11923)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java 2008-11-20
18:18:11 UTC (rev 11924)
@@ -25,6 +25,7 @@
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELModel;
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
+import org.jboss.tools.common.el.core.model.ELUtil;
import org.jboss.tools.common.el.core.parser.ELParser;
import org.jboss.tools.common.el.core.parser.ELParserFactory;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
@@ -182,24 +183,27 @@
ELParser p = ELParserUtil.getDefaultFactory().createParser();
ELModel model = p.parse(value);
List<ELInstance> is = model.getInstances();
- ELInvocationExpression expr = null;
- for (ELInstance i: is) {
- if(i.getExpression() instanceof ELInvocationExpression) {
- expr = (ELInvocationExpression)i.getExpression();
- break;
- }
+ ELExpression expr = null;
+
+ // JBIDE-3189: CA remove first entered el expression
+ // The following fixes the issue
+ ELInstance i = ELUtil.findInstance(model, offset);
+ if (i != null) {
+ expr = (ELExpression)i.getExpression();
}
+ // JBIDE-3189
+
if(expr != null) {
proposal.setStart(expr.getStartPosition());
} else {
proposal.setStart(offset);
}
- if(expr != null && expr.getEndPosition() >= offset) {
- proposal.setEnd(expr.getEndPosition());
- } else {
- proposal.setEnd(offset);
- }
+ // JBIDE-3189: CA remove first entered el expression
+ // The following fixes the issue
+ proposal.setEnd(offset);
+ // JBIDE-3189
+
int pos = proposal.getReplacementString().length();
// JBIDE-2437: Because of the issue add EL open/close brackets to the proposal
replacement string
Show replies by date