提交 cd9a4040 编写于 作者: J Jason Malinowski

Remove check that a document must be closed before removing it

The underlying process of removing a document already handled this,
this was an unnecessary block. It was already the case that you could
call OnProjectRemoved to remove the entire project that had open files,
so this didn't really avoid badness in the first place.
上级 2e8b30d1
......@@ -404,9 +404,10 @@ public void TestRemoveOpenedDocument()
workspace.AddTestProject(project1);
workspace.OnDocumentOpened(document.Id, document.GetOpenTextContainer());
Assert.Throws<ArgumentException>(() => workspace.OnDocumentRemoved(document.Id));
workspace.OnDocumentRemoved(document.Id);
Assert.Empty(workspace.CurrentSolution.Projects.Single().Documents);
workspace.CloseDocument(document.Id);
workspace.OnProjectRemoved(project1.Id);
}
}
......
......@@ -741,7 +741,6 @@ public void RemoveFromWorkspace()
{
_documentFileChangeContext.Dispose();
// TODO: clean up open files
_workspace.ApplyChangeToWorkspace(w => w.OnProjectRemoved(Id));
}
......
......@@ -735,7 +735,6 @@ protected internal void OnDocumentRemoved(DocumentId documentId)
protected virtual void CheckDocumentCanBeRemoved(DocumentId documentId)
{
CheckDocumentIsClosed(documentId);
}
/// <summary>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册