boolean (@NotNull MultiHostRegistrar registrar, @NotNull Injection injection, @NotNull PsiElement context) { if (!(context instanceof PsiLanguageInjectionHost host) || !((PsiLanguageInjectionHost)context).isValidHost()) { return false; } PsiFile containingFile = context.getContainingFile(); InjectedLanguage injectedLanguage = InjectedLanguage.create(injection.getInjectedLanguageId(), injection.getPrefix(), injection.getSuffix(), false); String injectionSupportId = injection.getSupportId(); LanguageInjectionSupport support = injectionSupportId != null ? InjectorUtils.findInjectionSupport(injectionSupportId) : null; Language language = injectedLanguage.getLanguage(); final ElementManipulator<PsiLanguageInjectionHost> manipulator = ElementManipulators.getManipulator(host); if (language == null || manipulator == null) { if (injection instanceof BaseInjection) { return InjectorUtils.registerInjectionSimple(host, (BaseInjection)injection, support, registrar); } return false; } 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); } return true; }