boolean (@NotNull PsiFile file) { if (file instanceof PsiJavaFile && !TemplateLanguageUtil.isTemplateDataFile(file)) { VirtualFile virtualFile = PsiUtilCore.getVirtualFile(file); return virtualFile != null && (ProjectRootManager.getInstance(file.getProject()).getFileIndex().isInSource(virtualFile) || ScratchUtil.isScratch(virtualFile)); } return false; }