Author: scabanovich
Date: 2009-08-04 07:39:16 -0400 (Tue, 04 Aug 2009)
New Revision: 16958
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
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-3750
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2009-08-04 09:22:50 UTC (rev
16957)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2009-08-04 11:39:16 UTC (rev
16958)
@@ -451,6 +451,7 @@
<partitiontype id="org.eclipse.jst.jsp.SCRIPT.DELIMITER" />
<partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL" />
<partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" />
+ <partitiontype id="org.eclipse.wst.css.STYLE" />
</contenttype>
</contentAssistProcessor>
@@ -476,6 +477,7 @@
<partitiontype id="org.eclipse.wst.html.HTML_DEFAULT" />
<partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL" />
<partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" />
+ <partitiontype id="org.eclipse.wst.css.STYLE" />
</contenttype>
</contentAssistProcessor>
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-04
09:22:50 UTC (rev 16957)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2009-08-04
11:39:16 UTC (rev 16958)
@@ -521,6 +521,10 @@
*/
protected ContentAssistRequest computeCompletionProposals(int documentPosition, String
matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
ContentAssistRequest contentAssistRequest =
super.computeCompletionProposals(documentPosition, matchString, completionRegion,
treeNode, xmlnode);
+ if (contentAssistRequest == null) {
+ IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+ contentAssistRequest = newContentAssistRequest((Node) treeNode,
treeNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, "");
//$NON-NLS-1$
+ }
String regionType = completionRegion.getType();
IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
@@ -531,7 +535,11 @@
if ((xmlnode.getNodeType() == Node.ELEMENT_NODE) || (xmlnode.getNodeType() ==
Node.DOCUMENT_NODE)) {
if (regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
addAttributeNameProposals(contentAssistRequest);
- } else if ((regionType == DOMRegionContext.XML_CONTENT) || (regionType ==
DOMRegionContext.XML_CHAR_REFERENCE) || (regionType ==
DOMRegionContext.XML_ENTITY_REFERENCE) || (regionType ==
DOMRegionContext.XML_PE_REFERENCE)) {
+ } else if ((regionType == DOMRegionContext.XML_CONTENT)
+ || (regionType == DOMRegionContext.XML_CHAR_REFERENCE)
+ || (regionType == DOMRegionContext.XML_ENTITY_REFERENCE)
+ || (regionType == DOMRegionContext.XML_PE_REFERENCE)
+ || (regionType == DOMRegionContext.BLOCK_TEXT)) {
addTextELProposals(contentAssistRequest);
}
}
@@ -673,7 +681,7 @@
// Get Fixed Structured Document Region
IStructuredDocumentRegion sdFixedRegion =
this.getStructuredDocumentRegion(getOffset());
if (sdFixedRegion == null)
- return EMPTY_TAGS;
+ return null;
n = findNodeForOffset(xmlDocument, sdFixedRegion.getStartOffset());
}