77 references to AddDocument
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
313
proj = proj.
AddDocument
(details.TargetFilename, text).Project;
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
71
return proj.
AddDocument
(name, text).Project;
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
71
return proj.
AddDocument
(name, text).Project;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
Completion\CompletionServiceTests.cs (3)
39
.
AddDocument
("TestDocument.cs", "");
172
.
AddDocument
("TestDocument.cs", source);
208
.
AddDocument
("Document1.cs", sourceMarkup, filePath: "Document1.cs").Project;
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
61
var document = project.
AddDocument
("test.cs", text);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (4)
CodeGeneration\AddAttributesTests.cs (1)
36
return emptyProject.
AddDocument
("test.cs", code);
CodeGeneration\AddImportsTests.cs (1)
40
var doc = emptyProject.
AddDocument
("test.cs", code);
OrganizeImports\OrganizeUsingsTests.cs (2)
31
var document = project.
AddDocument
("Document", initial.ReplaceLineEndings(endOfLine ?? Environment.NewLine));
92
var document = project.
AddDocument
("Document", initial);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (8)
Diagnostics\DiagnosticDataTests.cs (5)
112
var document = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).
AddDocument
("TestDocument", code);
140
.
AddDocument
("test.cs", "", filePath: "test.cs")
224
.
AddDocument
("test.cs", "class C1 { }", filePath: "test.cs");
229
.
AddDocument
("test2.cs", "class C2 { }", filePath: "test2.cs");
233
secondDocument = firstDocument.Project.
AddDocument
("test2.cs", "class C2 { }", filePath: "test2.cs");
MetadataAsSource\AbstractMetadataAsSourceTests.cs (1)
86
var newDoc = metadataProject.
AddDocument
("MetadataSource", source);
Preview\PreviewWorkspaceTests.cs (2)
74
.
AddDocument
("document", "").Project.Solution;
99
var document = project.
AddDocument
("document", "");
Microsoft.CodeAnalysis.Features (1)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (1)
107
suppressionsDoc = _project.
AddDocument
(suppressionsFileName, string.Empty);
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
Snippets\AbstractSnippetProviderTests.cs (2)
40
var document = project.
AddDocument
("TestDocument", markupBeforeCommit, filePath: "/TestDocument");
123
var document = project.
AddDocument
("TestDocument", markup);
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
235
var document = project.
AddDocument
("test", "dummy1");
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (3)
CodeGeneration\AddImportsTests.vb (2)
46
Dim extensionAttributeDoc = project.
AddDocument
("ExtensionAttribute.vb", ExtensionAttributeSource)
47
Dim doc = extensionAttributeDoc.Project.
AddDocument
("test.vb", code)
Formatting\FormattingTests.vb (1)
4199
Dim document = project.
AddDocument
("goo.vb", <text>Class C
Microsoft.CodeAnalysis.Workspaces.UnitTests (43)
GeneratedCodeRecognitionTests.cs (1)
85
var document = project.
AddDocument
(fileName, "", filePath: $"z:\\{fileName}");
SolutionTests\ProjectSemanticVersionTests.cs (18)
24
await AssertSemanticVersionChangedAsync(project, project.
AddDocument
("Hello.cs", "class C { }").Project);
32
.
AddDocument
("Hello.cs", "class C { }").Project;
42
.
AddDocument
("Hello.cs", "class C { }");
56
.
AddDocument
("Hello.cs", "class C { void M() { } }");
70
.
AddDocument
("Hello.cs", "class C { void M() { } }");
84
.
AddDocument
("Hello.cs", "class C { void M() { } }");
98
.
AddDocument
("Hello.cs", "class C { }");
112
.
AddDocument
("Hello.cs", "class C { public int X = 20; }");
126
.
AddDocument
("Hello.cs", "class C { }");
140
.
AddDocument
("Hello.cs", "class C { public const int X = 20; }");
154
.
AddDocument
("Hello.vb", "Class C\r\n\r\nEnd Class");
168
.
AddDocument
("Hello.vb", "Class C\r\nSub M()\r\n\r\nEnd Sub\r\nEnd Class");
182
.
AddDocument
("Hello.vb", "Class C\r\nSub M()\r\n\r\nEnd Sub\r\nEnd Class");
196
.
AddDocument
("Hello.vb", "Class C\r\n\r\nEnd Class");
210
.
AddDocument
("Hello.vb", "Class C\r\n\r\nEnd Class");
224
.
AddDocument
("Hello.vb", "Class C\r\nPublic X As Integer = 20\r\nEnd Class");
238
.
AddDocument
("Hello.vb", "Class C\r\n\r\nEnd Class");
252
.
AddDocument
("Hello.vb", "Class C\r\nPublic Const X As Integer = 20\r\nEnd Class");
SolutionTests\SolutionTests.cs (14)
2789
.
AddDocument
("goo.cs", "public class Goo { }")
4250
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project;
4268
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project
4269
.
AddDocument
("RegularDocument2.cs", "// Source File", filePath: "RegularDocument2.cs").Project;
4284
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project;
4289
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project;
4308
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: null).Project;
4313
.
AddDocument
("RegularDocument2.cs", "// Source File", filePath: null).Project;
4336
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: null);
4409
.
AddDocument
("RegularDocument.cs", contents, filePath: "RegularDocument.cs");
4413
.
AddDocument
("RegularDocument.cs", contents, filePath: "RegularDocument.cs");
5545
.
AddDocument
("File.cs", "", filePath: FilePath).Project
5565
.
AddDocument
("File.cs", "", filePath: "File.cs").Project.Solution
5567
.
AddDocument
("file.cs", "", filePath: "file.cs").Project.Solution;
SolutionTests\SolutionWithSourceGeneratorTests.cs (10)
256
.
AddDocument
("Hello.cs", "// Source File").Project
340
.
AddDocument
("Hello.cs", "// Source File").Project
460
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project
483
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project
503
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project
530
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project;
721
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project;
752
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project;
781
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project;
811
.
AddDocument
("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs");
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
95
return proj.
AddDocument
(name, text).Project;
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
95
return proj.
AddDocument
(name, text).Project;
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
95
return proj.
AddDocument
(name, text).Project;
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
95
return proj.
AddDocument
(name, text).Project;
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
95
return proj.
AddDocument
(name, text).Project;
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
56
project.
AddDocument
(AssemblyInfoFileName, "", folders: new[] { PropertiesFolderName });
Microsoft.ML.CodeAnalyzer.Tests (2)
Code\BestFriendTest.cs (2)
67
projectA = projectA.
AddDocument
("BestFriendAttribute.cs", _sourceAttribute.Value).Project;
68
projectA = projectA.
AddDocument
("BestFriendDeclaration.cs", _sourceDeclaration.Value).Project;