private boolean isFromEnclosingScope(@NotNull PsiElement element) {
    return inSameFile(element, myFunction) &&
           !belongsToFunction(element) &&
           !(ScopeUtil.getScopeOwner(element) instanceof PsiFile); 
  }
private boolean isFromEnclosingScope(@NotNull PsiElement element)