private static Pair<PsiReference[], Boolean> doGetReferencesByElement(final @NotNull PsiElement element,
                                                                        final @NotNull ProcessingContext context) {
    final List<PsiReference> references = new SmartList<>();
    Project project = element.getProject();
    Configuration configuration = Configuration.getProjectInstance(project);
    final Ref<Boolean> injected = new Ref<>(Boolean.FALSE);
    for (ReferenceInjector injector : ReferenceInjector.EXTENSION_POINT_NAME.getExtensionList()) {
      Collection<BaseInjection> injections = configuration.getInjectionsByLanguageId(injector.getId());
      for (BaseInjection injection : injections) {
        if (injection.acceptForReference(element)) {
          injected.set(Boolean.TRUE);
          LanguageInjectionSupport support = InjectorUtils.findInjectionSupport(injection.getSupportId());
          element.putUserData(LanguageInjectionSupport.INJECTOR_SUPPORT, support);
          List<TextRange> area = injection.getInjectedArea(element);
          for (TextRange range : area) {
            references.addAll(Arrays.asList(injector.getReferences(element, context, range)));
          }
        }
      }
    }
    if (element instanceof PsiLanguageInjectionHost) {
      final TemporaryPlacesRegistry registry = TemporaryPlacesRegistry.getInstance(project);
      InjectedLanguage language = registry.getLanguageFor((PsiLanguageInjectionHost)element, element.getContainingFile());
      if (language != null) {
        ReferenceInjector injector = ReferenceInjector.findById(language.getID());
        if (injector != null) {
          injected.set(Boolean.TRUE);
          element.putUserData(LanguageInjectionSupport.INJECTOR_SUPPORT, registry.getLanguageInjectionSupport());
          TextRange range = ElementManipulators.getValueTextRange(element);
          references.addAll(Arrays.asList(injector.getReferences(element, context, range)));
        }
      }
      else {
        PsiFile containingFile = element.getContainingFile();
        InjectedLanguageManager
          .getInstance(containingFile.getProject()).enumerateEx(element, containingFile, false, new InjectedReferenceVisitor() {
          @Override
          public void visitInjectedReference(@NotNull ReferenceInjector injector,
                                             @NotNull List<? extends PsiLanguageInjectionHost.Shred> places) {
            injected.set(Boolean.TRUE);
            element.putUserData(LanguageInjectionSupport.INJECTOR_SUPPORT, registry.getLanguageInjectionSupport());
            for (PsiLanguageInjectionHost.Shred place : places) {
              if (place.getHost() == element) {
                references.addAll(Arrays.asList(injector.getReferences(element, context, place.getRangeInsideHost())));
              }
            }
          }
        });
      }
    }
    return Pair.create(references.toArray(PsiReference.EMPTY_ARRAY), injected.get());
  }
private static Pair<PsiReference[], Boolean> doGetReferencesByElement(final @NotNull PsiElement element,
                                                                        final @NotNull ProcessingContext context)