mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[#2230] : ExternalDocumentValidator.addProblemToTagName (IDEADEV-7441)
This commit is contained in:
@@ -46,4 +46,18 @@ public class AntHighlightingTest extends DaemonAnalyzerTestCase {
|
||||
public void testSanity2() throws Exception { doTest(); }
|
||||
|
||||
public void testRefid() throws Exception { doTest(); }
|
||||
|
||||
public void testExternalValidator() throws Exception { doTest(); }
|
||||
|
||||
@Bombed(year = 2006, month = Calendar.AUGUST, day = 29, user = "lvo", time = 12, description = "Using property files")
|
||||
public void testProperties() throws Exception {
|
||||
configureByFiles(
|
||||
new VirtualFile[] {
|
||||
getVirtualFile(BASE_PATH + "/" + getTestName(false) + ".xml"),
|
||||
getVirtualFile(BASE_PATH + "/" + getTestName(false) + ".properties")
|
||||
},
|
||||
null
|
||||
);
|
||||
doDoTest(true, false);
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.impl.source.SourceTreeToPsiMap;
|
||||
import com.intellij.psi.impl.source.resolve.reference.impl.providers.XmlUtil;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.reference.SoftReference;
|
||||
@@ -306,6 +307,13 @@ public class ExternalDocumentValidator {
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
final XmlDocument document = ((XmlFile)containingFile).getDocument();
|
||||
final XmlTag rootTag = document != null ? document.getRootTag() : null;
|
||||
if (rootTag == null) return;
|
||||
|
||||
if (com.intellij.xml.util.XmlUtil.ANT_URI.equals(rootTag.getNamespace())) return;
|
||||
|
||||
final Project project = context.getProject();
|
||||
|
||||
SoftReference<ExternalDocumentValidator> validatorReference = project.getUserData(validatorInstanceKey);
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE project []>
|
||||
|
||||
<project name="Build" default="init" basedir=".">
|
||||
<target name="init">
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,3 @@
|
||||
A=foo
|
||||
B=goo
|
||||
C=boo
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
<project name="Build" default="init" basedir=".">
|
||||
<description>
|
||||
ANT build script
|
||||
</description>
|
||||
|
||||
<target name="init">
|
||||
<property file="Properties.properties"/>
|
||||
<property name="single" value ="${A}"/>
|
||||
<property name="combined" value ="${A},${B},${C}"/>
|
||||
</target>
|
||||
</project>
|
||||
Reference in New Issue
Block a user