// Internal for testing internal void SynchronizeDocuments( IReadOnlyList <OmniSharpHostDocument> configuredHostDocuments, OmniSharpProjectSnapshot projectSnapshot, OmniSharpHostProject hostProject) { // Remove any documents that need to be removed foreach (var documentFilePath in projectSnapshot.DocumentFilePaths) { OmniSharpHostDocument associatedHostDocument = null; var currentHostDocument = projectSnapshot.GetDocument(documentFilePath).HostDocument; for (var i = 0; i < configuredHostDocuments.Count; i++) { var configuredHostDocument = configuredHostDocuments[i]; if (OmniSharpHostDocumentComparer.Instance.Equals(configuredHostDocument, currentHostDocument)) { associatedHostDocument = configuredHostDocument; break; } } if (associatedHostDocument == null) { // Document was removed _projectManager.DocumentRemoved(hostProject, currentHostDocument); } } // Refresh the project snapshot to reflect any removed documents. projectSnapshot = _projectManager.GetLoadedProject(projectSnapshot.FilePath); // Add any documents that need to be added for (var i = 0; i < configuredHostDocuments.Count; i++) { var hostDocument = configuredHostDocuments[i]; if (!projectSnapshot.DocumentFilePaths.Contains(hostDocument.FilePath, FilePathComparer.Instance)) { // Document was added. _projectManager.DocumentAdded(hostProject, hostDocument); } } }
public virtual void Update(Project workspaceProject, OmniSharpProjectSnapshot projectSnapshot) => InternalWorkspaceStateGenerator.Update(workspaceProject, projectSnapshot.InternalProjectSnapshot, CancellationToken.None);
public virtual void Update(Project workspaceProject, OmniSharpProjectSnapshot projectSnapshot) => InternalWorkspaceStateGenerator.Update(workspaceProject, projectSnapshot.InternalProjectSnapshot);