Add synchronous API to get surrounding text