diff --git a/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProject.cs b/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProject.cs index 009249c8aef176f78840a052162dcc8df416376b..ba199b28c4ad17e26ac5bde181893206493b95a0 100644 --- a/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProject.cs +++ b/src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioProject.cs @@ -295,12 +295,11 @@ private void OnBatchScopeDisposed() var documentFileNamesAdded = ImmutableArray.CreateBuilder(); var documentsToOpen = new List<(DocumentId, SourceTextContainer)>(); - var documentsToClose = new List<(DocumentId, TextLoader)>(); _workspace.ApplyBatchChangeToProject(Id, solution => { - solution = _sourceFiles.UpdateSolutionForBatch(solution, documentFileNamesAdded, documentsToOpen, documentsToClose, (s, d) => s.AddDocument(d), (s, id) => s.RemoveDocument(id)); - solution = _additionalFiles.UpdateSolutionForBatch(solution, documentFileNamesAdded, documentsToOpen, documentsToClose, (s, d) => s.AddAdditionalDocument(d), (s, id) => s.RemoveAdditionalDocument(id)); + solution = _sourceFiles.UpdateSolutionForBatch(solution, documentFileNamesAdded, documentsToOpen, (s, d) => s.AddDocument(d), (s, id) => s.RemoveDocument(id)); + solution = _additionalFiles.UpdateSolutionForBatch(solution, documentFileNamesAdded, documentsToOpen, (s, d) => s.AddAdditionalDocument(d), (s, id) => s.RemoveAdditionalDocument(id)); // Metadata reference adding... if (_metadataReferencesAddedInBatch.Count > 0) @@ -389,11 +388,6 @@ private void OnBatchScopeDisposed() _workspace.ApplyChangeToWorkspace(w => w.OnDocumentOpened(documentId, textContainer)); } - foreach (var (documentId, textLoader) in documentsToClose) - { - _workspace.ApplyChangeToWorkspace(w => w.OnDocumentClosed(documentId, textLoader)); - } - // Check for those files being opened to start wire-up if necessary _workspace.CheckForOpenDocuments(documentFileNamesAdded.ToImmutable()); } @@ -1089,7 +1083,6 @@ public void ProcessFileChange(string fullFilePath) Solution solution, ImmutableArray.Builder documentFileNamesAdded, List<(DocumentId, SourceTextContainer)> documentsToOpen, - List<(DocumentId, TextLoader)> documentsToClose, Func addDocument, Func removeDocument) { @@ -1112,12 +1105,6 @@ public void ProcessFileChange(string fullFilePath) foreach (var documentId in _documentsRemovedInBatch) { solution = solution.RemoveDocument(documentId); - - if (_sourceTextContainersToDocumentIds.TryGetKey(documentId, out var textContainer)) - { - // TODO: correct inputs here - documentsToClose.Add((documentId, new SourceTextLoader(textContainer, null))); - } } ClearAndZeroCapacity(_documentsRemovedInBatch);