558 references to SyntaxTrees
AnalyzerRunner (1)
DiagnosticAnalyzerRunner.cs (1)
394
var newCompilation = compilation.RemoveAllSyntaxTrees().AddSyntaxTrees(compilation.
SyntaxTrees
);
BuildValidator (1)
CompilationDiff.cs (1)
303
foreach (var tree in compilation.
SyntaxTrees
)
IdeCoreBenchmarks (2)
IncrementalSourceGeneratorBenchmarks.cs (2)
151
Console.WriteLine("Syntax tree count: " + compilation.
SyntaxTrees
.Count());
158
var syntaxTree = compilation.
SyntaxTrees
.Single(t => t.FilePath.Contains("AbstractCaseCorrectionService"));
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
269
var allNodes = comp.
SyntaxTrees
.SelectMany(s => s.GetRoot().DescendantNodes());
Microsoft.AspNetCore.Http.Extensions.Tests (3)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
70
.ReplaceSyntaxTree(compilation.
SyntaxTrees
.First(), syntaxTree);
134
foreach (var syntaxTree in compilation.
SyntaxTrees
)
360
var generatedSyntaxTree = compilation.
SyntaxTrees
.Last();
Microsoft.AspNetCore.Http.Microbenchmarks (3)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
70
.ReplaceSyntaxTree(compilation.
SyntaxTrees
.First(), syntaxTree);
134
foreach (var syntaxTree in compilation.
SyntaxTrees
)
360
var generatedSyntaxTree = compilation.
SyntaxTrees
.Last();
Microsoft.CodeAnalysis (9)
CommandLine\CommonCompiler.cs (3)
435
foreach (var tree in compilation.
SyntaxTrees
)
1081
compilation.
SyntaxTrees
,
1154
var generatedSyntaxTrees = compilation.
SyntaxTrees
.Skip(Arguments.SourceFiles.Length).ToList();
Compilation\DeterministicKeyBuilder.cs (1)
330
compilation.
SyntaxTrees
.SelectAsArray(static x => SyntaxTreeKey.Create(x)),
DiagnosticAnalyzer\AnalyzerDriver.cs (2)
970
compilation.
SyntaxTrees
.IsEmpty())
976
foreach (var tree in compilation.
SyntaxTrees
)
PEWriter\MetadataWriter.cs (1)
1790
foreach (var tree in Module.CommonCompilation.
SyntaxTrees
)
PEWriter\MetadataWriter.PortablePdb.cs (1)
891
WriteValue(CompilationOptionNames.SourceFileCount, module.CommonCompilation.
SyntaxTrees
.Count().ToString());
SourceGeneration\Nodes\SharedInputNodes.cs (1)
26
public static readonly InputNode<SyntaxTree> SyntaxTrees = new InputNode<SyntaxTree>(b => b.Compilation.
SyntaxTrees
.ToImmutableArray());
Microsoft.CodeAnalysis.CodeStyle (3)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
127
var tree = compilation.
SyntaxTrees
.FirstOrDefault(tree => !GeneratedCodeUtilities.IsGeneratedCode(tree, IsRegularCommentOrDocComment, context.CancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (1)
121
if (syntaxTree != null && Contains(compilation.
SyntaxTrees
, syntaxTree))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
158
return compilation.
SyntaxTrees
.Contains(locations.First().SourceTree);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (3)
CommandLineTests.cs (3)
305
var tree = comp.
SyntaxTrees
.Single();
10407
var syntaxTreeInput = ctx.CompilationProvider.Select((c, _) => c.
SyntaxTrees
.First());
14681
var classOptions = gc.AnalyzerConfigOptions.GetOptions(gc.Compilation.
SyntaxTrees
.First());
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (1)
257
var model = comp40.GetSemanticModel(comp40.
SyntaxTrees
.First());
SymbolKey\SymbolKeyTests.cs (1)
292
var tree = bodyCompilation.
SyntaxTrees
.Single();
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (16)
CodeGen\CodeGenDeconstructTests.cs (5)
253
var tree = comp.Compilation.
SyntaxTrees
.First();
1109
var tree = comp.Compilation.
SyntaxTrees
.First();
2285
var tree = comp.Compilation.
SyntaxTrees
.First();
8584
var tree = compilation.
SyntaxTrees
.Single();
8628
var tree = compilation.
SyntaxTrees
.Single();
CodeGen\CodeGenLocalFunctionTests.cs (3)
5745
var syntaxTree = comp.
SyntaxTrees
.Single();
5820
var syntaxTree = comp.
SyntaxTrees
.Single();
5895
var syntaxTree = comp.
SyntaxTrees
.Single();
CodeGen\CodeGenOperators.cs (1)
5406
var tree = result.Compilation.
SyntaxTrees
.Single();
CodeGen\CodeGenTupleEqualityTests.cs (3)
358
var tree = comp.Compilation.
SyntaxTrees
.First();
679
var tree = comp.Compilation.
SyntaxTrees
.First();
710
var tree = comp.Compilation.
SyntaxTrees
.First();
CodeGen\CodeGenTupleTest.cs (1)
14430
var tree = comp.
SyntaxTrees
.Single();
CodeGen\ObjectAndCollectionInitializerTests.cs (2)
1105
var tree = comp.
SyntaxTrees
.Single();
3587
var tree = comp.
SyntaxTrees
.First();
Emit\DeterministicTests.cs (1)
438
var trees = cv.Compilation.
SyntaxTrees
.ToArray();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
PDB\CSharpDeterministicBuildCompilationTests.cs (1)
49
var firstSyntaxTree = (CSharpSyntaxTree)compilation.
SyntaxTrees
.FirstOrDefault();
PDB\PDBTests.cs (1)
97
Assert.Single(compilation.
SyntaxTrees
);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (7)
Attributes\AttributeTests_WellKnownAttributes.cs (1)
5765
var tree = compilation.
SyntaxTrees
.Single();
Diagnostics\DiagnosticAnalyzerTests.cs (2)
1708
var files = compilation.
SyntaxTrees
.Select(t => t.FilePath).ToImmutableArray();
1723
for (int i = 0; i < compilation.
SyntaxTrees
.Count(); i++)
Diagnostics\GetDiagnosticsTests.cs (1)
606
ImmutableDictionary<object, AnalyzerConfigOptions>.Empty.Add(compilation.
SyntaxTrees
.Single(), analyzerConfigOptions),
FlowAnalysis\RegionAnalysisTests.cs (1)
5619
var tree = comp.
SyntaxTrees
.Single();
Semantics\OutVarTests.cs (1)
32975
var tree = comp.Compilation.
SyntaxTrees
.Single();
Semantics\PatternMatchingTestBase.cs (1)
458
var tree = comp.
SyntaxTrees
.First();
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
EndToEndTests.cs (1)
799
Assert.Single(compilation.
SyntaxTrees
);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (3)
InteractiveSessionTests.cs (1)
1179
var tree = compilation.
SyntaxTrees
.Single();
ScriptTests.cs (2)
67
Assert.Equal(state.Script.Code, compilation.
SyntaxTrees
.First().GetText().ToString());
75
Assert.Equal(state.Script.SourceText, compilation.
SyntaxTrees
.First().GetText());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (247)
Semantics\AccessCheckTests.cs (2)
741
var tree = c.
SyntaxTrees
.First();
895
var tree = c1.
SyntaxTrees
.First();
Semantics\DeconstructionTests.cs (1)
1837
var tree = comp.Compilation.
SyntaxTrees
.First();
Semantics\DynamicTests.cs (5)
3857
var tree = verifier.Compilation.
SyntaxTrees
.Single();
3890
var tree = verifier.Compilation.
SyntaxTrees
.Single();
3918
var tree = verifier.Compilation.
SyntaxTrees
.Single();
3946
var tree = verifier.Compilation.
SyntaxTrees
.Single();
3997
var tree = verifier.Compilation.
SyntaxTrees
.Single();
Semantics\InteractiveUsingTests.cs (3)
85
var tree = sub.
SyntaxTrees
.Single();
582
var tree = comp.
SyntaxTrees
.Single();
592
var tree = comp.
SyntaxTrees
.Single();
Semantics\LocalFunctionTests.cs (2)
1762
var tree = comp.
SyntaxTrees
.First();
1837
var tree = comp.
SyntaxTrees
.First();
Semantics\NonTrailingNamedArgumentsTests.cs (4)
43
var tree = verifier.Compilation.
SyntaxTrees
.First();
391
var tree = verifier.Compilation.
SyntaxTrees
.First();
742
var tree = verifier.Compilation.
SyntaxTrees
.First();
774
var tree = verifier.Compilation.
SyntaxTrees
.First();
Semantics\TopLevelStatementsTests.cs (2)
6084
var syntaxTree = comp.
SyntaxTrees
.Single();
6156
var syntaxTree = comp.
SyntaxTrees
.Single();
SourceGeneration\GeneratorDriverTests.cs (99)
38
Assert.Single(compilation.
SyntaxTrees
);
44
Assert.Single(outputCompilation.
SyntaxTrees
);
58
Assert.Single(compilation.
SyntaxTrees
);
80
Assert.Single(compilation.
SyntaxTrees
);
101
Assert.Single(compilation.
SyntaxTrees
);
130
Assert.Single(compilation.
SyntaxTrees
);
137
Assert.Equal(2, outputCompilation.
SyntaxTrees
.Count());
220
Assert.Single(compilation.
SyntaxTrees
);
229
Assert.Equal(2, outputCompilation1.
SyntaxTrees
.Count());
230
Assert.Equal(2, outputCompilation2.
SyntaxTrees
.Count());
231
Assert.Equal(2, outputCompilation3.
SyntaxTrees
.Count());
256
Assert.Single(compilation.
SyntaxTrees
);
277
Assert.Single(compilation.
SyntaxTrees
);
300
Assert.Single(compilation.
SyntaxTrees
);
308
Assert.Single(outputCompilation.
SyntaxTrees
);
321
Assert.Single(compilation.
SyntaxTrees
);
344
Assert.Single(compilation.
SyntaxTrees
);
355
Assert.Equal(2, outputCompilation.
SyntaxTrees
.Count());
378
Assert.Single(compilation.
SyntaxTrees
);
405
Assert.Single(compilation.
SyntaxTrees
);
430
Assert.Single(compilation.
SyntaxTrees
);
456
Assert.Single(compilation.
SyntaxTrees
);
473
Assert.Equal(2, outputCompilation.
SyntaxTrees
.Count());
485
Assert.Single(compilation.
SyntaxTrees
);
512
Assert.Equal(1, outputCompilation.
SyntaxTrees
.Count());
524
Assert.Single(compilation.
SyntaxTrees
);
533
Assert.Equal(3, outputCompilation.
SyntaxTrees
.Count());
535
var filePaths = outputCompilation.
SyntaxTrees
.Skip(1).Select(t => t.FilePath).ToArray();
584
Assert.Single(compilation.
SyntaxTrees
);
614
Assert.Single(compilation.
SyntaxTrees
);
659
Assert.Single(compilation.
SyntaxTrees
);
706
Assert.Single(compilation.
SyntaxTrees
);
742
Assert.Single(compilation.
SyntaxTrees
);
778
Assert.Single(compilation.
SyntaxTrees
);
800
Assert.Single(compilation.
SyntaxTrees
);
825
Assert.Single(compilation.
SyntaxTrees
);
853
Assert.Single(compilation.
SyntaxTrees
);
885
Assert.Single(compilation.
SyntaxTrees
);
898
Assert.Equal(2, outputCompilation.
SyntaxTrees
.Count());
911
Assert.Single(compilation.
SyntaxTrees
);
938
Assert.Single(compilation.
SyntaxTrees
);
966
Assert.Single(compilation.
SyntaxTrees
);
998
Assert.Single(compilation.
SyntaxTrees
);
1012
Assert.Single(compilation.
SyntaxTrees
);
1027
Assert.Single(compilation.
SyntaxTrees
);
1047
Assert.Single(compilation.
SyntaxTrees
);
1061
Assert.Single(compilation.
SyntaxTrees
);
1088
Assert.Single(compilation.
SyntaxTrees
);
1133
Assert.Single(compilation.
SyntaxTrees
);
1161
Assert.Single(compilation.
SyntaxTrees
);
1259
Assert.Single(compilation.
SyntaxTrees
);
1271
c.ReportDiagnostic(d.WithLocation(Location.Create(c.Compilation.
SyntaxTrees
.First(), l)));
1388
Assert.Single(compilation.
SyntaxTrees
);
1423
Assert.Single(compilation.
SyntaxTrees
);
1445
Assert.Single(compilation.
SyntaxTrees
);
1470
Assert.Single(compilation.
SyntaxTrees
);
1496
var syntaxTree = compilation.
SyntaxTrees
.Single();
1538
Assert.Single(compilation.
SyntaxTrees
);
1567
Assert.Single(compilation.
SyntaxTrees
);
1600
Assert.Single(compilation.
SyntaxTrees
);
1621
Assert.Single(compilation.
SyntaxTrees
);
1628
Assert.Equal(2, outputCompilation.
SyntaxTrees
.Count());
1683
Assert.Single(compilation.
SyntaxTrees
);
1727
Assert.Single(compilation.
SyntaxTrees
);
1946
Assert.Single(compilation.
SyntaxTrees
);
1982
Assert.Single(compilation.
SyntaxTrees
);
2168
compilation = compilation.ReplaceSyntaxTree(compilation.
SyntaxTrees
.Single(), CSharpSyntaxTree.ParseText(source, parseOptions));
2230
compilation = compilation.ReplaceSyntaxTree(compilation.
SyntaxTrees
.Single(), CSharpSyntaxTree.ParseText(source, parseOptions));
2244
Assert.Single(compilation.
SyntaxTrees
);
2373
compilation = compilation.ReplaceSyntaxTree(compilation.
SyntaxTrees
.First(), CSharpSyntaxTree.ParseText(source, parseOptions));
2387
Assert.Single(compilation.
SyntaxTrees
);
2432
var c2 = compilation.ReplaceSyntaxTree(compilation.
SyntaxTrees
.First(), CSharpSyntaxTree.ParseText("class E{}", parseOptions));
2459
Assert.Single(compilation.
SyntaxTrees
);
2487
Assert.Single(compilation.
SyntaxTrees
);
2550
Assert.Single(compilation.
SyntaxTrees
);
2588
Assert.True(compilation.
SyntaxTrees
.Contains(node.SyntaxTree));
2616
Assert.Single(compilation.
SyntaxTrees
);
2699
Assert.Single(compilation.
SyntaxTrees
);
2886
Assert.Single(compilation.
SyntaxTrees
);
3081
Assert.Single(compilation.
SyntaxTrees
);
3147
Assert.Single(compilation.
SyntaxTrees
);
3193
Assert.Single(compilation.
SyntaxTrees
);
3229
Assert.Single(compilation.
SyntaxTrees
);
3281
Assert.Single(compilation.
SyntaxTrees
);
3649
var validSyntaxTree = comp.
SyntaxTrees
.Single();
3710
var validSyntaxTree = ctx.Compilation.
SyntaxTrees
.Single();
3743
var syntaxTree = comp.
SyntaxTrees
.Single();
3775
var syntaxTree = comp.
SyntaxTrees
.Single();
3806
var syntaxTree = ctx.Compilation.
SyntaxTrees
.Single();
3835
var syntaxTree = ctx.Compilation.
SyntaxTrees
.Single();
3867
var syntaxTree = comp.
SyntaxTrees
.Single();
3897
var syntaxTree = ctx.Compilation.
SyntaxTrees
.Single();
4008
Assert.Single(compilation.
SyntaxTrees
);
4306
var generator1 = new PipelineCallbackGenerator((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen1Source.cs", c.
SyntaxTrees
.First().GetRoot().ToFullString() + " //generator1"); }); }).AsSourceGenerator();
4307
var generator2 = new PipelineCallbackGenerator2((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen2Source.cs", c.
SyntaxTrees
.First().GetRoot().ToFullString() + " //generator2"); }); }).AsSourceGenerator();
4351
var generator1 = new PipelineCallbackGenerator((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen1Source.cs", "//" + c.
SyntaxTrees
.First().GetRoot().ToFullString() + " generator1"); }); }).AsSourceGenerator();
4352
var generator2 = new PipelineCallbackGenerator2((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen2Source.cs", "//" + c.
SyntaxTrees
.First().GetRoot().ToFullString() + " generator2"); }); }).AsSourceGenerator();
4375
var generator1 = new PipelineCallbackGenerator((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen1Source.cs", c.
SyntaxTrees
.First().GetRoot().ToFullString() + " //generator1"); }); }).AsSourceGenerator();
4376
var generator2 = new PipelineCallbackGenerator2((ctx) => { initWasCalled = true; ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen2Source.cs", c.
SyntaxTrees
.First().GetRoot().ToFullString() + " //generator2"); }); }).AsSourceGenerator();
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (52)
70
Assert.Single(compilation.
SyntaxTrees
);
112
Assert.Single(compilation.
SyntaxTrees
);
149
Assert.Single(compilation.
SyntaxTrees
);
179
Assert.Single(compilation.
SyntaxTrees
);
192
step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.
SyntaxTrees
.Single()));
209
Assert.Single(compilation.
SyntaxTrees
);
222
step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.
SyntaxTrees
.Single()));
249
step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.
SyntaxTrees
.First()));
276
step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.
SyntaxTrees
.Last()));
304
step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.
SyntaxTrees
.First()),
305
step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.
SyntaxTrees
.Last()));
322
Assert.Single(compilation.
SyntaxTrees
);
358
Assert.Single(compilation.
SyntaxTrees
);
397
Assert.Single(compilation.
SyntaxTrees
);
426
Assert.Single(compilation.
SyntaxTrees
);
459
Assert.Single(compilation.
SyntaxTrees
);
492
Assert.Single(compilation.
SyntaxTrees
);
524
Assert.Single(compilation.
SyntaxTrees
);
556
Assert.Single(compilation.
SyntaxTrees
);
587
Assert.Single(compilation.
SyntaxTrees
);
618
Assert.Single(compilation.
SyntaxTrees
);
651
Assert.Single(compilation.
SyntaxTrees
);
682
Assert.Single(compilation.
SyntaxTrees
);
711
Assert.Single(compilation.
SyntaxTrees
);
745
Assert.Single(compilation.
SyntaxTrees
);
774
Assert.Single(compilation.
SyntaxTrees
);
811
Assert.Single(compilation.
SyntaxTrees
);
848
Assert.Single(compilation.
SyntaxTrees
);
885
Assert.Single(compilation.
SyntaxTrees
);
922
Assert.Single(compilation.
SyntaxTrees
);
959
Assert.Single(compilation.
SyntaxTrees
);
995
Assert.Single(compilation.
SyntaxTrees
);
1022
Assert.Single(compilation.
SyntaxTrees
);
1059
Assert.Single(compilation.
SyntaxTrees
);
1097
Assert.Single(compilation.
SyntaxTrees
);
1135
Assert.Single(compilation.
SyntaxTrees
);
1173
Assert.Single(compilation.
SyntaxTrees
);
1211
Assert.Single(compilation.
SyntaxTrees
);
1416
Assert.Single(compilation.
SyntaxTrees
);
1463
Assert.Single(compilation.
SyntaxTrees
);
1510
Assert.Single(compilation.
SyntaxTrees
);
1525
driver = driver.RunGenerators(compilation.AddSyntaxTrees(compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From(""))));
1553
Assert.Single(compilation.
SyntaxTrees
);
1567
driver = driver.RunGenerators(compilation.AddSyntaxTrees(compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("""
1601
Assert.Single(compilation.
SyntaxTrees
);
1615
driver = driver.RunGenerators(compilation.AddSyntaxTrees(compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("""
1668
driver = driver.RunGenerators(compilation.AddSyntaxTrees(compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("""
1713
Assert.Single(compilation.
SyntaxTrees
);
1728
compilation.
SyntaxTrees
.First(),
1729
compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("""
1780
compilation.
SyntaxTrees
.First(),
1781
compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("""
SourceGeneration\GeneratorDriverTests_Attributes_SimpleName.cs (43)
41
Assert.Single(compilation.
SyntaxTrees
);
73
Assert.Single(compilation.
SyntaxTrees
);
99
Assert.Single(compilation.
SyntaxTrees
);
124
Assert.Single(compilation.
SyntaxTrees
);
149
Assert.Single(compilation.
SyntaxTrees
);
177
Assert.Single(compilation.
SyntaxTrees
);
209
Assert.Single(compilation.
SyntaxTrees
);
241
Assert.Single(compilation.
SyntaxTrees
);
275
Assert.Single(compilation.
SyntaxTrees
);
308
Assert.Single(compilation.
SyntaxTrees
);
334
Assert.Single(compilation.
SyntaxTrees
);
360
Assert.Single(compilation.
SyntaxTrees
);
386
Assert.Single(compilation.
SyntaxTrees
);
419
Assert.Single(compilation.
SyntaxTrees
);
447
Assert.Single(compilation.
SyntaxTrees
);
475
Assert.Single(compilation.
SyntaxTrees
);
502
Assert.Single(compilation.
SyntaxTrees
);
533
Assert.Single(compilation.
SyntaxTrees
);
566
Assert.Single(compilation.
SyntaxTrees
);
598
Assert.Single(compilation.
SyntaxTrees
);
630
Assert.Single(compilation.
SyntaxTrees
);
658
Assert.Single(compilation.
SyntaxTrees
);
686
Assert.Single(compilation.
SyntaxTrees
);
714
Assert.Single(compilation.
SyntaxTrees
);
797
Assert.Single(compilation.
SyntaxTrees
);
828
Assert.Single(compilation.
SyntaxTrees
);
1004
Assert.Single(compilation.
SyntaxTrees
);
1044
Assert.Single(compilation.
SyntaxTrees
);
1106
driver = driver.RunGenerators(compilation.RemoveSyntaxTrees(compilation.
SyntaxTrees
.Last()));
1159
compilation.
SyntaxTrees
.Last(),
1160
compilation.
SyntaxTrees
.Last().WithChangedText(SourceText.From("""
1209
compilation.
SyntaxTrees
.Last(),
1210
compilation.
SyntaxTrees
.Last().WithChangedText(SourceText.From("""
1265
compilation.
SyntaxTrees
.First(),
1266
compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("""
1318
compilation.
SyntaxTrees
.First()));
1376
compilation.
SyntaxTrees
.First()));
1423
compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("""
1468
compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("""
1520
compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("""
1571
compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("""
1632
compilation.
SyntaxTrees
.Last(),
1633
compilation.
SyntaxTrees
.Last().WithChangedText(SourceText.From("""
SourceGeneration\SyntaxAwareGeneratorTests.cs (34)
36
Assert.Single(compilation.
SyntaxTrees
);
62
Assert.Single(compilation.
SyntaxTrees
);
87
Assert.Single(compilation.
SyntaxTrees
);
113
Assert.Single(compilation.
SyntaxTrees
);
138
Assert.Single(compilation.
SyntaxTrees
);
165
Assert.Single(compilation.
SyntaxTrees
);
237
Assert.Single(compilation.
SyntaxTrees
);
276
Assert.Single(compilation.
SyntaxTrees
);
317
Assert.Single(compilation.
SyntaxTrees
);
373
Assert.Single(compilation.
SyntaxTrees
);
415
Assert.Single(compilation.
SyntaxTrees
);
457
Assert.Equal(2, compilation.
SyntaxTrees
.Count());
499
Assert.Single(compilation.
SyntaxTrees
);
553
Assert.Single(compilation.
SyntaxTrees
);
583
Assert.Single(compilation.
SyntaxTrees
);
621
Assert.Single(compilation.
SyntaxTrees
);
675
Assert.Single(compilation.
SyntaxTrees
);
732
Assert.Single(compilation.
SyntaxTrees
);
773
Assert.Single(compilation.
SyntaxTrees
);
820
Assert.Single(compilation.
SyntaxTrees
);
1122
compilation = compilation.RemoveSyntaxTrees(compilation.
SyntaxTrees
.Last());
1190
compilation = compilation.RemoveSyntaxTrees(compilation.
SyntaxTrees
.Last());
1248
var firstTree = compilation.
SyntaxTrees
.First();
1426
var firstTree = compilation.
SyntaxTrees
.First();
1427
var lastTree = compilation.
SyntaxTrees
.Last();
1537
compilation = compilation.ReplaceSyntaxTree(compilation.
SyntaxTrees
.First(), CSharpSyntaxTree.ParseText(source2, parseOptions));
1650
compilation = compilation.ReplaceSyntaxTree(compilation.
SyntaxTrees
.First(), CSharpSyntaxTree.ParseText(source2, parseOptions));
1853
Assert.Single(compilation.
SyntaxTrees
);
1894
Assert.Single(compilation.
SyntaxTrees
);
1935
Assert.Single(compilation.
SyntaxTrees
);
1984
Assert.Single(compilation.
SyntaxTrees
);
2010
Assert.Single(compilation.
SyntaxTrees
);
2048
Assert.Single(compilation.
SyntaxTrees
);
2082
Assert.Single(compilation.
SyntaxTrees
);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (107)
Compilation\GetSemanticInfoBrokenCodeTests.cs (1)
242
var tree = comp.
SyntaxTrees
.Single();
Compilation\GetSemanticInfoTests.cs (18)
2925
var tree = comp.
SyntaxTrees
.Single();
3017
var tree = comp.
SyntaxTrees
.Single();
3782
var tree = compilation.
SyntaxTrees
.Single();
3843
var tree = compilation.
SyntaxTrees
.Single();
3909
var tree = compilation.
SyntaxTrees
.Single();
4035
var tree = comp.
SyntaxTrees
.Single();
4433
var tree = compilation.
SyntaxTrees
.Single();
4487
var tree = compilation.
SyntaxTrees
.Single();
4532
var tree = compilation.
SyntaxTrees
.Single();
4671
var tree = comp.
SyntaxTrees
.Single();
4716
var tree = comp.
SyntaxTrees
.Single();
5400
var tree = compilation.
SyntaxTrees
.Single();
5518
var tree = comp.
SyntaxTrees
.Single();
5532
var tree = comp.
SyntaxTrees
.Single();
5579
var tree = comp.
SyntaxTrees
.Single();
5617
var tree = comp.
SyntaxTrees
.Single();
5664
var tree = comp.
SyntaxTrees
.Single();
5717
var tree = comp.
SyntaxTrees
.Single();
Compilation\SemanticModelAPITests.cs (6)
1229
var tree = comp.
SyntaxTrees
.Single();
1358
var tree = comp.
SyntaxTrees
.Single();
1725
var tree = comp.
SyntaxTrees
.Single();
2069
var tree = comp.
SyntaxTrees
.Single();
3738
var tree = comp.
SyntaxTrees
.Single();
3902
var tree = comp.
SyntaxTrees
.Single();
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (23)
1706
var tree = compilation.
SyntaxTrees
.Single();
1810
var tree = compilation.
SyntaxTrees
.Single();
1932
var tree = compilation.
SyntaxTrees
.Single();
1972
tree = compilation.
SyntaxTrees
.Single();
2782
var tree = compilation.
SyntaxTrees
.First();
2903
var tree = compilation.
SyntaxTrees
.First();
2933
var tree = compilation.
SyntaxTrees
.First();
2965
var tree = compilation.
SyntaxTrees
.First();
3014
var tree = compilation.
SyntaxTrees
.First();
3071
var tree = compilation.
SyntaxTrees
.First();
3107
var tree = comp.
SyntaxTrees
.First();
3137
var tree = compilation.
SyntaxTrees
.First();
3233
var tree = compilation.
SyntaxTrees
.First();
3736
var tree = compilation.
SyntaxTrees
.First();
3748
var tree2 = compilation.
SyntaxTrees
.ElementAt(1);
3996
var tree = compilation.
SyntaxTrees
.Single();
4085
var tree = compilation.
SyntaxTrees
.Single();
4437
var tree = compilation.
SyntaxTrees
.Single();
4468
var tree = compilation.
SyntaxTrees
.Single();
4499
var tree = compilation.
SyntaxTrees
.Single();
4533
var tree = compilation.
SyntaxTrees
.Single();
4570
var tree = compilation.
SyntaxTrees
.Single();
4651
var tree = compilation.
SyntaxTrees
.Single();
Compilation\SemanticModelGetSemanticInfoTests.cs (10)
1113
var tree = compilation.
SyntaxTrees
.First();
1147
tree = compilation.
SyntaxTrees
.First();
1177
tree = compilation.
SyntaxTrees
.First();
1207
tree = compilation.
SyntaxTrees
.First();
1233
tree = compilation.
SyntaxTrees
.First();
1260
tree = compilation.
SyntaxTrees
.First();
1288
tree = compilation.
SyntaxTrees
.First();
1315
tree = compilation.
SyntaxTrees
.First();
1356
tree = compilation.
SyntaxTrees
.First();
1394
tree = compilation.
SyntaxTrees
.First();
Compilation\UsedAssembliesTests.cs (1)
135
var tree = comp.
SyntaxTrees
.Single();
DocumentationComments\CrefTests.cs (30)
905
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
1001
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
1100
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
4785
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
4847
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
4874
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
4935
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
4977
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
5009
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
5086
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
5138
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
5400
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
5443
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
5469
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
5491
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
5593
var tree = compilation.
SyntaxTrees
.Single();
5623
var tree = compilation.
SyntaxTrees
.Single();
6104
var tree = compilation.
SyntaxTrees
.Single();
6139
var tree = compilation.
SyntaxTrees
.Single();
6182
var tree = compilation.
SyntaxTrees
.Single();
6210
var tree = compilation.
SyntaxTrees
.Single();
6240
var tree = compilation.
SyntaxTrees
.Single();
6325
var tree = compilation.
SyntaxTrees
.First();
6424
var tree = comp.
SyntaxTrees
.Single();
6462
var tree = comp.
SyntaxTrees
.Single();
6496
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
6531
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
6558
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
6580
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
6603
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
DocumentationComments\ParameterTests.cs (3)
566
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
594
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
643
var model = compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single());
SymbolDisplay\SymbolDisplayTests.cs (1)
5595
var model = comp.GetSemanticModel(comp.
SyntaxTrees
.First());
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
1004
var syntaxTree = compilation.
SyntaxTrees
.Single();
Symbols\ConversionTests.cs (3)
2066
var tree = comp.
SyntaxTrees
.Single();
2136
var tree = comp.
SyntaxTrees
.Single();
2170
var tree = comp.
SyntaxTrees
.Single();
Symbols\DestructorTests.cs (1)
404
var tree = compilation.
SyntaxTrees
.Single();
Symbols\ExtensionMethodTests.cs (2)
2950
var tree = compilation.
SyntaxTrees
.Single();
3008
var tree = compilation.
SyntaxTrees
.Single();
Symbols\MethodEqualityTests.cs (1)
205
var tree = comp.
SyntaxTrees
.Single();
Symbols\Source\BaseClassTests.cs (2)
269
var tree = comp.
SyntaxTrees
.First();
306
var tree = comp.
SyntaxTrees
.First();
Symbols\Source\EventTests.cs (1)
303
var semanticModel = compVerifier.Compilation.GetSemanticModel(compVerifier.Compilation.
SyntaxTrees
.Single());
Symbols\Source\ExternAliasTests.cs (1)
475
var tree = comp.
SyntaxTrees
.Single();
Symbols\Source\NullablePublicAPITests.cs (1)
1207
var syntaxTree = comp.
SyntaxTrees
.First();
Symbols\TypeTests.cs (1)
1851
var tree = compilation.
SyntaxTrees
.Single();
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.cs (1)
4989
var tree = compilation.
SyntaxTrees
.Single();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
CodeFixes\CodeFixServiceTests.cs (1)
613
foreach (var tree in context.Compilation.
SyntaxTrees
)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (3)
858
var generator = new DiagnosticProducingGenerator(c => Location.Create(c.Compilation.
SyntaxTrees
.Single(), new TextSpan(0, 10)));
925
context.RegisterCompilationAction(c => c.ReportDiagnostic(Diagnostic.Create(s_compilationRule, c.Compilation.
SyntaxTrees
.First().GetRoot().GetLocation())));
941
context.RegisterCompilationAction(c => c.ReportDiagnostic(Diagnostic.Create(s_compilationRule, c.Compilation.
SyntaxTrees
.First().GetRoot().GetLocation())));
Microsoft.CodeAnalysis.Features (1)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
127
var tree = compilation.
SyntaxTrees
.FirstOrDefault(tree => !GeneratedCodeUtilities.IsGeneratedCode(tree, IsRegularCommentOrDocComment, context.CancellationToken));
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
414
foreach (var syntaxTree in context.Compilation.
SyntaxTrees
)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (5)
Diagnostics\NonLocalDiagnosticTests.cs (2)
89
foreach (var tree in compilation.
SyntaxTrees
)
102
foreach (var tree in compilation.
SyntaxTrees
)
Diagnostics\PullDiagnosticTests.cs (3)
678
var generator = new DiagnosticProducingGenerator(context => Location.Create(context.Compilation.
SyntaxTrees
.Single(), new TextSpan(0, 10)));
1324
var generator = new DiagnosticProducingGenerator(context => Location.Create(context.Compilation.
SyntaxTrees
.Single(), new TextSpan(0, 10)));
1345
context.Compilation.
SyntaxTrees
.Single(),
Microsoft.CodeAnalysis.Rebuild (1)
CompilationFactory.cs (1)
84
var embeddedTexts = rebuildCompilation.
SyntaxTrees
Microsoft.CodeAnalysis.Rebuild.UnitTests (3)
CompilationRebuildArtifactResolver.cs (1)
30
.
SyntaxTrees
RoundTripUtil.cs (2)
71
Assert.True(original.
SyntaxTrees
.All(x => !string.IsNullOrEmpty(x.FilePath)));
94
original.
SyntaxTrees
.SelectAsArray(x => compilationFactory.CreateSyntaxTree(x.FilePath, x.GetText())),
Microsoft.CodeAnalysis.Test.Utilities (13)
Compilation\CompilationExtensions.cs (2)
201
SyntaxTree tree = compilation.
SyntaxTrees
.First();
287
foreach (var tree in compilation.
SyntaxTrees
)
Compilation\IRuntimeEnvironment.cs (1)
251
var embeddedTexts = compilation.
SyntaxTrees
CompilationVerifier.cs (1)
647
ILValidation.GetSequencePointMarkers(xmlMethod, id => _compilation.
SyntaxTrees
.Single(tree => tree.FilePath == documentMap[id]).GetText()) :
Diagnostics\CommonDiagnosticAnalyzers.cs (9)
105
var tree = compilation.
SyntaxTrees
.First();
183
var tree = compilation.
SyntaxTrees
.First();
260
var tree = compilation.
SyntaxTrees
.First();
313
var tree = compilation.
SyntaxTrees
.First();
1079
foreach (var tree in context.Compilation.
SyntaxTrees
)
1833
if (_treeCallbackSet.Count != endContext.Compilation.
SyntaxTrees
.Count())
2827
var index = compilation.
SyntaxTrees
.IndexOf(tree) + 1;
2834
var index = compilation.
SyntaxTrees
.IndexOf(analyzedTree) + 1;
2835
foreach (var tree in compilation.
SyntaxTrees
)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (1)
CommandLineTests.vb (1)
132
Dim tree = comp.
SyntaxTrees
.Single()
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (1)
ScriptTests.vb (1)
64
Assert.Equal(script.Code, compilation.
SyntaxTrees
.First().GetText().ToString())
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (54)
Diagnostics\DiagnosticAnalyzerTests.vb (2)
1169
Dim files = compilation.
SyntaxTrees
.Select(Function(t) t.FilePath).ToImmutableArray()
1184
For i As Integer = 0 To compilation.
SyntaxTrees
.Count() - 1
SourceGeneration\GeneratorDriverTests.vb (18)
35
Assert.Equal(2, outputCompilation.
SyntaxTrees
.Count())
73
Assert.Equal(2, outputCompilation.
SyntaxTrees
.Count())
303
Dim syntaxTree = VisualBasicSyntaxTree.ParseText(comp.
SyntaxTrees
.Single().GetText(), parseOptions, path:="/detached")
333
Dim validSyntaxTree = comp.
SyntaxTrees
.Single()
365
Dim syntaxTree = VisualBasicSyntaxTree.ParseText(ctx.Compilation.
SyntaxTrees
.Single().GetText(), parseOptions, path:="/detached")
394
Dim validSyntaxTree = ctx.Compilation.
SyntaxTrees
.Single()
425
Dim syntaxTree = comp.
SyntaxTrees
.Single()
455
Dim syntaxTree = comp.
SyntaxTrees
.Single()
486
Dim syntaxTree = ctx.Compilation.
SyntaxTrees
.Single()
515
Dim syntaxTree = ctx.Compilation.
SyntaxTrees
.Single()
545
Dim syntaxTree = comp.
SyntaxTrees
.Single()
575
Dim syntaxTree = ctx.Compilation.
SyntaxTrees
.Single()
607
Assert.Equal(1, outputCompilation.
SyntaxTrees
.Count())
625
Assert.Equal(1, outputCompilation.
SyntaxTrees
.Count())
642
Assert.Single(compilation.
SyntaxTrees
)
650
Assert.Single(compilation.
SyntaxTrees
)
667
Assert.Single(compilation.
SyntaxTrees
)
675
c.ReportDiagnostic(diag.WithLocation(CodeAnalysis.Location.Create(c.Compilation.
SyntaxTrees
.First(), location)))
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.vb (34)
76
Assert.Single(compilation.
SyntaxTrees
)
117
Assert.Single(compilation.
SyntaxTrees
)
160
Assert.Single(compilation.
SyntaxTrees
)
188
Assert.Single(compilation.
SyntaxTrees
)
201
Sub(_step) Assert.True(DirectCast(_step.Outputs.Single().Value, CompilationUnitSyntax).SyntaxTree Is compilation.
SyntaxTrees
.First))
217
Assert.Single(compilation.
SyntaxTrees
)
230
Sub(_step) Assert.True(DirectCast(_step.Outputs.Single().Value, CompilationUnitSyntax).SyntaxTree Is compilation.
SyntaxTrees
.First))
256
Sub(_step) Assert.True(DirectCast(_step.Outputs.Single().Value, CompilationUnitSyntax).SyntaxTree Is compilation.
SyntaxTrees
.First),
257
Sub(_step) Assert.True(DirectCast(_step.Outputs.Single().Value, CompilationUnitSyntax).SyntaxTree Is compilation.
SyntaxTrees
.Last))
274
Assert.Single(compilation.
SyntaxTrees
)
303
Assert.Single(compilation.
SyntaxTrees
)
332
Assert.Single(compilation.
SyntaxTrees
)
361
Assert.Single(compilation.
SyntaxTrees
)
392
Assert.Single(compilation.
SyntaxTrees
)
435
Assert.Single(compilation.
SyntaxTrees
)
476
Assert.Single(compilation.
SyntaxTrees
)
516
Assert.Single(compilation.
SyntaxTrees
)
555
Assert.Single(compilation.
SyntaxTrees
)
594
Assert.Single(compilation.
SyntaxTrees
)
634
Assert.Single(compilation.
SyntaxTrees
)
891
Assert.Single(compilation.
SyntaxTrees
)
938
Assert.Single(compilation.
SyntaxTrees
)
985
Assert.Single(compilation.
SyntaxTrees
)
1000
driver = driver.RunGenerators(compilation.AddSyntaxTrees(compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From(""))))
1028
Assert.Single(compilation.
SyntaxTrees
)
1042
driver = driver.RunGenerators(compilation.AddSyntaxTrees(compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("
1077
Assert.Single(compilation.
SyntaxTrees
)
1091
driver = driver.RunGenerators(compilation.AddSyntaxTrees(compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("
1144
driver = driver.RunGenerators(compilation.AddSyntaxTrees(compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("
1188
Assert.Single(compilation.
SyntaxTrees
)
1203
compilation.
SyntaxTrees
.First(),
1204
compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("
1257
compilation.
SyntaxTrees
.First(),
1258
compilation.
SyntaxTrees
.First().WithChangedText(SourceText.From("
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (13)
CompilationTestUtils.vb (6)
425
Dim trees = If(fileName Is Nothing, compilation.
SyntaxTrees
, compilation.
SyntaxTrees
.Where(Function(t) t.FilePath = fileName))
461
Dim tree = (From t In compilation.
SyntaxTrees
Where t.FilePath = fileName).Single()
505
Dim tree = (From t In compilation.
SyntaxTrees
Where t.FilePath = fileName).Single()
623
Dim tree = (From t In compilation.
SyntaxTrees
Where t.FilePath = fileName).Single()
688
Return (From t In compilation.
SyntaxTrees
Where t.FilePath = name).First()
SemanticModelTestBase.vb (7)
29
Dim tree = (From t In compilation.
SyntaxTrees
Where t.FilePath = fileName).Single()
48
Dim tree = (From t In compilation.
SyntaxTrees
Where t.FilePath = fileName).Single()
70
Dim tree = (From t In compilation.
SyntaxTrees
Where t.FilePath = fileName).Single()
96
Dim tree = (From t In compilation.
SyntaxTrees
Where t.FilePath = fileName).Single()
103
Dim tree = (From t In compilation.
SyntaxTrees
Where t.FilePath = fileName).Single()
120
Dim tree = (From t In compilation.
SyntaxTrees
Where t.FilePath = filename).Single()
129
Dim tree = (From t In compilation.
SyntaxTrees
Where t.FilePath = filename).Single()
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.vb (1)
3859
Dim declCU = comp.
SyntaxTrees
.First().GetRoot()
Microsoft.CodeAnalysis.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (1)
121
if (syntaxTree != null && Contains(compilation.
SyntaxTrees
, syntaxTree))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
158
return compilation.
SyntaxTrees
.Contains(locations.First().SourceTree);
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (2)
105
Contract.ThrowIfTrue(this.CompilationWithoutGeneratedDocuments.
SyntaxTrees
.Contains(generatedDocument.GetSyntaxTree(CancellationToken.None)));
205
Contract.ThrowIfTrue(compilationWithoutGeneratedDocuments.
SyntaxTrees
.Contains(generatedDocument.GetSyntaxTree(CancellationToken.None)));
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
977
foreach (var tree in compilation.
SyntaxTrees
)
Microsoft.CodeAnalysis.Workspaces.UnitTests (39)
SolutionTests\SolutionTests.cs (18)
338
var tree = compilation.
SyntaxTrees
.Single();
2699
Assert.Empty((await finalProject.GetCompilationAsync()).
SyntaxTrees
);
2877
var trees = compilation.
SyntaxTrees
.ToList();
3485
Assert.Equal(1, compilation.
SyntaxTrees
.Count());
3925
var syntaxTree = compilation.
SyntaxTrees
.Single();
4081
var tree = Assert.Single((await frozenDocument.Project.GetCompilationAsync()).
SyntaxTrees
);
4106
var tree = Assert.Single((await frozenDocument.Project.GetCompilationAsync()).
SyntaxTrees
);
4275
var singleTree = Assert.Single((await frozenDocument.Project.GetCompilationAsync()).
SyntaxTrees
);
4344
Assert.Contains(await frozenDocument.GetSyntaxTreeAsync(), (await frozenDocument.Project.GetCompilationAsync()).
SyntaxTrees
);
4570
return solution.GetProject(pid).GetCompilationAsync().Result.
SyntaxTrees
.ToImmutableArray();
5587
Assert.Empty(frozenCompilation.
SyntaxTrees
);
5606
Assert.Single(frozenCompilation.
SyntaxTrees
);
5631
Assert.Single(frozenCompilation1.
SyntaxTrees
);
5635
Assert.Empty(frozenCompilation2.
SyntaxTrees
);
5658
Assert.Single(frozenCompilation1.
SyntaxTrees
);
5665
Assert.Empty(frozenCompilation2.
SyntaxTrees
);
5688
Assert.Single(frozenCompilation1.
SyntaxTrees
);
5695
Assert.Single(frozenCompilation2.
SyntaxTrees
);
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
845
onExecute: context => noTreesPassed = context.Compilation.
SyntaxTrees
.Any()));
SymbolKeyTests.cs (20)
318
TestRoundTrip(GetAllSymbols(compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single())), compilation);
618
var tree = compilation.
SyntaxTrees
.First();
654
var tree = compilation.
SyntaxTrees
.First();
676
var tree = compilation.
SyntaxTrees
.First();
701
var tree = compilation.
SyntaxTrees
.First();
719
var tree = compilation.
SyntaxTrees
.First();
737
var tree = compilation.
SyntaxTrees
.First();
757
var tree = compilation.
SyntaxTrees
.First();
780
var tree = compilation.
SyntaxTrees
.First();
823
var tree = compilation.
SyntaxTrees
.First();
837
var tree = compilation.
SyntaxTrees
.First();
981
compilation.GetSemanticModel(compilation.
SyntaxTrees
.Single()),
1022
compilation1.GetSemanticModel(compilation1.
SyntaxTrees
.Single()),
1059
compilation1.GetSemanticModel(compilation1.
SyntaxTrees
.Single()),
1092
compilation1.GetSemanticModel(compilation1.
SyntaxTrees
.Single()),
1127
compilation1.GetSemanticModel(compilation1.
SyntaxTrees
.Single()),
1174
compilation2.GetSemanticModel(compilation2.
SyntaxTrees
.Single()),
1221
compilation2.GetSemanticModel(compilation2.
SyntaxTrees
.Single()),
1273
var tree = compilation1.
SyntaxTrees
.Single();
1415
var syntaxTree = compilation.
SyntaxTrees
.Single();
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.cs (1)
3043
var tree = compilation.
SyntaxTrees
.FirstOrDefault();
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
CodeModel\VisualBasicCodeModelService.vb (1)
3653
Dim tree = compilation.
SyntaxTrees
.FirstOrDefault()
System.Text.Json.SourceGeneration (1)
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithSimpleName.cs (1)
100
.SelectMany((compilation, cancellationToken) => compilation.
SyntaxTrees
System.Windows.Forms.PrivateSourceGenerators.Tests (1)
EnumValidationTests.cs (1)
311
string output = outputCompilation.
SyntaxTrees
.Skip(2).First().ToString();