10 references to WithDocumentText
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Workspaces\LspWorkspaceManager.cs (1)
299lspSolution = lspSolution.WithDocumentText(workspaceDocuments.Select(d => d.Id), _trackedDocuments[uri]);
Microsoft.CodeAnalysis.Workspaces (2)
Workspace\TextExtensions.cs (2)
40solution = solution.WithDocumentText(relatedIds, text, PreservationMode.PreserveIdentity); 82return solution.WithDocumentText(allIds, text, PreservationMode.PreserveIdentity)
Microsoft.CodeAnalysis.Workspaces.UnitTests (7)
SolutionTests\SolutionTests.cs (7)
376var newSolution1 = solution.WithDocumentText(new[] { documentId }, text, PreservationMode.PreserveIdentity); 380var newSolution2 = newSolution1.WithDocumentText(new[] { documentId }, text, PreservationMode.PreserveIdentity); 384Assert.Same(solution, solution.WithDocumentText(new DocumentId[] { null! }, text)); 385Assert.Same(solution, solution.WithDocumentText(new DocumentId[] { s_unrelatedDocumentId }, text)); 387Assert.Throws<ArgumentNullException>(() => solution.WithDocumentText((DocumentId[])null!, text, PreservationMode.PreserveIdentity)); 388Assert.Throws<ArgumentNullException>(() => solution.WithDocumentText(new[] { documentId }, null!, PreservationMode.PreserveIdentity)); 389Assert.Throws<ArgumentOutOfRangeException>(() => solution.WithDocumentText(new[] { documentId }, text, (PreservationMode)(-1)));