@Override
  public void doInvoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
    final PsiComment typeComment = findCommentUnderCaret(editor, file);
    if (typeComment != null) {
      final SmartPointerManager manager = SmartPointerManager.getInstance(project);
      final SmartPsiElementPointer<PsiComment> commentPointer = manager.createSmartPsiElementPointer(typeComment);
      final Map<PyTargetExpression, String> map = mapTargetsToAnnotations(typeComment);
      if (!map.isEmpty()) {
        if (typeComment.getParent() instanceof PyAssignmentStatement && map.size() == 1) {
          final PyTargetExpression target = ContainerUtil.getFirstItem(map.keySet());
          assert target != null;
          PyTypeHintGenerationUtil.insertVariableAnnotation(target, null, new AnnotationInfo(map.get(target)), false);
        }
        else {
          for (Map.Entry<PyTargetExpression, String> entry : new ArrayList<>(map.entrySet())) {
            PyTypeHintGenerationUtil.insertVariableAnnotation(entry.getKey(), null, new AnnotationInfo(entry.getValue()), false);
          }
        }

        final PsiComment staleComment = commentPointer.getElement();
        if (staleComment != null) {
          staleComment.delete();
        }
      }
    }
  }
@Override
  public void doInvoke(@NotNull Project project, Editor editor, PsiFile file)