Smarter snippet scope matching