private static @NotNull List<PsiFileStub<?>> restoreStubsFromText(FileViewProvider viewProvider) {
    Project project = viewProvider.getManager().getProject();
    FileContentImpl fc = (FileContentImpl)FileContentImpl.createByText(viewProvider.getVirtualFile(),
                                                                       viewProvider.getContents(),
                                                                       project);
    fc.setProject(project);
    PsiFileStubImpl<?> copyTree = (PsiFileStubImpl<?>)StubTreeBuilder.buildStubTree(fc);
    return copyTree == null ? Collections.emptyList() : Arrays.asList(copyTree.getStubRoots());
  }
private static @NotNull List<PsiFileStub<?>> restoreStubsFromText(FileViewProvider viewProvider)