I still think it's worth adding a clarifying comment to setCurrentDocument()'s isWithinProject() check, also.  That and my comment below about getDocumentForPath() are the only pieces of this not yet addressed.