9 references to AddDocument
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Project.cs (1)
670return this.Solution.AddDocument(id, name, syntaxRoot, folders, filePath, preservationMode: PreservationMode.PreserveIdentity).GetDocument(id)!;
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
SolutionTests\SolutionTests.cs (8)
1808var solution2 = solution.AddDocument(documentId, "name", root, folders, filePath); 1816Assert.Throws<ArgumentNullException>("documentId", () => solution.AddDocument(documentId: null!, "name", root)); 1817Assert.Throws<ArgumentNullException>("name", () => solution.AddDocument(documentId, name: null!, root)); 1818Assert.Throws<ArgumentNullException>("syntaxRoot", () => solution.AddDocument(documentId, "name", syntaxRoot: null!)); 1819Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", syntaxRoot: root)); 1839var solution2 = solution.AddDocument(documentId, "name", root, folders, filePath); 1868var solution2 = solution.AddDocument(documentId, "name", root); 2800.AddDocument(did, "x", tree);