Author: vrubezhny
Date: 2011-03-14 12:24:05 -0400 (Mon, 14 Mar 2011)
New Revision: 29762
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
Log:
JBIDE-8575
Code completion for bean properties doesn't work.
Issue is fixed
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2011-03-14
15:49:10 UTC (rev 29761)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2011-03-14
16:24:05 UTC (rev 29762)
@@ -239,24 +239,26 @@
resolvedVariables = resolveVariables(file, expr, bundles, true,
returnEqualedVariablesOnly);
Set<TextProposal> proposals = new
TreeSet<TextProposal>(TextProposal.KB_PROPOSAL_ORDER);
- ELSegmentImpl segment = new MessagePropertyELSegmentImpl();
- segment.setToken(left.getFirstToken());
- processMessageBundleSegment(expr, (MessagePropertyELSegmentImpl)segment,
resolvedVariables);
-
- segment.setResolved(false);
- resolution.addSegment(segment);
-
- for (Variable var : resolvedVariables) {
- String varName = var.getName();
- if(varName.startsWith(operand.getText())) {
- TextProposal proposal = new TextProposal();
- proposal.setReplacementString(varName.substring(operand.getLength()));
- setImage(proposal);
- proposals.add(proposal);
+ if (left != null) {
+ ELSegmentImpl segment = new MessagePropertyELSegmentImpl();
+ segment.setToken(left.getFirstToken());
+ processMessageBundleSegment(expr, (MessagePropertyELSegmentImpl)segment,
resolvedVariables);
+
+ segment.setResolved(false);
+ resolution.addSegment(segment);
+
+ for (Variable var : resolvedVariables) {
+ String varName = var.getName();
+ if(varName.startsWith(operand.getText())) {
+ TextProposal proposal = new TextProposal();
+ proposal.setReplacementString(varName.substring(operand.getLength()));
+ setImage(proposal);
+ proposals.add(proposal);
+ }
}
+ resolution.setProposals(proposals);
+ segment.setResolved(!proposals.isEmpty());
}
- resolution.setProposals(proposals);
- segment.setResolved(!proposals.isEmpty());
return resolution;
}
Show replies by date