void (@NotNull PsiElement element) { if (element instanceof PsiLanguageInjectionHost) { InjectedLanguageManager.getInstance(psiFile.getProject()).enumerate(element, (injectedPsi, places) -> { if (places.size() == 1) { Document document = PsiDocumentManager.getInstance(injectedPsi.getProject()).getCachedDocument(injectedPsi); if (!(document instanceof DocumentWindow)) return; for (TodoItem item : helper.findTodoItems(injectedPsi)) { TextRange rangeInHost = ((DocumentWindow)document).injectedToHost(item.getTextRange()); List<TextRange> additionalRanges = ContainerUtil.map(item.getAdditionalTextRanges(), ((DocumentWindow)document)::injectedToHost); TodoItemImpl hostItem = new TodoItemImpl(psiFile, rangeInHost.getStartOffset(), rangeInHost.getEndOffset(), item.getPattern(), additionalRanges); todoItems.add(hostItem); } } }); } super.visitElement(element); }