boolean (@NotNull VirtualFile file, @NotNull Project project) { if (ScratchUtil.isScratch(file)) { return false; } final String ext = file.getExtension(); if (SUPPORTED_FILE_TYPES.contains(ext)) { return ProjectRootManager.getInstance(project).getFileIndex().getSourceRootForFile(file) == null; } if (ext != null && SUPPORTED_IN_TEST_DATA_FILE_TYPES.contains(ext)) { int i = 0; VirtualFile parent = file.getParent(); while (parent != null && i < MAX_HOPES) { if (StringUtil.toLowerCase(parent.getName()).contains(TEST_DATA)) { return true; } i++; parent = parent.getParent(); } } return false; }