private @NotNull List<LineMarkerInfo<?>> doCollectMarkers() {
    if (!EditorSettingsExternalizable.getInstance().areGutterIconsShown() && !Registry.is("calculate.gutter.actions.always")) {
      // optimization: do not even try to query expensive providers if icons they are going to produce are not to be displayed
      return Collections.emptyList();
    }
    List<LineMarkerInfo<?>> lineMarkers = new ArrayList<>();
    FileViewProvider viewProvider = myFile.getViewProvider();
    int passId = getId();
    for (Language language : viewProvider.getLanguages()) {
      PsiFile root = viewProvider.getPsi(language);
      if (root == null) {
        LOG.error(viewProvider+" for file " +myFile+" returned null root for language "+language+" despite listing it as one of its own languages: "+viewProvider.getLanguages());
        continue;
      }
      HighlightingLevelManager highlightingLevelManager = HighlightingLevelManager.getInstance(myProject);
      if (!highlightingLevelManager.shouldHighlight(root)) continue;
      Divider.divideInsideAndOutsideInOneRoot(root, TextRangeScalarUtil.toScalarRange(myRestrictRange), TextRangeScalarUtil.toScalarRange(myPriorityBounds),
           elements -> {
             Collection<LineMarkerProvider> providers = getMarkerProviders(language, myProject);
             List<LineMarkerProvider> providersList = new ArrayList<>(providers);
             queryProviders(
               elements.inside(), root, providersList, (__, info) -> {
                 info.updatePass = passId;
                 lineMarkers.add(info);
                 LineMarkersUtil.addLineMarkerToEditorIncrementally(myProject, getDocument(), info);
               });
             queryProviders(elements.outside(), root, providersList,
               (__, info) -> {
                 info.updatePass = passId;
                 lineMarkers.add(info);
               });
             return true;
           });
    }

    List<LineMarkerInfo<?>> markers = mergeLineMarkers(lineMarkers, getDocument(), passId);
    if (LOG.isDebugEnabled()) {
      LOG.debug("LineMarkersPass.doCollectInformation. lineMarkers: " + lineMarkers+"; merged: "+markers);
    }
    return markers;
  }
private @NotNull List<LineMarkerInfo<?>> doCollectMarkers()