boolean (@NotNull PsiFile file) { if (!(file instanceof PsiFileImpl)) return false; VirtualFile vFile = file.getVirtualFile(); IStubFileElementType<?> elementType = ((PsiFileImpl)file).getElementTypeForStubBuilder(); return elementType != null && vFile != null && elementType.shouldBuildStubFor(vFile); }