codeintel: don't call getTextRange when there is no text to retrieve

(integrated from master branch change c08051b by Todd Whiteman <toddw@activestate.com>)