EA-42317 - RE: PsiFileFactoryImpl.createFileFromText

This commit is contained in:
Dmitry Avdeev
2012-12-27 16:58:37 +04:00
parent 3b84f21f0f
commit 6f02422f2b
2 changed files with 4 additions and 5 deletions
@@ -15,6 +15,7 @@
*/
package com.intellij.uiDesigner.binding;
import com.intellij.ide.highlighter.XmlFileType;
import com.intellij.lang.properties.psi.PropertiesFile;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.fileTypes.StdFileTypes;
@@ -117,14 +118,11 @@ public class FormReferenceProvider extends PsiReferenceProvider {
final Project project = file.getProject();
final XmlTag rootTag = ApplicationManager.getApplication().runReadAction(new Computable<XmlTag>() {
public XmlTag compute() {
final XmlFile xmlFile = (XmlFile) PsiFileFactory.getInstance(project).createFileFromText("a.xml", file.getText());
final XmlDocument document = xmlFile.getDocument();
return document.getRootTag();
final XmlFile xmlFile = (XmlFile) PsiFileFactory.getInstance(project).createFileFromText("a.xml", XmlFileType.INSTANCE, file.getText());
return xmlFile.getRootTag();
}
});
if (rootTag == null || !Utils.FORM_NAMESPACE.equals(rootTag.getNamespace())) {
return;
}
+1
View File
@@ -27,6 +27,7 @@
<orderEntry type="module" module-name="platform-api" />
<orderEntry type="module" module-name="spellchecker" />
<orderEntry type="module" module-name="jps-builders" />
<orderEntry type="module" module-name="xml" />
</component>
<component name="copyright">
<Base>