void (@NotNull PsiElement from, @Nullable PsiElement upUntil, @NotNull PsiFile hostFile, @Nullable InjectionResult result) { Supplier<InjectionResult> cachedRef = result == null || result.isEmpty() ? getEmptyInjectionResult(hostFile) : new SoftReference<>(result); for (PsiElement e = from; e != upUntil && e != null; e = e.getParent()) { ProgressManager.checkCanceled(); e.putUserData(INJECTED_PSI, cachedRef); } }