use of com.intellij.util.indexing.FileContent in project intellij-community by JetBrains.
the class CoreStubTreeLoader method readOrBuild.
@Override
public ObjectStubTree readOrBuild(Project project, VirtualFile vFile, @Nullable PsiFile psiFile) {
if (!canHaveStub(vFile)) {
return null;
}
try {
final FileContent fc = new FileContentImpl(vFile, vFile.contentsToByteArray());
fc.putUserData(IndexingDataKeys.PROJECT, project);
final Stub element = StubTreeBuilder.buildStubTree(fc);
if (element instanceof PsiFileStub) {
return new StubTree((PsiFileStub) element);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
return null;
}
Aggregations