void (final @NotNull List<? extends PsiElement> elements, final @NotNull Collection<? super LineMarkerInfo<?>> result) { Map<LineMarkerProvider, List<PsiElement>> embeddedLineMarkersWorkItems = null; for(PsiElement element:elements) { if(element instanceof PsiWhiteSpace) continue; final Language language = element.getLanguage(); if (!(language instanceof XMLLanguage)) { List<LineMarkerProvider> lineMarkerProviders = LineMarkerProviders.getInstance().allForLanguage(language); for (LineMarkerProvider provider : lineMarkerProviders) { if (provider instanceof HtmlLineMarkerProvider) continue; if (embeddedLineMarkersWorkItems == null) { embeddedLineMarkersWorkItems = new HashMap<>(); } embeddedLineMarkersWorkItems.computeIfAbsent(provider, k -> new ArrayList<>(5)).add(element); } } } if (embeddedLineMarkersWorkItems != null) { for(Map.Entry<LineMarkerProvider, List<PsiElement>> entry:embeddedLineMarkersWorkItems.entrySet()) { entry.getKey().collectSlowLineMarkers(entry.getValue(), result); } } }