private static boolean processDeclarationsInMethodLike(@NotNull PsiParameterListOwner element,
                                                         @NotNull PsiScopeProcessor processor,
                                                         @NotNull ResolveState state,
                                                         @NotNull PsiElement place,
                                                         boolean fromBody,
                                                         @Nullable PsiTypeParameterList typeParameterList) {
    processor.handleEvent(PsiScopeProcessor.Event.SET_DECLARATION_HOLDER, element);

    if (typeParameterList != null) {
      final ElementClassHint hint = processor.getHint(ElementClassHint.KEY);
      if (hint == null || hint.shouldProcess(ElementClassHint.DeclarationKind.CLASS)) {
        if (!typeParameterList.processDeclarations(processor, state, null, place)) return false;
      }
    }

    if (fromBody) {
      final PsiParameter[] parameters = element.getParameterList().getParameters();
      for (PsiParameter parameter : parameters) {
        if (parameter.isUnnamed()) continue;
        if (!processor.execute(parameter, state)) return false;
      }
    }

    return true;
  }
private static boolean processDeclarationsInMethodLike(@NotNull PsiParameterListOwner element,
                                                         @NotNull PsiScopeProcessor processor,
                                                         @NotNull ResolveState state,
                                                         @NotNull PsiElement place,
                                                         boolean fromBody,
                                                         @Nullable PsiTypeParameterList typeParameterList)