Result (@NotNull PsiFileSystemItem file) { ThreadingAssertions.assertEventDispatchThread(); Project project = file.getProject(); VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile == null) { return Result.UH_UH; } if (file instanceof PsiCodeFragment) { return Result.UH_HUH; } if (ScratchUtil.isScratch(virtualFile)) { return canUndo(virtualFile, project) ? Result.UH_HUH : Result.UH_UH; } return canUndo(virtualFile, project) ? Result.ONLY_WHEN_IN_CONTENT : Result.UH_UH; }