diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/DefaultLanguageInjectionPerformer.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/DefaultLanguageInjectionPerformer.java index 957c542e0c0f..50fc47964e02 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/DefaultLanguageInjectionPerformer.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/DefaultLanguageInjectionPerformer.java @@ -44,10 +44,13 @@ final class DefaultLanguageInjectionPerformer implements FallbackInjectionPerfor List infos = List.of(new InjectorUtils.InjectionInfo(host, injectedLanguage, manipulator.getRangeInElement(host))); - InjectorUtils.registerInjection(language, containingFile, infos, registrar); - if (support != null) { - InjectorUtils.registerSupport(support, false, context, language); - } + InjectorUtils.registerInjection( + language, containingFile, infos, registrar, it -> { + if (support != null) { + InjectorUtils.registerSupport(it, support, true); + } + } + ); return true; } diff --git a/plugins/IntelliLang/xml-support/src/org/intellij/plugins/intelliLang/inject/xml/XmlLanguageInjector.java b/plugins/IntelliLang/xml-support/src/org/intellij/plugins/intelliLang/inject/xml/XmlLanguageInjector.java index daf5880d20b1..17f9dda3cd58 100644 --- a/plugins/IntelliLang/xml-support/src/org/intellij/plugins/intelliLang/inject/xml/XmlLanguageInjector.java +++ b/plugins/IntelliLang/xml-support/src/org/intellij/plugins/intelliLang/inject/xml/XmlLanguageInjector.java @@ -27,7 +27,6 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiLanguageInjectionHost; -import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil; import com.intellij.psi.xml.*; import com.intellij.util.PairProcessor; import com.intellij.util.PatternValuesIndex; @@ -84,12 +83,12 @@ final class XmlLanguageInjector implements MultiHostInjector { final TextRange textRange = trinity.range(); ranges.add(textRange.shiftRight(trinity.host().getTextRange().getStartOffset())); } - InjectorUtils.registerInjection(language, containingFile, list, registrar); - InjectorUtils.registerSupport(InjectorUtils.findNotNullInjectionSupport(XmlLanguageInjectionSupport.XML_SUPPORT_ID), - true, list.get(0).host(), language); - if (Boolean.TRUE.equals(unparsableRef.get())) { - InjectorUtils.putInjectedFileUserData(host, language, InjectedLanguageUtil.FRANKENSTEIN_INJECTION, Boolean.TRUE); - } + InjectorUtils.registerInjection(language, containingFile, list, registrar, it -> { + InjectorUtils.registerSupport(it, InjectorUtils.findNotNullInjectionSupport(XmlLanguageInjectionSupport.XML_SUPPORT_ID), true); + if (Boolean.TRUE.equals(unparsableRef.get())) { + it.frankensteinInjection(true); + } + }); return true; }); }