InjectedFileChangesHandler (@NotNull PsiFile injectedFile, @NotNull Editor editor, @NotNull Place shreds, @NotNull Document document) { PsiLanguageInjectionHost host = ContainerUtil.getFirstItem(shreds).getHost(); InjectedFileChangesHandlerProvider changesHandlerFactory = host == null ? null : InjectedFileChangesHandlerProvider.EP.forLanguage(host.getLanguage()); if (changesHandlerFactory != null) { return changesHandlerFactory.createFileChangesHandler(shreds, editor, document, injectedFile); } if (ContainerUtil.or(shreds, it -> InjectionMeta.INJECTION_INDENT.get(it.getHost()) != null)) { return new IndentAwareInjectedFileChangesHandler(shreds, editor, document, injectedFile); } return new CommonInjectedFileChangesHandler(shreds, editor, document, injectedFile); }