void (@NotNull MultiHostRegistrar registrar, @NotNull PsiElement host) { if (!host.isValid() || !(host instanceof XmlText) || !HtmlUtil.isHtmlTagContainingFile(host)) { return; } XmlTag scriptTag = ((XmlText)host).getParentTag(); if (scriptTag == null) { return; } final Language language = getScriptLanguageToInject(scriptTag); if (language == null || HtmlScriptInjectionBlockerExtension.isInjectionBlocked(scriptTag, language)) { return; } if (LanguageUtil.isInjectableLanguage(language)) { List<PsiElement> elements = ContainerUtil.filter(host.getChildren(), (child) -> !(child instanceof OuterLanguageElement)); if (elements.isEmpty()) return; registrar.startInjecting(language); for (PsiElement child : elements) { registrar.addPlace(null, null, (PsiLanguageInjectionHost)host, child.getTextRangeInParent()); } registrar.doneInjecting(); } }