@Override
  protected GrControlFlowOwner @NotNull [] findPossibleScopes(GrExpression selectedExpr,
                                                              GrVariable variable,
                                                              StringPartInfo stringPartInfo,
                                                              Editor editor) {
    // Get container element
    final GrControlFlowOwner scope = ControlFlowUtils.findControlFlowOwner(stringPartInfo != null ? stringPartInfo.getLiteral() : selectedExpr);
    if (scope == null) {
      throw new GrRefactoringError(
        GroovyRefactoringBundle.message("refactoring.is.not.supported.in.the.current.context", getRefactoringNameText()));
    }
    if (!GroovyRefactoringUtil.isAppropriateContainerForIntroduceVariable(scope)) {
      throw new GrRefactoringError(
        GroovyRefactoringBundle.message("refactoring.is.not.supported.in.the.current.context", getRefactoringNameText()));
    }
    return new GrControlFlowOwner[]{scope};
  }
@Override
  protected GrControlFlowOwner @NotNull [] findPossibleScopes(GrExpression selectedExpr,
                                                              GrVariable variable,
                                                              StringPartInfo stringPartInfo,
                                                              Editor editor)