private bool InSameBlock(IReferenceExpression fullReferenceExpression, ITreeNode storage) { var firstStatement = fullReferenceExpression.GetContainingStatement(); var secondStatement = storage.GetContainingNode <IStatement>(); if (firstStatement == null || secondStatement == null) { return(false); } return(firstStatement.Parent == secondStatement.Parent); }