mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[dbe] WEB-72084 Migrate XML injector and default language injector to the new MultiHostRegistrar API.
GitOrigin-RevId: 2277969d3916ae5163ba5960da4e58fe137cb03b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
874b64c36f
commit
be17cfb09e
+7
-4
@@ -44,10 +44,13 @@ final class DefaultLanguageInjectionPerformer implements FallbackInjectionPerfor
|
||||
|
||||
List<InjectorUtils.InjectionInfo> 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;
|
||||
}
|
||||
|
||||
|
||||
+6
-7
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user