Language (@NotNull PsiElement context) { for (LanguageInjectionSupport support : InjectorUtils.getActiveInjectionSupports()) { if (support instanceof PyLanguageInjectionSupport) { final Configuration configuration = Configuration.getInstance(); for (BaseInjection injection : configuration.getInjections(support.getId())) { if (injection.acceptsPsiElement(context)) { return InjectedLanguage.findLanguageById(injection.getInjectedLanguageId()); } } } } return null; }