public boolean isInComment(@NotNull PsiFile file, @NotNull Editor editor,  int offset) {
    return PsiTreeUtil.getParentOfType(file.findElementAt(offset), PsiComment.class) != null;
  }
public boolean isInComment(@NotNull PsiFile file, @NotNull Editor editor,  int offset)