private bool CheckVersions(
     Document document, VersionStamp textVersion, VersionStamp dependentProjectVersion, VersionStamp dependentSemanticVersion, Data existingData)
 {
     // first check full version to see whether we can reuse data in same session, if we can't, check timestamp only version to see whether
     // we can use it cross-session.
     return document.CanReusePersistedTextVersion(textVersion, existingData.TextVersion) &&
            document.Project.CanReusePersistedDependentSemanticVersion(dependentProjectVersion, dependentSemanticVersion, existingData.SemanticVersion);
 }