boolean () { final PsiFile file = getContainingFile(); if (!(file instanceof GroovyFile groovyFile)) return false; if (groovyFile.isScript()) return false; final String name = getName(); final VirtualFile vFile = groovyFile.getVirtualFile(); return vFile != null && name != null && name.equals(vFile.getNameWithoutExtension()); }