EA-119439 - ISE: FileContentImpl.createFileFromText

This commit is contained in:
Gregory.Shrago
2018-04-19 07:45:49 +03:00
parent fedcf44f16
commit e8487f15df
@@ -169,7 +169,8 @@ public class StubViewerPsiBasedTree implements ViewerPsiBasedTree {
@Nullable
private static Stub buildStubForElement(Project project, PsiElement rootElement, @NotNull String textToParse) {
Stub stub = null;
StubTree tree = ((PsiFileWithStubSupport)rootElement).getStubTree();
PsiFileWithStubSupport psiFile = (PsiFileWithStubSupport)rootElement;
StubTree tree = psiFile.getStubTree();
if (tree != null) {
stub = tree.getRoot();
}
@@ -183,6 +184,7 @@ public class StubViewerPsiBasedTree implements ViewerPsiBasedTree {
try {
fc = new FileContentImpl(file, file.contentsToByteArray());
fc.putUserData(IndexingDataKeys.PROJECT, project);
fc.putUserData(IndexingDataKeys.PSI_FILE, psiFile);
stub = StubTreeBuilder.buildStubTree(fc);
}
catch (IOException e) {