void (char c, @NotNull Editor editor, @NotNull PsiFile file) { if (c == '@') { final int offset = editor.getCaretModel().getOffset(); PsiElement currElement = file.findElementAt(offset); if (currElement instanceof PsiWhiteSpace) { PsiElement prev = currElement.getPrevSibling(); if (prev != null && prev.getNode().getElementType() == JavaDocTokenType.DOC_COMMENT_LEADING_ASTERISKS) { editor.getDocument().replaceString(currElement.getTextRange().getStartOffset(), offset - 1, " "); } } } }