ForkJoinTask<Boolean> (@NotNull LocalInspectionToolSession session, @NotNull BlockingQueue<Pair<PsiFile, PsiElement>> injectedFilesWithHosts, @NotNull List<? extends LocalInspectionToolWrapper> wrappers, @NotNull List<? super InspectionContext> outInjectedContexts, @NotNull BiConsumer<? super ProblemDescriptor, ? super InspectionProblemHolder> addDescriptorIncrementallyCallback, @NotNull Consumer<? super InspectionContext> contextFinishedCallback, @Nullable Condition<? super LocalInspectionToolWrapper> enabledToolsPredicate, @NotNull Pair<PsiFile, PsiElement> tombStone) { return processInOrderAsync(injectedFilesWithHosts, tombStone, pair -> { PsiFile injectedPsi = pair.getFirst(); if (!shouldInspect(injectedPsi)) { return; } PsiElement host = pair.getSecond(); BiConsumer<? super ProblemDescriptor, ? super InspectionProblemHolder> applyIncrementallyCallback = (descriptor, holder) -> { PsiElement descriptorPsiElement = descriptor.getPsiElement(); LocalInspectionToolWrapper wrapper = holder.myToolWrapper; if (myIgnoreSuppressed && (wrapper.getTool().isSuppressedFor(host) || descriptorPsiElement != null && wrapper.getTool().isSuppressedFor(descriptorPsiElement))) { registerSuppressedElements(host, wrapper.getID(), wrapper.getAlternativeID()); return/* false*/; } if (myIsOnTheFly) { addDescriptorIncrementallyCallback.accept(descriptor, holder); } }; // convert host priority range to the injected Document document = PsiDocumentManager.getInstance(myPsiFile.getProject()).getDocument(injectedPsi); TextRange injectedPriorityRange; if (document instanceof DocumentWindow documentWindow) { int start = documentWindow.hostToInjected(myPriorityRange.getStartOffset()); int end = documentWindow.hostToInjected(myPriorityRange.getEndOffset()); injectedPriorityRange = TextRange.isProperRange(start, end) ? new TextRange(start, end) : TextRange.EMPTY_RANGE; } else { injectedPriorityRange = TextRange.EMPTY_RANGE; } InspectionRunner injectedRunner = new InspectionRunner(injectedPsi, injectedPsi.getTextRange(), injectedPriorityRange, false, myIsOnTheFly, myProgress, myIgnoreSuppressed, myInspectionProfileWrapper, mySuppressedElements); List<? extends InspectionContext> injectedContexts = injectedRunner.inspect( wrappers, session.getMinimumSeverity(), true, applyIncrementallyCallback, contextFinishedCallback, enabledToolsPredicate); outInjectedContexts.addAll(injectedContexts); }); }