53 references to AddDocument
IdeCoreBenchmarks (1)
ProjectOperationBenchmarks.cs (1)
73solution = solution.AddDocument(documentId, documentName, emptySourceText);
Microsoft.AspNetCore.Analyzer.Testing (2)
DiagnosticProject.cs (1)
80solution = solution.AddDocument(documentId, newFileName, SourceText.From(sources[i]));
DiagnosticVerifier.cs (1)
181Solution = Solution.AddDocument(documentId, newFileName, SourceText.From(source));
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
164solution = solution.AddDocument(documentId, newFileName, SourceText.From(source));
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
164solution = solution.AddDocument(documentId, newFileName, SourceText.From(source));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
Formatting\CodeCleanupTests.TestFixers.cs (2)
116return solution.AddDocument(DocumentId.CreateNewId(project.Id), "new.cs", SourceText.From("")); 172return solution.AddDocument(DocumentId.CreateNewId(project.Id), "new.cs", SourceText.From(""));
Workspaces\WorkspaceTests_EditorFeatures.cs (1)
761var newSolution = oldSolution.AddDocument(DocumentId.CreateNewId(project1.Id), "Doc2", SourceText.From(doc2Text));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (3)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (3)
665var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs")); 711var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs")); 744var newSolution = oldSolution.AddDocument(documentId, "goo.cs", SourceText.From(source2), filePath: filePath);
Microsoft.CodeAnalysis.EditorFeatures (1)
Interactive\InteractiveSession.cs (1)
239solution = newSubmissionProject.Solution.AddDocument(
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Rename\RenamerTests.cs (2)
59.AddDocument( 192.AddDocument(
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
SymbolFinder\DependentTypeFinderTests.cs (1)
40return solution.AddProject(pi).AddDocument(did, $"{projectName}.{suffix}", SourceText.From(code));
Microsoft.CodeAnalysis.Features.UnitTests (6)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (4)
407solution = solution.AddDocument(designTimeOnlyDocumentId, designTimeOnlyFileName, SourceText.From(sourceDesignTimeOnly, Encoding.UTF8), filePath: designTimeOnlyFilePath); 427solution = solution.AddDocument(designTimeOnlyDocumentId, designTimeOnlyFileName, SourceText.From(sourceDesignTimeOnly, Encoding.UTF8), filePath: designTimeOnlyFilePath); 922AddDocument(documentId, "test.cs", SourceText.From(source1, encoding, SourceHashAlgorithm.Sha1), filePath: sourceFile.Path); 1553DocumentKind.Source => solution.AddDocument(documentId, "X", CreateText("xxx"), filePath: pathX),
EditAndContinue\EditSessionActiveStatementsTests.cs (1)
79solution = solution.AddDocument(id, name, text, filePath: Path.Combine(TempRoot.Root, name));
EditAndContinue\RemoteEditAndContinueServiceTests.cs (1)
81.AddDocument(documentId, "test.cs", SourceText.From("class C { }", Encoding.UTF8), filePath: "test.cs")
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Project.cs (1)
714return this.Solution.AddDocument(id, name, text, folders, filePath).GetDocument(id)!;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
VisualStudioMSBuildWorkspaceTests.cs (1)
2171var newSolution = solution.AddDocument(newDocId, "Bar.cs", newText);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
WorkspaceExtensions.cs (1)
19var newSolution = oldSolution.AddDocument(id, name, initialText, folders).GetDocument(id)!.WithSourceCodeKind(sourceCodeKind).Project.Solution;
Microsoft.CodeAnalysis.Workspaces.UnitTests (29)
FindAllDeclarationsTests.cs (1)
703solution = solution.AddDocument(did, "VBDocument.vb", SourceText.From(source));
FindAllDeclarationsTests.TestSolutionsAndProject.cs (2)
102solution = solution.AddDocument(did, "goo" + i + ".cs", SourceText.From(sourceTexts[i])); 119solution = solution.AddDocument(did, "goo" + i + ".cs", SourceText.From(sourceTexts[i]));
FindReferencesTests.cs (7)
40return solution.AddProject(pi).AddDocument(did, $"{projectName}.{suffix}", SourceText.From(code)); 56return solution.AddProject(pi).AddDocument(did, $"{projectName}.{suffix}", SourceText.From(code)); 66.AddDocument(did, "goo.cs", SourceText.From(sourceText)); 82solution = solution.AddDocument(did, $"goo{docCounter++}.cs", SourceText.From(sourceText)); 175.AddDocument(docId, "testFile", tree.GetText()); 214.AddDocument(docId, "testFile", tree.GetText()); 278.AddDocument(docId, "testFile", tree.GetText());
LinkedFileDiffMerging\LinkedFileDiffMergingTests.cs (1)
34.AddDocument(documentId, "DocumentName", startSourceText, filePath: "FilePath");
SolutionTests\SolutionTests.cs (16)
60.AddDocument(DocumentId.CreateNewId(projectId), "goo.cs", SourceText.From("public class Goo { }", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "goo.cs")) 82.AddDocument(DocumentId.CreateNewId(projectId1), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs") 86.AddDocument(DocumentId.CreateNewId(projectId2), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs") 843.AddDocument(DocumentId.CreateNewId(projectId1), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs") 845.AddDocument(DocumentId.CreateNewId(projectId2), "goo.cs", SourceText.From(docContents, Encoding.UTF8, SourceHashAlgorithms.Default), filePath: "goo.cs"))); 1093.AddDocument(d1, "d1.cs", SourceText.From("class D1;", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "d1.cs")) 1094.AddDocument(d2, "d2.cs", SourceText.From("class D2;", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "d2.cs")) 1627solution = solution.AddDocument(documentCId, "c.cs", textC, filePath: "c.cs"); 2426var solution2 = solution.AddDocument(documentId, "name", sourceText, folders, filePath, isGenerated: true); 2434Assert.Throws<ArgumentNullException>("documentId", () => solution.AddDocument(documentId: null!, "name", sourceText)); 2435Assert.Throws<ArgumentNullException>("name", () => solution.AddDocument(documentId, name: null!, sourceText)); 2436Assert.Throws<ArgumentNullException>("text", () => solution.AddDocument(documentId, "name", text: (SourceText)null!)); 2437Assert.Throws<InvalidOperationException>(() => solution.AddDocument(documentId: DocumentId.CreateNewId(ProjectId.CreateNewId()), "name", sourceText)); 3161.AddDocument(documentId, "DocumentName", SourceText.From("class Class{}")); 3773.AddDocument(did, "test", SourceText.From(language == LanguageNames.CSharp ? "class C {}" : "Class C : End Class", Encoding.UTF8, SourceHashAlgorithm.Sha256), filePath: "old path"); 5517.AddDocument(documentId, "test.cs", SourceText.From("public class C { }"), filePath: sourcePath)
SyntaxReferenceTests.cs (2)
32.AddDocument(did, "Test.cs", SourceText.From(source)); 42.AddDocument(did, "Test.vb", SourceText.From(source));