private PsiMethod findSurroundingConstructor(@NotNull PsiElement entry) {
    PsiMethod result = null;
    PsiElement element;
    for (element = entry; element != null && !(element instanceof PsiFile); element = element.getParent()) {
      result = myInsideConstructorOfClassCache.get(element);
      if (result != null || myInsideConstructorOfClassCache.containsKey(element)) {
        break;
      }
      if (element instanceof PsiMethod method && method.isConstructor()) {
        result = method;
        break;
      }
    }
    for (PsiElement e = entry; e != null && !(e instanceof PsiFile); e = e.getParent()) {
      myInsideConstructorOfClassCache.put(e, result);
      if (e == element) break;
    }
    return result;
  }
private PsiMethod findSurroundingConstructor(@NotNull PsiElement entry)