public static @Nullable LineMarkerInfo addLineSeparatorIfNeeded(@NotNull Provider provider, @NotNull PsiElement element) {
    final Ref<LineMarkerInfo> info = new Ref<>(null);
    ApplicationManager.getApplication().runReadAction(() -> {
      if (!provider.isSeparatorAllowed(element)) {
        return;
      }
      boolean hasSeparableBefore = false;
      final PsiElement parent = element.getParent();
      if (parent == null) {
        return;
      }
      for (PsiElement child : parent.getChildren()) {
        if (child == element){
          break;
        }
        if (provider.isSeparatorAllowed(child)) {
          hasSeparableBefore = true;
          break;
        }
      }
      if (!hasSeparableBefore) {
        return;
      }
      info.set(createLineSeparatorByElement(element));
    });
    return info.get();
  }
public static @Nullable LineMarkerInfo addLineSeparatorIfNeeded(@NotNull Provider provider, @NotNull PsiElement element)