public static @Nullable Editor getEditor(@NotNull  PsiElement element) {
    Document document = PsiDocumentManager.getInstance(element.getProject()).getDocument(element.getContainingFile());
    if (document == null) {
      return null;
    }

    return PsiEditorUtil.findEditor(element);
  }
public static @Nullable Editor getEditor(@NotNull  PsiElement element)