1 write to Compilation
Microsoft.CodeAnalysis (1)
SourceGeneration\GeneratorContexts.cs (1)
26Compilation = compilation;
31 references to Compilation
Microsoft.CodeAnalysis (4)
SourceGeneration\GeneratorContexts.cs (3)
99/// The severity of the diagnostic may cause the compilation to fail, depending on the <see cref="Compilation"/> settings. 107DiagnosticAnalysisContextHelpers.VerifyArguments(diagnostic, Compilation, isSupportedDiagnostic: static (_, _) => true, CancellationToken); 198/// will be visited by a registered <see cref="ISyntaxReceiver"/> and available for semantic analysis as part of the <see cref="GeneratorExecutionContext.Compilation"/>
SourceGeneration\ISourceGenerator.cs (1)
44/// A generator can use the <see cref="GeneratorExecutionContext.Compilation"/> property to
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
CommandLineTests.cs (1)
14705var classOptions = gc.AnalyzerConfigOptions.GetOptions(gc.Compilation.SyntaxTrees.First());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
SourceGeneration\GeneratorDriverTests.cs (7)
919var generator = new CallbackGenerator((ic) => ic.RegisterForPostInitialization(postInit), (sgc) => { dSymbol = sgc.Compilation.GetTypeByMetadataName("D"); }, source = "public class E : D {}"); 947var generator2 = new CallbackGenerator2((ic) => { }, (sgc) => { dSymbol = sgc.Compilation.GetTypeByMetadataName("D"); }, source = "public class E : D {}"); 1271c.ReportDiagnostic(d.WithLocation(Location.Create(c.Compilation.SyntaxTrees.First(), l))); 3840var validSyntaxTree = ctx.Compilation.SyntaxTrees.Single(); 3936var syntaxTree = ctx.Compilation.SyntaxTrees.Single(); 3965var syntaxTree = ctx.Compilation.SyntaxTrees.Single(); 4027var syntaxTree = ctx.Compilation.SyntaxTrees.Single();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
CodeFixes\CodeFixServiceTests.cs (1)
612foreach (var tree in context.Compilation.SyntaxTrees)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
858var generator = new DiagnosticProducingGenerator(c => Location.Create(c.Compilation.SyntaxTrees.Single(), new TextSpan(0, 10)));
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Rename\CSharp\SourceGeneratorTests.vb (1)
89Dim [interface] = context.Compilation.GetTypeByMetadataName("IInterface")
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
414foreach (var syntaxTree in context.Compilation.SyntaxTrees)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (3)
Diagnostics\PullDiagnosticTests.cs (3)
678var generator = new DiagnosticProducingGenerator(context => Location.Create(context.Compilation.SyntaxTrees.Single(), new TextSpan(0, 10))); 1324var generator = new DiagnosticProducingGenerator(context => Location.Create(context.Compilation.SyntaxTrees.Single(), new TextSpan(0, 10))); 1345context.Compilation.SyntaxTrees.Single(),
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (6)
SourceGeneration\GeneratorDriverTests.vb (6)
365Dim syntaxTree = VisualBasicSyntaxTree.ParseText(ctx.Compilation.SyntaxTrees.Single().GetText(), parseOptions, path:="/detached") 394Dim validSyntaxTree = ctx.Compilation.SyntaxTrees.Single() 486Dim syntaxTree = ctx.Compilation.SyntaxTrees.Single() 515Dim syntaxTree = ctx.Compilation.SyntaxTrees.Single() 575Dim syntaxTree = ctx.Compilation.SyntaxTrees.Single() 755c.ReportDiagnostic(diag.WithLocation(CodeAnalysis.Location.Create(c.Compilation.SyntaxTrees.First(), location)))
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
845onExecute: context => noTreesPassed = context.Compilation.SyntaxTrees.Any()));
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Roslyn3.11.cs (1)
32var p = new Parser(context.Compilation, context.ReportDiagnostic, context.CancellationToken);
Microsoft.Gen.ComplianceReports (3)
ComplianceReportsGenerator.cs (3)
65if (!SymbolLoader.TryLoad(context.Compilation, out var symbolHolder)) 71var parser = new Parser(context.Compilation, symbolHolder!, context.CancellationToken); 80string report = emitter.Emit(classifiedTypes, context.Compilation.AssemblyName!);
Microsoft.Gen.MetricsReports (1)
MetricsReportsGenerator.cs (1)
53var meteringParser = new Metrics.Parser(context.Compilation, context.ReportDiagnostic, context.CancellationToken);