Moved method to ScalaPsiUtil.