@ Nullable private ScopeBlock findPreviousSiblingScopeBlock ( ScopeBlock sb ) { ScopeBlock parent = sb . getParent ( ) ; if ( parent == null ) { return null ; } List < ScopeBlock > children = parent . getChildren ( ) ; if ( children == null ) { return null ; } ScopeBlock lastSibling = null ; for ( ScopeBlock sibling : children ) { if ( sibling . equals ( sb ) ) { return lastSibling ; } lastSibling = sibling ; } return null ; }
looks for the ScopeBlock has the same parent as this given one but precedes it in the list .