do not inject into attribyte containing entity refs, it causes assertions (IDEA-72972)

This commit is contained in:
Maxim.Mossienko
2012-02-04 14:02:01 +04:00
parent 0486fbbe72
commit 5a69818017
2 changed files with 4 additions and 4 deletions
@@ -15,6 +15,7 @@
*/
package org.intellij.lang.xpath.xslt.impl;
import com.intellij.lang.ASTNode;
import com.intellij.lang.Language;
import com.intellij.lang.LanguageParserDefinitions;
import com.intellij.lang.ParserDefinition;
@@ -28,6 +29,7 @@ import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.impl.source.xml.XmlAttributeValueImpl;
import com.intellij.psi.xml.XmlAttribute;
import com.intellij.psi.xml.XmlElementType;
import com.intellij.util.SmartList;
import org.intellij.lang.xpath.XPathFileType;
import org.intellij.lang.xpath.XPathTokenTypes;
@@ -144,6 +146,8 @@ public class XPathLanguageInjector implements MultiHostInjector {
XmlAttributeValueImpl value = (XmlAttributeValueImpl)attribute.getValueElement();
if (value == null) return;
ASTNode type = value.findChildByType(XmlElementType.XML_ENTITY_REF);
if (type != null) return; // workaround for inability to inject into text with entity refs (e.g. IDEA-72972) TODO: fix it
final TextRange[] ranges = getInjectionRanges(attribute);
for (TextRange range : ranges) {
// workaround for http://www.jetbrains.net/jira/browse/IDEA-10096
@@ -16,7 +16,6 @@
package org.intellij.lang.xpath.xslt;
import com.intellij.codeInsight.daemon.impl.analysis.XmlUnusedNamespaceInspection;
import com.intellij.idea.Bombed;
import com.intellij.javaee.ExternalResourceManagerEx;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
@@ -27,8 +26,6 @@ import com.intellij.util.ArrayUtil;
import org.intellij.lang.xpath.TestBase;
import org.intellij.lang.xpath.xslt.impl.XsltStuffProvider;
import java.util.Calendar;
/*
* Created by IntelliJ IDEA.
* User: sweinreuter
@@ -130,7 +127,6 @@ public class XsltHighlightingTest extends TestBase {
doXsltHighlighting();
}
@Bombed(user = "Maxim.Mossienko", month = Calendar.FEBRUARY, day = 15)
public void testXsltFreeze() throws Throwable {
doXsltHighlighting();
}