Author: scabanovich
Date: 2009-08-18 13:05:00 -0400 (Tue, 18 Aug 2009)
New Revision: 17139
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4781
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2009-08-18
16:35:16 UTC (rev 17138)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2009-08-18
17:05:00 UTC (rev 17139)
@@ -933,8 +933,17 @@
if (n instanceof IDOMAttr) {
text = ((IDOMAttr)n).getValueRegionText();
region = ((IDOMAttr)n).getValueRegion();
- startOffset = ((IndexedRegion)((IDOMAttr)n).getOwnerElement()).getStartOffset();
- startOffset += region.getStart();
+ startOffset = ((IndexedRegion)((IDOMAttr)n).getOwnerElement()).getStartOffset();
+ if(region != null) {
+ startOffset += region.getStart();
+ } else {
+ region = ((IDOMAttr)n).getEqualRegion();
+ if(region != null) {
+ startOffset += region.getStart() + region.getLength();
+ } else {
+ startOffset = ((IDOMAttr)n).getEndOffset();
+ }
+ }
} else if (n instanceof IDOMText) {
text = ((IDOMText)n).getNodeValue();
region = ((IDOMText)n).getFirstStructuredDocumentRegion();
@@ -945,7 +954,7 @@
}
int inValueOffset = getOffset() - startOffset;
- if (text.length() < inValueOffset) { // probably, the attribute value ends before
the document position
+ if (text != null && text.length() < inValueOffset) { // probably, the
attribute value ends before the document position
return null;
}
if (inValueOffset<0) {