@Override
  protected boolean isAvailableImpl(int offset) {
    PsiNewExpression expression = getNewExpression();
    if (rejectContainer(expression)) {
      return false;
    }

    PsiFile targetFile = getTargetFile(expression);
    if (targetFile != null && !targetFile.getManager().isInProject(targetFile)) {
      return false;
    }

    PsiElement nameElement = getNameElement(expression);
    if (CreateFromUsageUtils.shouldShowTag(offset, nameElement, expression)) {
      String varName = nameElement.getText();
      setText(getText(varName));
      return true;
    }

    return false;
  }
@Override
  protected boolean isAvailableImpl(int offset)