@Override
  public void expandForChooseExpression(@NotNull PsiElement expression, @NotNull Editor editor) {
    if (expression instanceof PsiReferenceExpression ref) {
      JavaResolveResult result = DumbService.getInstance(expression.getProject())
        .withAlternativeResolveEnabled(() -> ref.advancedResolve(true));
      PsiElement element = result.getElement();
      
      if (element == null) {
        String name = ref.getReferenceName();
        if (name != null && ref.getQualifierExpression() == null) {
          PsiClass[] classes = DumbModeAccessType.RELIABLE_DATA_ONLY.ignoreDumbMode(
            () -> PsiShortNamesCache.getInstance(ref.getProject()).getClassesByName(name, ref.getResolveScope()));
          if (classes.length == 1) {
            element = classes[0];
          }
        }
      }

      if (element instanceof PsiClass psiClass) {
        WriteAction.run(() -> insertConstructorCallWithSmartBraces(expression, editor, psiClass));
        return;
      }
    }
    super.expandForChooseExpression(expression, editor);
  }
@Override
  public void expandForChooseExpression(@NotNull PsiElement expression, @NotNull Editor editor)