mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-42317 - RE: PsiFileFactoryImpl.createFileFromText
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user