@Override
  protected boolean isEnabledOnElements(PsiElement @NotNull [] elements) {
    for (PsiElement element : elements) {
      final PsiFile containingFile = element.getContainingFile();
      if (!(containingFile instanceof GroovyFile) || isScriptFile((GroovyFile)containingFile)) {
        return false;
      }
    }
    return true;
  }
@Override
  protected boolean isEnabledOnElements(PsiElement @NotNull [] elements)