2 types derived from Compilation
Microsoft.CodeAnalysis.CSharp (1)
Compilation\CSharpCompilation.cs (1)
43public sealed partial class CSharpCompilation : Compilation
Microsoft.CodeAnalysis.VisualBasic (1)
Compilation\VisualBasicCompilation.vb (1)
40Inherits Compilation
3683 references to Compilation
AnalyzerRunner (4)
DiagnosticAnalyzerRunner.cs (3)
185var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 393var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 394var newCompilation = compilation.RemoveAllSyntaxTrees().AddSyntaxTrees(compilation.SyntaxTrees);
Program.cs (1)
150var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Analyzers (5)
AppHostAnalyzer.cs (1)
29var compilation = context.Compilation;
Infrastructure\WellKnownTypes.cs (4)
12private static readonly BoundedCacheWithFactory<Compilation, WellKnownTypes> s_lazyWellKnownTypesCache = new(); 14public static WellKnownTypes GetOrCreate(Compilation compilation) => 18private readonly Compilation _compilation; 47private WellKnownTypes(Compilation compilation)
BuildValidator (4)
CompilationDiff.cs (4)
53private readonly Compilation? _rebuildCompilation; 90Compilation? rebuildCompilation = null, 135var rebuildCompilation = compilationFactory.CreateCompilation(artifactResolver); 280static void createDiffArtifacts(string debugPath, string assemblyFileName, BuildInfo originalInfo, BuildInfo rebuildInfo, Compilation compilation)
ConfigurationSchemaGenerator (9)
ConfigSchemaEmitter.cs (3)
19internal sealed partial class ConfigSchemaEmitter(SchemaGenerationSpec spec, Compilation compilation) 35private readonly Compilation _compilation = compilation; 376.GetMethod("GetDocumentationComment", BindingFlags.Public | BindingFlags.Static, [typeof(ISymbol), typeof(Compilation), typeof(CultureInfo), typeof(bool), typeof(bool), typeof(CancellationToken)])!;
RuntimeSource\Roslyn\GetBestTypeByMetadataName.cs (6)
14/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 35/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 38public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 82/// A thin wrapper over <see cref="GetBestTypeByMetadataName(Compilation, string)"/>, 85/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
IdeCoreBenchmarks (4)
FindReferencesBenchmarks.cs (1)
96var compilation = await project.GetCompilationAsync();
IncrementalSourceGeneratorBenchmarks.cs (1)
149var compilation = await project.GetCompilationAsync();
RenameBenchmarks.cs (1)
48var compilation = project.GetCompilationAsync().Result;
SwitchStatementBenchmarks.cs (1)
75var compilation = project.GetCompilationAsync().Result;
ILLink.RoslynAnalyzer (18)
COMAnalyzer.cs (1)
35 var compilation = context.Compilation;
CompilationExtensions.cs (3)
15 /// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 36 /// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 39 public static INamedTypeSymbol? GetBestTypeByMetadataName (this Compilation compilation, string fullyQualifiedMetadataName)
DataFlow\LocalDataFlowVisitor.cs (2)
41 protected readonly Compilation Compilation; 60 Compilation compilation,
DataFlowAnalyzerContext.cs (3)
24 public Compilation Compilation { get; } 33 Compilation compilation) 40 public static DataFlowAnalyzerContext Create (AnalyzerOptions options, Compilation compilation, ImmutableArray<RequiresAnalyzerBase> requiresAnalyzers)
RequiresAnalyzerBase.cs (4)
47 var compilation = context.Compilation; 295 internal virtual ImmutableArray<ISymbol> GetSpecialIncompatibleMembers (Compilation compilation) => default; 311 private protected virtual bool IsRequiresCheck (IPropertySymbol propertySymbol, Compilation compilation) => false; 323 internal bool IsFeatureGuard (IPropertySymbol propertySymbol, Compilation compilation)
RequiresAssemblyFilesAnalyzer.cs (2)
64 private protected override bool IsRequiresCheck (IPropertySymbol propertySymbol, Compilation compilation) 79 internal override ImmutableArray<ISymbol> GetSpecialIncompatibleMembers (Compilation compilation)
RequiresDynamicCodeAnalyzer.cs (1)
127 private protected override bool IsRequiresCheck (IPropertySymbol propertySymbol, Compilation compilation) {
RequiresUnreferencedCodeAnalyzer.cs (1)
67 private protected override bool IsRequiresCheck (IPropertySymbol propertySymbol, Compilation compilation)
TrimAnalysis\TrimAnalysisVisitor.cs (1)
47 Compilation compilation,
Microsoft.Analyzers.Extra (12)
CallAnalysis\CallAnalyzer.Registrar.cs (2)
21internal Registrar(State state, Compilation compilation) 239public Compilation Compilation { get; }
CallAnalysis\Fixers\LegacyLoggingFixer.cs (9)
42internal Func<Compilation, string, INamedTypeSymbol?> GetTypeByMetadataName1 = (c, n) => c.GetTypeByMetadataName(n); 43internal Func<Compilation, string, INamedTypeSymbol?> GetTypeByMetadataName2 = (c, n) => c.GetTypeByMetadataName(n); 44internal Func<Compilation, string, INamedTypeSymbol?> GetTypeByMetadataName3 = (c, n) => c.GetTypeByMetadataName(n); 87var comp = sm.Compilation; 145var comp = sm.Compilation; 268var comp = (await proj.GetCompilationAsync(cancellationToken).ConfigureAwait(false))!; 473var comp = sm.Compilation; 583var comp = sm.Compilation; 618private int CalcEventId(Compilation comp, ClassDeclarationSyntax targetClass, CancellationToken cancellationToken)
Utilities\CompilationExtensions.cs (1)
10public static bool IsNet6OrGreater(this Compilation compilation)
Microsoft.Analyzers.Extra.Tests (5)
Resources\RoslynTestUtils.cs (5)
191var comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 219var comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 259var comp = await proj!.GetCompilationAsync().ConfigureAwait(false); 333var comp = await proj!.GetCompilationAsync().ConfigureAwait(false); 540var comp = await _project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Microsoft.Analyzers.Local (6)
ApiLifecycle\ApiLifecycleAnalyzer.cs (3)
36var compilation = start.Compilation; 49private static AssemblyAnalysis Analyze(Compilation compilation, Assembly? assemblyModel) 67var compilation = context.Compilation;
ApiLifecycle\ModelLoader.cs (1)
23var compilation = context.Compilation;
CallAnalysis\CallAnalyzer.Registrar.cs (2)
21internal Registrar(State state, Compilation compilation) 239public Compilation Compilation { get; }
Microsoft.Analyzers.Local.Tests (5)
Resources\RoslynTestUtils.cs (5)
191var comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 219var comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 259var comp = await proj!.GetCompilationAsync().ConfigureAwait(false); 334var comp = await proj!.GetCompilationAsync().ConfigureAwait(false); 541var comp = await _project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Microsoft.AspNetCore.Analyzer.Testing (3)
CodeFixRunner.cs (1)
48var compilation = await project
DiagnosticAnalyzerRunner.cs (1)
62var compilation = await project.GetCompilationAsync();
DiagnosticVerifier.cs (1)
82var compilation = await project.GetCompilationAsync();
Microsoft.AspNetCore.Analyzers (2)
CompilationFeatureDetector.cs (1)
17Compilation compilation,
StartupSymbols.cs (1)
10public StartupSymbols(Compilation compilation)
Microsoft.AspNetCore.Analyzers.Test (11)
CompilationFeatureDetectorTest.cs (3)
32var compilation = TestCompilation.Create(source); 72var compilation = TestCompilation.Create(source); 112var compilation = TestCompilation.Create(source);
ConfigureMethodVisitorTest.cs (1)
78var compilation = TestCompilation.Create(source);
src\Shared\AnalyzerTesting\TestCompilation.cs (1)
11public static Compilation Create(string source)
StartupFactsTest.cs (6)
115var compilation = TestCompilation.Create(TestSources[source]); 140var compilation = TestCompilation.Create(TestSources[source]); 163var compilation = TestCompilation.Create(TestSources[source]); 185var compilation = TestCompilation.Create(TestSources[source]); 207var compilation = TestCompilation.Create(TestSources[source]); 224var compilation = TestCompilation.Create(TestSources[source]);
Microsoft.AspNetCore.App.Analyzers (13)
Http\RequestDelegateReturnTypeAnalyzer.cs (1)
25var compilation = context.Compilation;
Infrastructure\RouteUsageCache.cs (4)
16private static readonly BoundedCacheWithFactory<Compilation, RouteUsageCache> LazyRouteUsageCache = new(); 18public static RouteUsageCache GetOrCreate(Compilation compilation) => 22private readonly Compilation _compilation; 24private RouteUsageCache(Compilation compilation)
Mvc\MvcAnalyzer.cs (1)
36var compilation = context.Compilation;
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (1)
27var compilation = context.Compilation;
RouteHandlers\RouteHandlerAnalyzer.cs (1)
41var compilation = context.Compilation;
src\Shared\RoslynUtils\WellKnownTypes.cs (4)
15private static readonly BoundedCacheWithFactory<Compilation, WellKnownTypes> LazyWellKnownTypesCache = new(); 17public static WellKnownTypes GetOrCreate(Compilation compilation) => 21private readonly Compilation _compilation; 50private WellKnownTypes(Compilation compilation)
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
38var compilation = context.Compilation;
Microsoft.AspNetCore.Components.Analyzers (2)
ComponentFacts.cs (1)
90public static bool IsComponent(ComponentSymbols symbols, Compilation compilation, INamedTypeSymbol type)
ComponentSymbols.cs (1)
11public static bool TryCreate(Compilation compilation, out ComponentSymbols symbols)
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
AnalyzerTestBase.cs (1)
42public Task<Compilation> CreateCompilationAsync(string source)
Helpers\DiagnosticVerifier.Helper.cs (1)
23private static readonly MetadataReference CodeAnalysisReference = MetadataReference.CreateFromFile(typeof(Compilation).Assembly.Location);
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
ComponentFacts.cs (1)
90public static bool IsComponent(ComponentSymbols symbols, Compilation compilation, INamedTypeSymbol type)
ComponentSymbols.cs (1)
11public static bool TryCreate(Compilation compilation, out ComponentSymbols symbols)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
AnalyzerTestBase.cs (1)
42public Task<Compilation> CreateCompilationAsync(string source)
Helpers\DiagnosticVerifier.Helper.cs (1)
23private static readonly MetadataReference CodeAnalysisReference = MetadataReference.CreateFromFile(typeof(Compilation).Assembly.Location);
Microsoft.AspNetCore.Http.Extensions.Tests (23)
RequestDelegateGenerator\CompileTimeCreationTests.cs (16)
58var compilation = await project.GetCompilationAsync(); 67driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var updatedCompilation, 84var compilation = await project.GetCompilationAsync(); 93driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var updatedCompilation, 166var compilation = await project.GetCompilationAsync(); 175driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var updatedCompilation, 233var compilation = await project.GetCompilationAsync(); 242driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var updatedCompilation, 287var compilation = await project.GetCompilationAsync(); 296driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var updatedCompilation, 334var compilation = await project.GetCompilationAsync(); 343driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var updatedCompilation, 670var compilation = await project.GetCompilationAsync(); 679driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var updatedCompilation, 727var compilation = await project.GetCompilationAsync(); 736driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var updatedCompilation,
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (7)
42internal async Task<(GeneratorRunResult?, Compilation)> RunGeneratorAsync(string sources, params string[] updatedSources) 45var compilation = await CreateCompilationAsync(sources); 64driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var updatedCompilation, 114internal Endpoint GetEndpointFromCompilation(Compilation compilation, bool? expectGeneratedCodeOverride = null, IServiceProvider serviceProvider = null) => 117internal Endpoint[] GetEndpointsFromCompilation(Compilation compilation, bool? expectGeneratedCodeOverride = null, IServiceProvider serviceProvider = null, bool skipGeneratedCodeCheck = false) 303private static Task<Compilation> CreateCompilationAsync(string sources) 347internal async Task VerifyAgainstBaselineUsingFile(Compilation compilation, [CallerMemberName] string callerName = "")
Microsoft.AspNetCore.Http.Microbenchmarks (9)
RequestDelegateGeneratorBenchmarks.cs (2)
20private Compilation _compilation; 47_driver.RunGeneratorsAndUpdateCompilation(_compilation, out var _, out var _);
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (7)
42internal async Task<(GeneratorRunResult?, Compilation)> RunGeneratorAsync(string sources, params string[] updatedSources) 45var compilation = await CreateCompilationAsync(sources); 64driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var updatedCompilation, 114internal Endpoint GetEndpointFromCompilation(Compilation compilation, bool? expectGeneratedCodeOverride = null, IServiceProvider serviceProvider = null) => 117internal Endpoint[] GetEndpointsFromCompilation(Compilation compilation, bool? expectGeneratedCodeOverride = null, IServiceProvider serviceProvider = null, bool skipGeneratedCodeCheck = false) 303private static Task<Compilation> CreateCompilationAsync(string sources) 347internal async Task VerifyAgainstBaselineUsingFile(Compilation compilation, [CallerMemberName] string callerName = "")
Microsoft.AspNetCore.Http.RequestDelegateGenerator (4)
src\Shared\RoslynUtils\WellKnownTypes.cs (4)
15private static readonly BoundedCacheWithFactory<Compilation, WellKnownTypes> LazyWellKnownTypesCache = new(); 17public static WellKnownTypes GetOrCreate(Compilation compilation) => 21private readonly Compilation _compilation; 50private WellKnownTypes(Compilation compilation)
Microsoft.AspNetCore.Mvc.Analyzers (3)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
145public TypeCache(Compilation compilation)
TagHelpersInCodeBlocksAnalyzer.cs (1)
147public static bool TryCreate(Compilation compilation, out SymbolCache symbolCache)
TopLevelParameterNameAnalyzer.cs (1)
233public static bool TryCreate(Compilation compilation, out SymbolCache symbolCache)
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
ApiControllerSymbolCache.cs (1)
11public static bool TryCreate(Compilation compilation, out ApiControllerSymbolCache symbolCache)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (6)
HubClientProxyGenerator.cs (1)
35private static void Execute(Compilation compilation, ImmutableArray<MethodDeclarationSyntax> methodDeclarationSyntaxes, ImmutableArray<MemberAccessExpressionSyntax> memberAccessExpressionSyntaxes, SourceProductionContext context)
HubClientProxyGenerator.Parser.cs (2)
175private readonly Compilation _compilation; 177public Parser(SourceProductionContext context, Compilation compilation)
HubServerProxyGenerator.cs (1)
35private static void Execute(Compilation compilation, ImmutableArray<MethodDeclarationSyntax> methodDeclarationSyntaxes, ImmutableArray<MemberAccessExpressionSyntax> memberAccessExpressionSyntaxes, SourceProductionContext context)
HubServerProxyGenerator.Parser.cs (2)
165private readonly Compilation _compilation; 167internal Parser(SourceProductionContext context, Compilation compilation)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
MiscTests.cs (1)
31name.Name == typeof(Compilation).Assembly.GetName().Name ||
Microsoft.CodeAnalysis (326)
CommandLine\CommandLineArguments.cs (1)
296/// Options to the <see cref="Compilation"/>.
CommandLine\CommonCompiler.CompilerEmitStreamProvider.cs (2)
16/// This implementation of <see cref="Compilation.EmitStreamProvider"/> will delay the creation 21private sealed class CompilerEmitStreamProvider : Compilation.EmitStreamProvider
CommandLine\CommonCompiler.cs (18)
95public abstract Compilation? CreateCompilation( 424private ImmutableArray<EmbeddedText?> AcquireEmbeddedTexts(Compilation compilation, DiagnosticBag diagnostics) 526internal bool ReportDiagnostics(IEnumerable<Diagnostic> diagnostics, TextWriter consoleOutput, ErrorLogger? errorLoggerOpt, Compilation? compilation) 597private bool ReportDiagnostics(DiagnosticBag diagnostics, TextWriter consoleOutput, ErrorLogger? errorLoggerOpt, Compilation? compilation) 601internal bool ReportDiagnostics(IEnumerable<DiagnosticInfo> diagnostics, TextWriter consoleOutput, ErrorLogger? errorLoggerOpt, Compilation? compilation) 607private void ReportIVTInfos(TextWriter consoleOutput, ErrorLogger? errorLogger, Compilation compilation, ImmutableArray<Diagnostic> diagnostics) 664private protected abstract void DiagnoseBadAccesses(TextWriter consoleOutput, ErrorLogger? errorLogger, Compilation compilation, ImmutableArray<Diagnostic> diagnostics); 813private protected (Compilation Compilation, GeneratorDriverTimingInfo DriverTimingInfo) RunGenerators( 814Compilation input, 839driver = driver.RunGeneratorsAndUpdateCompilation(input, out var compilationOut, out var diagnostics); 939Compilation? compilation = CreateCompilation(consoleOutput, touchedFilesLogger, errorLogger, sourceFileAnalyzerConfigOptions, globalConfigOptions); 1060Compilation compilation, 1096ref Compilation compilation, 1514(CancellationTokenSource, DiagnosticBag, AnalyzerDriver) initializeAnalyzerDriver(AnalyzerOptions analyzerOptions, ref Compilation compilation) 1618protected abstract string GetOutputFileName(Compilation compilation, CancellationToken cancellationToken); 1643Compilation compilation, 1656Compilation compilation, 1744Compilation compilation,
Compilation\Compilation.cs (37)
136/// the output of the build. This string is effectively a content key for a <see cref="Compilation"/> 229internal static void ValidateScriptCompilationParameters(Compilation? previousScriptCompilation, Type? returnType, ref Type? globalsType) 289public Compilation Clone() 294protected abstract Compilation CommonClone(); 299internal abstract Compilation WithEventQueue(AsyncQueue<CompilationEvent>? eventQueue); 304internal abstract Compilation WithSemanticModelProvider(SemanticModelProvider semanticModelProvider); 326/// If <see cref="SemanticModelProvider"/> is non-null, it attempts to use <see cref="SemanticModelProvider.GetSemanticModel(SyntaxTree, Compilation, SemanticModelOptions)"/> 434public Compilation WithAssemblyName(string? assemblyName) 439protected abstract Compilation CommonWithAssemblyName(string? outputName); 457public Compilation WithOptions(CompilationOptions options) 462protected abstract Compilation CommonWithOptions(CompilationOptions options); 491private Compilation? PreviousSubmission 546public Compilation WithScriptCompilationInfo(ScriptCompilationInfo? info) => CommonWithScriptCompilationInfo(info); 547protected abstract Compilation CommonWithScriptCompilationInfo(ScriptCompilationInfo? info); 564public Compilation AddSyntaxTrees(params SyntaxTree[] trees) 574public Compilation AddSyntaxTrees(IEnumerable<SyntaxTree> trees) 579protected abstract Compilation CommonAddSyntaxTrees(IEnumerable<SyntaxTree> trees); 587public Compilation RemoveSyntaxTrees(params SyntaxTree[] trees) 598public Compilation RemoveSyntaxTrees(IEnumerable<SyntaxTree> trees) 603protected abstract Compilation CommonRemoveSyntaxTrees(IEnumerable<SyntaxTree> trees); 609public Compilation RemoveAllSyntaxTrees() 614protected abstract Compilation CommonRemoveAllSyntaxTrees(); 623public Compilation ReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree newTree) 628protected abstract Compilation CommonReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree newTree); 758public Compilation WithReferences(IEnumerable<MetadataReference> newReferences) 768public Compilation WithReferences(params MetadataReference[] newReferences) 776protected abstract Compilation CommonWithReferences(IEnumerable<MetadataReference> newReferences); 783public Compilation AddReferences(params MetadataReference[] references) 793public Compilation AddReferences(IEnumerable<MetadataReference> references) 813public Compilation RemoveReferences(params MetadataReference[] references) 823public Compilation RemoveReferences(IEnumerable<MetadataReference> references) 855public Compilation RemoveAllReferences() 867public Compilation ReplaceReference(MetadataReference oldReference, MetadataReference? newReference) 1674for (Compilation? c = this.PreviousSubmission; c != null; c = c.PreviousSubmission) 1686bool assemblyIsInCompilationReferences(IAssemblySymbol a, Compilation compilation) 1938manifestContents = typeof(Compilation).GetTypeInfo().Assembly.GetManifestResourceStream("Microsoft.CodeAnalysis.Resources.default.win32manifest"); 3823/// Determines whether the runtime this <see cref="Compilation"/> is targeting supports a particular capability.
Compilation\CompilationOptions.cs (1)
33/// is derived from the name of the compilation (<see cref="Compilation.AssemblyName"/>)
Compilation\DeterministicKeyBuilder.cs (2)
239var compilerVersion = typeof(Compilation).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion; 325var compilation = compilationReference.Compilation;
Compilation\DeterministicKeyOptions.cs (1)
23/// <see cref="Compilation"/> being the same but aren't concerned precisely with the file
Compilation\ScriptCompilationInfo.cs (4)
21public Compilation? PreviousScriptCompilation => CommonPreviousScriptCompilation; 22internal abstract Compilation? CommonPreviousScriptCompilation { get; } 24public ScriptCompilationInfo WithPreviousScriptCompilation(Compilation? compilation) => CommonWithPreviousScriptCompilation(compilation); 25internal abstract ScriptCompilationInfo CommonWithPreviousScriptCompilation(Compilation? compilation);
Compilation\SemanticModel.cs (3)
18/// an instance is obtained by a call to <see cref="Compilation.GetSemanticModel(SyntaxTree, SemanticModelOptions)"/>. 47public Compilation Compilation 55protected abstract Compilation CompilationCore { get; }
Compilation\SemanticModelProvider.cs (2)
11/// This provider can be attached to a compilation, see <see cref="Compilation.SemanticModelProvider"/>. 18public abstract SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation, SemanticModelOptions options = default);
Diagnostic\Diagnostic.cs (2)
347public SuppressionInfo? GetSuppressionInfo(Compilation compilation) 601/// on such diagnostics, as they are recognized by <see cref="Compilation.GetRequiredLanguageVersion"/>.
DiagnosticAnalyzer\AnalysisContextInfo.cs (9)
16private readonly Compilation? _compilation; 22public AnalysisContextInfo(Compilation compilation) : 32public AnalysisContextInfo(Compilation compilation, ISymbol symbol) : 37public AnalysisContextInfo(Compilation compilation, SourceOrAdditionalFile file) : 42public AnalysisContextInfo(Compilation compilation, SyntaxNode node) : 47public AnalysisContextInfo(Compilation compilation, IOperation operation) : 52public AnalysisContextInfo(Compilation compilation, ISymbol symbol, SyntaxNode node) : 58Compilation? compilation, 80sb.AppendLine($"{nameof(Compilation)}: {_compilation.AssemblyName}");
DiagnosticAnalyzer\AnalysisResultBuilder.cs (1)
187public void ApplySuppressionsAndStoreAnalysisResult(AnalysisScope analysisScope, AnalyzerDriver driver, Compilation compilation, Func<DiagnosticAnalyzer, AnalyzerActionCounts> getAnalyzerActionCounts, CancellationToken cancellationToken)
DiagnosticAnalyzer\AnalysisScope.cs (4)
96public static AnalysisScope Create(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzers compilationWithAnalyzers) 104public static AnalysisScope CreateForBatchCompile(Compilation compilation, AnalyzerOptions analyzerOptions, ImmutableArray<DiagnosticAnalyzer> analyzers) 109private static AnalysisScope Create(Compilation compilation, AnalyzerOptions? analyzerOptions, ImmutableArray<DiagnosticAnalyzer> analyzers, bool hasAllAnalyzers, bool concurrentAnalysis) 238Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopmostNodeForAnalysis,
DiagnosticAnalyzer\AnalyzerActionCounts.cs (2)
188/// by compilation events added to the <see cref="Compilation.EventQueue"/>. For these callbacks to be executed, 194/// <see cref="Compilation"/> is created. Any action callbacks driven off <see cref="CompilationStartedEvent"/>
DiagnosticAnalyzer\AnalyzerDriver.CompilationData.cs (1)
13public CompilationData(Compilation compilation)
DiagnosticAnalyzer\AnalyzerDriver.cs (26)
38private static readonly Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> s_getTopmostNodeForAnalysis = GetTopmostNodeForAnalysis; 462Compilation compilation, 616private bool ShouldSuppressGeneratedCodeDiagnostic(Diagnostic diagnostic, DiagnosticAnalyzer analyzer, Compilation compilation, CancellationToken cancellationToken) 813Compilation compilation, 821out Compilation newCompilation, 833Compilation compilation, 842out Compilation newCompilation, 864public async Task<ImmutableArray<Diagnostic>> GetDiagnosticsAsync(Compilation compilation, CancellationToken cancellationToken) 942Compilation compilation, 1005protected SemanticModel GetOrCreateSemanticModel(SyntaxTree tree, Compilation compilation) 1012public void ApplyProgrammaticSuppressions(DiagnosticBag reportedDiagnostics, Compilation compilation, CancellationToken cancellationToken) 1025public ImmutableArray<Diagnostic> ApplyProgrammaticSuppressions(ImmutableArray<Diagnostic> reportedDiagnostics, Compilation compilation, CancellationToken cancellationToken) 1036private ImmutableArray<Diagnostic> ApplyProgrammaticSuppressionsCore(ImmutableArray<Diagnostic> reportedDiagnostics, Compilation compilation, CancellationToken cancellationToken) 1179public ImmutableArray<Diagnostic> DequeueLocalDiagnosticsAndApplySuppressions(DiagnosticAnalyzer analyzer, bool syntax, Compilation compilation, CancellationToken cancellationToken) 1185public ImmutableArray<Diagnostic> DequeueNonLocalDiagnosticsAndApplySuppressions(DiagnosticAnalyzer analyzer, Compilation compilation, CancellationToken cancellationToken) 1191private ImmutableArray<Diagnostic> FilterDiagnosticsSuppressedInSourceOrByAnalyzers(ImmutableArray<Diagnostic> diagnostics, Compilation compilation, CancellationToken cancellationToken) 1199Compilation compilation, 1229internal ImmutableArray<Diagnostic> ApplyProgrammaticSuppressionsAndFilterDiagnostics(ImmutableArray<Diagnostic> reportedDiagnostics, Compilation compilation, CancellationToken cancellationToken) 1245private bool IsInGeneratedCode(Location location, Compilation compilation, CancellationToken cancellationToken) 1287ImmutableHashSet<ISymbol> getOrComputeGeneratedCodeSymbolsInTree(SyntaxTree tree, Compilation compilation, CancellationToken cancellationToken) 1318static ImmutableHashSet<ISymbol> computeGeneratedCodeSymbolsInTree(SyntaxTree tree, Compilation compilation, INamedTypeSymbol generatedCodeAttribute, CancellationToken cancellationToken) 1885private static SyntaxNode GetTopmostNodeForAnalysis(ISymbol symbol, SyntaxReference syntaxReference, Compilation compilation, CancellationToken cancellationToken) 1957internal static Action<Diagnostic, CancellationToken> GetDiagnosticSink(Action<Diagnostic> addDiagnosticCore, Compilation compilation, AnalyzerOptions? analyzerOptions, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds) 1969internal static Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken> GetDiagnosticSink(Action<Diagnostic, DiagnosticAnalyzer, bool> addLocalDiagnosticCore, Compilation compilation, AnalyzerOptions? analyzerOptions, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds) 1981internal static Action<Diagnostic, DiagnosticAnalyzer, CancellationToken> GetDiagnosticSink(Action<Diagnostic, DiagnosticAnalyzer> addDiagnosticCore, Compilation compilation, AnalyzerOptions? analyzerOptions, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds) 1993private static Diagnostic? GetFilteredDiagnostic(Diagnostic diagnostic, Compilation compilation, AnalyzerOptions? analyzerOptions, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds, CancellationToken cancellationToken)
DiagnosticAnalyzer\AnalyzerExecutor.AnalyzerDiagnosticReporter.cs (4)
30Compilation compilation, 36Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 69private Compilation _compilation; 75private Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> _shouldSuppressGeneratedCodeDiagnostic;
DiagnosticAnalyzer\AnalyzerExecutor.cs (14)
44private readonly Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> _shouldSuppressGeneratedCodeDiagnostic; 99Compilation compilation, 107Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 131Compilation compilation, 139Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 172internal Compilation Compilation { get; } 357Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 412Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 449Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 466Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 1369private Action<Diagnostic> GetAddDiagnostic(ISymbol contextSymbol, ImmutableArray<SyntaxReference> cachedDeclaringReferences, DiagnosticAnalyzer analyzer, Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, CancellationToken cancellationToken) 1378Compilation compilation, 1383Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 1384Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic,
DiagnosticAnalyzer\AnalyzerOptionsExtensions.cs (1)
32Compilation compilation,
DiagnosticAnalyzer\CachingSemanticModelProvider.cs (11)
16/// and should invoke <see cref="ClearCache(SyntaxTree, Compilation)"/> and <see cref="ClearCache(Compilation)"/> to clear entries when appropriate. 26private static readonly ConditionalWeakTable<Compilation, PerCompilationProvider>.CreateValueCallback s_createProviderCallback 27= new ConditionalWeakTable<Compilation, PerCompilationProvider>.CreateValueCallback(compilation => new PerCompilationProvider(compilation)); 29private readonly ConditionalWeakTable<Compilation, PerCompilationProvider> _providerCache; 33_providerCache = new ConditionalWeakTable<Compilation, PerCompilationProvider>(); 36public override SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation, SemanticModelOptions options = default) 39internal void ClearCache(SyntaxTree tree, Compilation compilation) 47internal void ClearCache(Compilation compilation) 54private readonly Compilation _compilation; 61public PerCompilationProvider(Compilation compilation)
DiagnosticAnalyzer\CompilationCompletedEvent.cs (1)
12public CompilationCompletedEvent(Compilation compilation) : base(compilation) { }
DiagnosticAnalyzer\CompilationEvent.cs (2)
9internal CompilationEvent(Compilation compilation) 14public Compilation Compilation { get; }
DiagnosticAnalyzer\CompilationStartedEvent.cs (2)
16private CompilationStartedEvent(Compilation compilation, ImmutableArray<AdditionalText> additionalFiles) 22public CompilationStartedEvent(Compilation compilation)
DiagnosticAnalyzer\CompilationUnitCompletedEvent.cs (1)
13public CompilationUnitCompletedEvent(Compilation compilation, SyntaxTree compilationUnit, TextSpan? filterSpan = null)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (19)
26private readonly Compilation _compilation; 47/// Underlying <see cref="Compilation"/> with a non-null <see cref="Compilation.EventQueue"/>, used to drive analyzer execution. 49public Compilation Compilation => _compilation; 69/// <inheritdoc cref="CompilationWithAnalyzers(Compilation, ImmutableArray{DiagnosticAnalyzer}, AnalyzerOptions?)"/> 72public CompilationWithAnalyzers(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options, CancellationToken cancellationToken) 83public CompilationWithAnalyzers(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options) 94public CompilationWithAnalyzers(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzersOptions analysisOptions) 113private static void VerifyArguments(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzersOptions analysisOptions) 305var compilation = _compilation.WithEventQueue(new AsyncQueue<CompilationEvent>()); 364Compilation compilation, 724var compilation = analysisScope.IsSingleFileAnalysisForCompilerAnalyzer 832Compilation compilation, 880Compilation compilation, 988Compilation compilation, 1021static void generateCompilationEvents(Compilation compilation, AnalysisScope analysisScope, CancellationToken cancellationToken) 1040Compilation compilation, 1157public static IEnumerable<Diagnostic> GetEffectiveDiagnostics(IEnumerable<Diagnostic> diagnostics, Compilation compilation) 1167public static IEnumerable<Diagnostic> GetEffectiveDiagnostics(ImmutableArray<Diagnostic> diagnostics, Compilation compilation) 1182private static IEnumerable<Diagnostic> GetEffectiveDiagnosticsImpl(ImmutableArray<Diagnostic> diagnostics, Compilation compilation)
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (2)
25private readonly Compilation _compilation; 27public CompilationAnalyzer(Compilation compilation)
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (47)
57/// A compilation action reports <see cref="Diagnostic"/>s about the <see cref="Compilation"/>. 324private readonly Compilation _compilation; 329/// <see cref="CodeAnalysis.Compilation"/> that is the subject of the analysis. 331public Compilation Compilation { get { return _compilation; } } 343protected CompilationStartAnalysisContext(Compilation compilation, AnalyzerOptions options, CancellationToken cancellationToken) 352/// A compilation end action reports <see cref="Diagnostic"/>s about the <see cref="CodeAnalysis.Compilation"/>. 556/// A compilation action or compilation end action can use a <see cref="CompilationAnalysisContext"/> to report <see cref="Diagnostic"/>s about a <see cref="CodeAnalysis.Compilation"/>. 560private readonly Compilation _compilation; 568/// <see cref="CodeAnalysis.Compilation"/> that is the subject of the analysis. 570public Compilation Compilation { get { return _compilation; } } 583public CompilationAnalysisContext(Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 589Compilation compilation, 605/// Report a <see cref="Diagnostic"/> about a <see cref="CodeAnalysis.Compilation"/>. 767private readonly Compilation _compilation; 779/// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="ISymbol"/>. 781public Compilation Compilation { get { return _compilation; } } 815public SymbolAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 822Compilation compilation, 870/// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="ISymbol"/>. 872public Compilation Compilation { get; } 904public SymbolStartAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, CancellationToken cancellationToken) 909internal SymbolStartAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, bool isGeneratedCode, SyntaxTree? filterTree, TextSpan? filterSpan, CancellationToken cancellationToken) 1238private readonly Compilation _compilation; 1257/// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="OperationBlocks"/>. 1259public Compilation Compilation => _compilation; 1292Compilation compilation, 1303Compilation compilation, 1378private readonly Compilation _compilation; 1399/// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="OperationBlocks"/>. 1401public Compilation Compilation => _compilation; 1434Compilation compilation, 1447Compilation compilation, 1510private readonly Compilation? _compilationOpt; 1543internal Compilation? Compilation => _compilationOpt; 1556Compilation? compilation, 1619public Compilation Compilation { get; } 1626Compilation compilation, 1684/// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="SyntaxNode"/>. 1686public Compilation Compilation => _semanticModel?.Compilation ?? throw new InvalidOperationException(); 1772private readonly Compilation _compilation; 1790/// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="IOperation"/>. 1792public Compilation Compilation => _compilation; 1825Compilation compilation, 1837Compilation compilation, 1900/// <see cref="CodeAnalysis.Compilation"/> for the context. 1902public Compilation Compilation { get; } 1915Compilation compilation,
DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs (3)
43internal static void VerifyArguments(Diagnostic diagnostic, Compilation? compilation, Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 75internal static void VerifyDiagnosticLocationsInCompilation(Diagnostic diagnostic, Compilation compilation) 88private static void VerifyDiagnosticLocationInCompilation(string id, Location location, Compilation compilation)
DiagnosticAnalyzer\DiagnosticAnalyzerExtensions.cs (4)
14/// <inheritdoc cref="WithAnalyzers(Compilation, ImmutableArray{DiagnosticAnalyzer}, AnalyzerOptions?)"/> 17public static CompilationWithAnalyzers WithAnalyzers(this Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options, CancellationToken cancellationToken) 29public static CompilationWithAnalyzers WithAnalyzers(this Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options = null) 41public static CompilationWithAnalyzers WithAnalyzers(this Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzersOptions analysisOptions)
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (3)
131Compilation compilation, 230Compilation compilation, 329Compilation compilation,
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (5)
34private readonly Compilation _compilation; 105internal SuppressMessageAttributeState(Compilation compilation) 311private void DecodeGlobalSuppressMessageAttributes(Compilation compilation, ISymbol symbol, GlobalSuppressions globalSuppressions) 319private static void DecodeGlobalSuppressMessageAttributes(Compilation compilation, GlobalSuppressions globalSuppressions, IEnumerable<AttributeData> attributes) 357internal static ImmutableArray<ISymbol> ResolveTargetSymbols(Compilation compilation, string target, TargetScope scope)
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
37private readonly Compilation _compilation; 42public TargetSymbolResolver(Compilation compilation, TargetScope scope, string fullyQualifiedName)
DiagnosticAnalyzer\SymbolDeclaredCompilationEvent.cs (1)
21Compilation compilation,
DocumentationCommentId.cs (17)
98public static ImmutableArray<ISymbol> GetSymbolsForDeclarationId(string id, Compilation compilation) 126private static bool TryGetSymbolsForDeclarationId(string id, Compilation compilation, List<ISymbol> results) 149public static ISymbol? GetFirstSymbolForDeclarationId(string id, Compilation compilation) 176public static ImmutableArray<ISymbol> GetSymbolsForReferenceId(string id, Compilation compilation) 204private static bool TryGetSymbolsForReferenceId(string id, Compilation compilation, List<ISymbol> results) 232public static ISymbol? GetFirstSymbolForReferenceId(string id, Compilation compilation) 701public static bool ParseDeclaredSymbolId(string id, Compilation compilation, List<ISymbol> results) 720public static bool ParseReferencedSymbolId(string id, Compilation compilation, List<ISymbol> results) 733private static void ParseDeclaredId(string id, ref int index, Compilation compilation, List<ISymbol> results) 864private static ITypeSymbol? ParseTypeSymbol(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext) 885private static void ParseTypeSymbol(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext, List<ISymbol> results) 1010private static void ParseNamedTypeSymbol(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext, List<ISymbol> results) 1121private static bool ParseTypeArguments(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext, List<ITypeSymbol> typeArguments) 1222private static void GetMatchingMethods(string id, ref int index, List<INamespaceOrTypeSymbol> containers, string memberName, int arity, Compilation compilation, List<ISymbol> results) 1289private static void GetMatchingProperties(string id, ref int index, List<INamespaceOrTypeSymbol> containers, string memberName, Compilation compilation, List<ISymbol> results) 1453private static bool ParseParameterList(string id, ref int index, Compilation compilation, ISymbol typeParameterContext, List<ParameterInfo> parameters) 1494private static ParameterInfo? ParseParameter(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext)
Emit\CommonPEModuleBuilder.cs (4)
56Compilation compilation) 124internal abstract Compilation CommonCompilation { get; } 580where TCompilation : Compilation 741internal sealed override Compilation CommonCompilation => Compilation;
Emit\EditAndContinue\DefinitionMap.cs (1)
210internal VariableSlotAllocator? TryCreateVariableSlotAllocator(Compilation compilation, IMethodSymbolInternal method, IMethodSymbolInternal topLevelMethod, DiagnosticBag diagnostics)
Emit\EditAndContinue\DeltaMetadataWriter.cs (1)
170internal EmitBaseline GetDelta(Compilation compilation, Guid encId, MetadataSizes metadataSizes)
Emit\EditAndContinue\EmitBaseline.cs (5)
100/// <param name="compilation">Initial <see cref="Compilation"/>.</param> 139Compilation compilation, 213internal readonly Compilation Compilation; 291Compilation compilation, 392Compilation compilation,
Emit\EditAndContinue\SymbolMatcher.cs (1)
31Compilation targetCompilation,
Emit\EmitOptions.cs (1)
78/// By default the name of the output assembly is <see cref="Compilation.AssemblyName"/>. Only in rare cases it is necessary
FileSystemExtensions.cs (1)
33this Compilation compilation,
MetadataReference\CompilationReference.cs (3)
18public Compilation Compilation { get { return CompilationCore; } } 19internal abstract Compilation CompilationCore { get; } 27internal static MetadataReferenceProperties GetProperties(Compilation compilation, ImmutableArray<string> aliases, bool embedInteropTypes)
MetadataReference\MetadataReferenceResolver.cs (2)
21/// doesn't match any of the assemblies explicitly referenced by the <see cref="Compilation"/> (via <see cref="Compilation.ExternalReferences"/>, or #r directives.
MetadataReference\PortableExecutableReference.cs (6)
139/// Called when the <see cref="Compilation"/> needs to read the reference metadata. 147/// The calling <see cref="Compilation"/> doesn't take ownership of the <see cref="Metadata"/> objects returned by this method. 149/// The <see cref="Metadata"/> object is kept alive by the <see cref="Compilation"/> that called <see cref="GetMetadataNoCopy"/> 150/// and by all compilations created from it via calls to With- factory methods on <see cref="Compilation"/>, 151/// other than <see cref="Compilation.WithReferences(MetadataReference[])"/> overloads. A compilation created using 152/// <see cref="Compilation.WithReferences(MetadataReference[])"/> will call to <see cref="GetMetadataNoCopy"/> again.
NativePdbWriter\PdbWriter.cs (1)
791var compilerAssembly = typeof(Compilation).Assembly;
Operations\ControlFlowGraphBuilder.cs (2)
29private readonly Compilation _compilation; 63private ControlFlowGraphBuilder(Compilation compilation, CaptureIdDispenser? captureIdDispenser, ArrayBuilder<BasicBlockBuilder> blocks)
Operations\OperationExtensions.cs (1)
28internal static bool HasErrors(this IOperation operation, Compilation compilation, CancellationToken cancellationToken = default(CancellationToken))
PEWriter\MetadataWriter.PortablePdb.cs (1)
886var compilerVersion = typeof(Compilation).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
ReferenceManager\AssemblyData.cs (1)
70public abstract Compilation? SourceCompilation { get; }
ReferenceManager\AssemblyDataForAssemblyBeingBuilt.cs (1)
134public override Compilation? SourceCompilation => null;
ReferenceManager\CommonReferenceManager.Resolution.cs (3)
28where TCompilation : Compilation 841var previousScriptCompilation = compilation.ScriptCompilationInfo?.PreviousScriptCompilation; 1031var sourceCompilation = definitionData.SourceCompilation;
ReferenceManager\CommonReferenceManager.State.cs (2)
28/// - <see cref="Compilation.RetargetingAssemblySymbols"/> 56/// containing assembly or <see cref="Compilation.UnspecifiedModuleAssemblyName"/>
SourceGeneration\GeneratorAdaptor.cs (1)
77internal record GeneratorContextBuilder(Compilation Compilation)
SourceGeneration\GeneratorContexts.cs (3)
24internal GeneratorExecutionContext(Compilation compilation, ParseOptions parseOptions, ImmutableArray<AdditionalText> additionalTexts, AnalyzerConfigOptionsProvider optionsProvider, ISyntaxContextReceiver? syntaxReceiver, string sourceExtension, CancellationToken cancellationToken = default) 38/// Get the current <see cref="CodeAnalysis.Compilation"/> at the time of execution. 45public Compilation Compilation { get; }
SourceGeneration\GeneratorDriver.cs (9)
48public GeneratorDriver RunGenerators(Compilation compilation) => RunGenerators(compilation, generatorFilter: null, cancellationToken: default); 51public GeneratorDriver RunGenerators(Compilation compilation, CancellationToken cancellationToken) => RunGenerators(compilation, generatorFilter: null, cancellationToken); 60public GeneratorDriver RunGenerators(Compilation compilation, Func<GeneratorFilterContext, bool>? generatorFilter, CancellationToken cancellationToken = default) 66public GeneratorDriver RunGeneratorsAndUpdateCompilation(Compilation compilation, out Compilation outputCompilation, out ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken = default) 213internal GeneratorDriverState RunGeneratorsCore(Compilation compilation, DiagnosticBag? diagnosticsBag, Func<GeneratorFilterContext, bool>? generatorFilter = null, CancellationToken cancellationToken = default) 339static bool handleGeneratorException(Compilation compilation, CommonMessageProvider messageProvider, ISourceGenerator sourceGenerator, Exception e, bool isInit) 381private static GeneratorState SetGeneratorException(Compilation compilation, CommonMessageProvider provider, GeneratorState generatorState, ISourceGenerator generator, Exception e, DiagnosticBag? diagnosticBag, CancellationToken cancellationToken, TimeSpan? runTime = null, bool isInit = false) 419private static ImmutableArray<Diagnostic> FilterDiagnostics(Compilation compilation, ImmutableArray<Diagnostic> generatorDiagnostics, DiagnosticBag? driverDiagnostics, CancellationToken cancellationToken)
SourceGeneration\IncrementalContexts.cs (4)
50public IncrementalValueProvider<Compilation> CompilationProvider => new IncrementalValueProvider<Compilation>(SharedInputNodes.Compilation.WithRegisterOutput(RegisterOutput).WithTrackingName(WellKnownGeneratorInputs.Compilation), CatchAnalyzerExceptions); 141internal readonly Compilation Compilation; 143internal SourceProductionContext(AdditionalSourcesCollection sources, DiagnosticBag diagnostics, Compilation compilation, CancellationToken cancellationToken)
SourceGeneration\ISourceGenerator.cs (1)
41/// This call represents the main generation step. It is called after a <see cref="Compilation"/> is
SourceGeneration\Nodes\DriverStateTable.cs (2)
35public Compilation Compilation { get; } 39public Builder(Compilation compilation, GeneratorDriverState driverState, SyntaxStore.Builder syntaxStore, CancellationToken cancellationToken = default)
SourceGeneration\Nodes\SharedInputNodes.cs (2)
18public static readonly InputNode<Compilation> Compilation = new InputNode<Compilation>(b => ImmutableArray.Create(b.Compilation));
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (1)
126ISyntaxHelper syntaxHelper, Compilation compilation, CancellationToken cancellationToken)
SourceGeneration\SyntaxStore.cs (5)
18private readonly Compilation? _compilation; 21private SyntaxStore(StateTableStore tables, Compilation? compilation) 27public Builder ToBuilder(Compilation compilation, ImmutableArray<SyntaxInputNode> syntaxInputNodes, bool enableTracking, CancellationToken cancellationToken) => new Builder(compilation, syntaxInputNodes, enableTracking, this, cancellationToken); 34private readonly Compilation _compilation; 40internal Builder(Compilation compilation, ImmutableArray<SyntaxInputNode> syntaxInputNodes, bool enableTracking, SyntaxStore previousStore, CancellationToken cancellationToken)
Symbols\INamespaceSymbol.cs (1)
52Compilation? ContainingCompilation { get; }
Symbols\ISourceAssemblySymbol.cs (1)
16Compilation Compilation { get; }
Symbols\ISymbolInternal.cs (1)
45Compilation DeclaringCompilation { get; }
Symbols\TypedConstant.cs (1)
158internal static TypedConstantKind GetTypedConstantKind(ITypeSymbolInternal type, Compilation compilation)
Syntax\SyntaxNodeLocationComparer.cs (2)
11private readonly Compilation _compilation; 13public SyntaxNodeLocationComparer(Compilation compilation)
Microsoft.CodeAnalysis.CodeStyle (137)
src\Analyzers\Core\Analyzers\Helpers\DeserializationConstructorCheck.cs (1)
9internal readonly struct DeserializationConstructorCheck(Compilation compilation)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (3)
19private readonly Compilation _compilation; 26Compilation compilation, IMethodSymbol objectGetHashCodeMethod, 35public static bool TryGetAnalyzer(Compilation compilation, [NotNullWhen(true)] out HashCodeAnalyzer analyzer)
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
112Compilation compilation,
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
123var compilation = context.Compilation;
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (1)
70protected sealed class CompilationAnalyzer(Compilation compilation, INamedTypeSymbol suppressMessageAttributeType)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
614Compilation compilation)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (2)
16internal sealed partial class SuppressMessageAttributeState(Compilation compilation, INamedTypeSymbol suppressMessageAttributeType) 23private readonly Compilation _compilation = compilation;
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
115Compilation compilation, 133private static IEnumerable<INamedTypeSymbol> GetAttributesForMethodsToIgnore(Compilation compilation) 608Compilation compilation,
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
177private static IEnumerable<INamedTypeSymbol?> GetAttributesForMethodsToIgnore(Compilation compilation)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
72static bool TryGetEnumerableTypeSymbol(Compilation compilation, [NotNullWhen(true)] out INamedTypeSymbol? enumerableType)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (4)
89protected abstract bool SupportsReadOnlyProperties(Compilation compilation); 90protected abstract bool SupportsPropertyInitializer(Compilation compilation); 91protected abstract bool SupportsFieldExpression(Compilation compilation); 341var compilation = semanticModel.Compilation;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (2)
80protected abstract bool AreCollectionInitializersSupported(Compilation compilation); 81protected abstract bool AreCollectionExpressionsSupported(Compilation compilation);
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
81static bool AreEqualOrHaveImplicitConversion(ITypeSymbol? firstType, ITypeSymbol? secondType, Compilation compilation)
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (2)
52protected abstract bool IsLanguageVersionSupported(Compilation compilation); 53protected abstract bool IsUnconstrainedGenericSupported(Compilation compilation);
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
67protected abstract bool ShouldAnalyze(Compilation compilation);
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
89protected abstract bool AreObjectInitializersSupported(Compilation compilation);
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
51protected abstract bool IsSupported(Compilation compilation);
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
37private readonly Compilation _compilation; 42public TargetSymbolResolver(Compilation compilation, TargetScope scope, string fullyQualifiedName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CompilationExtensions.cs (5)
12/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 33/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 36public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 73public static IMethodSymbol? GetTopLevelStatementsMethod(this Compilation compilation) 87public static INamedTypeSymbol? TryGetCallingConventionSymbol(this Compilation compilation, string callingConvention)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICompilationExtensions.cs (69)
23public static ImmutableArray<Compilation> GetReferencedCompilations(this Compilation compilation) 25var builder = ArrayBuilder<Compilation>.GetInstance(); 32var previous = compilation.ScriptCompilationInfo?.PreviousScriptCompilation; 42public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 54var previous = compilation.ScriptCompilationInfo?.PreviousScriptCompilation; 72public static INamedTypeSymbol? AttributeType(this Compilation compilation) 75public static INamedTypeSymbol? ExceptionType(this Compilation compilation) 78public static INamedTypeSymbol? DebuggerDisplayAttributeType(this Compilation compilation) 81public static INamedTypeSymbol? StructLayoutAttributeType(this Compilation compilation) 84public static INamedTypeSymbol? DesignerCategoryAttributeType(this Compilation compilation) 87public static INamedTypeSymbol? DesignerGeneratedAttributeType(this Compilation compilation) 90public static INamedTypeSymbol? HideModuleNameAttribute(this Compilation compilation) 93public static INamedTypeSymbol? ThreadStaticAttributeType(this Compilation compilation) 96public static INamedTypeSymbol? EventArgsType(this Compilation compilation) 99public static INamedTypeSymbol? NotImplementedExceptionType(this Compilation compilation) 102public static INamedTypeSymbol? EqualityComparerOfTType(this Compilation compilation) 105public static INamedTypeSymbol? ActionType(this Compilation compilation) 108public static INamedTypeSymbol? ExpressionOfTType(this Compilation compilation) 111public static INamedTypeSymbol? EditorBrowsableAttributeType(this Compilation compilation) 114public static INamedTypeSymbol? EditorBrowsableStateType(this Compilation compilation) 117public static INamedTypeSymbol? TaskType(this Compilation compilation) 120public static INamedTypeSymbol? TaskOfTType(this Compilation compilation) 123public static INamedTypeSymbol? ValueTaskType(this Compilation compilation) 126public static INamedTypeSymbol? ValueTaskOfTType(this Compilation compilation) 129public static INamedTypeSymbol? IEnumerableType(this Compilation compilation) 132public static INamedTypeSymbol? IEnumerableOfTType(this Compilation compilation) 135public static INamedTypeSymbol? IEnumeratorOfTType(this Compilation compilation) 138public static INamedTypeSymbol? IListOfTType(this Compilation compilation) 141public static INamedTypeSymbol? IReadOnlyListOfTType(this Compilation compilation) 144public static INamedTypeSymbol? IAsyncEnumerableOfTType(this Compilation compilation) 147public static INamedTypeSymbol? IAsyncEnumeratorOfTType(this Compilation compilation) 150public static INamedTypeSymbol? ImmutableArrayOfTType(this Compilation compilation) 153public static INamedTypeSymbol? SerializableAttributeType(this Compilation compilation) 156public static INamedTypeSymbol? CoClassType(this Compilation compilation) 159public static INamedTypeSymbol? ComAliasNameAttributeType(this Compilation compilation) 162public static INamedTypeSymbol? SuppressMessageAttributeType(this Compilation compilation) 165public static INamedTypeSymbol? TupleElementNamesAttributeType(this Compilation compilation) 168public static INamedTypeSymbol? NativeIntegerAttributeType(this Compilation compilation) 171public static INamedTypeSymbol? DynamicAttributeType(this Compilation compilation) 174public static INamedTypeSymbol? LazyOfTType(this Compilation compilation) 177public static INamedTypeSymbol? ISerializableType(this Compilation compilation) 180public static INamedTypeSymbol? SerializationInfoType(this Compilation compilation) 183public static INamedTypeSymbol? StreamingContextType(this Compilation compilation) 186public static INamedTypeSymbol? OnDeserializingAttribute(this Compilation compilation) 189public static INamedTypeSymbol? OnDeserializedAttribute(this Compilation compilation) 192public static INamedTypeSymbol? OnSerializingAttribute(this Compilation compilation) 195public static INamedTypeSymbol? OnSerializedAttribute(this Compilation compilation) 198public static INamedTypeSymbol? ComRegisterFunctionAttribute(this Compilation compilation) 201public static INamedTypeSymbol? ComUnregisterFunctionAttribute(this Compilation compilation) 204public static INamedTypeSymbol? ConditionalAttribute(this Compilation compilation) 207public static INamedTypeSymbol? ObsoleteAttribute(this Compilation compilation) 210public static INamedTypeSymbol? SystemCompositionImportingConstructorAttribute(this Compilation compilation) 213public static INamedTypeSymbol? SystemComponentModelCompositionImportingConstructorAttribute(this Compilation compilation) 216public static INamedTypeSymbol? SystemIDisposableType(this Compilation compilation) 219public static INamedTypeSymbol? NotNullAttribute(this Compilation compilation) 222public static INamedTypeSymbol? MaybeNullAttribute(this Compilation compilation) 225public static INamedTypeSymbol? MaybeNullWhenAttribute(this Compilation compilation) 228public static INamedTypeSymbol? AllowNullAttribute(this Compilation compilation) 231public static INamedTypeSymbol? DisallowNullAttribute(this Compilation compilation) 234public static INamedTypeSymbol? DataMemberAttribute(this Compilation compilation) 237public static INamedTypeSymbol? DataContractAttribute(this Compilation compilation) 240public static INamedTypeSymbol? AsyncMethodBuilderAttribute(this Compilation compilation) 243public static INamedTypeSymbol? CancellationTokenType(this Compilation compilation) 246public static INamedTypeSymbol? ValueTupleType(this Compilation compilation, int arity) 249public static INamedTypeSymbol? ListOfTType(this Compilation compilation) 252public static INamedTypeSymbol? ReadOnlySpanOfTType(this Compilation compilation) 255public static INamedTypeSymbol? SpanOfTType(this Compilation compilation) 258public static INamedTypeSymbol? InterpolatedStringHandlerAttributeType(this Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (1)
113public static bool IsAsyncReturningVoidTask(this IMethodSymbol method, Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
447Compilation compilation,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
478Compilation compilation,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
14private sealed class AnonymousTypeRemover(Compilation compilation) : SymbolVisitor<ITypeSymbol>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.CompilationTypeGenerator.cs (1)
11private sealed class CompilationTypeGenerator(Compilation compilation) : ITypeGenerator
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (7)
414public static INamedTypeSymbol? GetDelegateType(this ITypeSymbol? typeSymbol, Compilation compilation) 597public static bool IsOrDerivesFromExceptionType([NotNullWhen(returnValue: true)] this ITypeSymbol? type, Compilation compilation) 769Compilation compilation, 778Compilation compilation, 787Compilation compilation) 795Compilation compilation) 819Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
15private sealed class UnavailableTypeParameterRemover(Compilation compilation, ISet<string> availableTypeParameterNames) : SymbolVisitor<ITypeSymbol>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
14private sealed class UnnamedErrorTypeRemover(Compilation compilation) : SymbolVisitor<ITypeSymbol>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
401var compilation = firstBlock.SemanticModel!.Compilation;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (1)
107ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Simplification\SymbolAnnotation.cs (2)
20public static ISymbol? GetSymbol(SyntaxAnnotation annotation, Compilation compilation) 23public static ImmutableArray<ISymbol> GetSymbols(SyntaxAnnotation annotation, Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (1)
26var compilation = reader.Compilation;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (2)
79var compilation = ((ISourceAssemblySymbol)symbol.ContainingAssembly).Compilation; 116Compilation compilation, SyntaxTree? syntaxTree,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (7)
157var compilation = ((ISourceAssemblySymbol)symbol.ContainingAssembly).Compilation; 165string symbolKey, Compilation compilation, 172string symbolKey, Compilation compilation, 179string symbolKey, Compilation compilation, bool ignoreAssemblyKey, 223Compilation compilation, bool ignoreAssemblyKey = false, CancellationToken cancellationToken = default) 231/// to the corresponding <see cref="ISymbol"/> in a future <see cref="Compilation"/>. 267private static bool Equals(Compilation compilation, string? name1, string? name2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (4)
327public Compilation Compilation { get; private set; } 357string data, Compilation compilation, 368Compilation compilation, 728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
108protected abstract bool IsReferenceConversion(Compilation model, ITypeSymbol sourceType, ITypeSymbol targetType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
19private static readonly ConditionalWeakTable<Compilation, TreeMap> s_treeAliasMap = new();
Microsoft.CodeAnalysis.CodeStyle.Fixes (84)
src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (1)
60var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (3)
437var compilation = semanticModel.Compilation; 518Compilation compilation, TypeInfo argumentTypeInfo, IParameterSymbol parameter, 535Compilation compilation, TypeInfo argumentTypeInfo, ITypeSymbol parameterType,
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
49var compilation = semanticModel.Compilation;
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
41protected abstract bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
291var compilation = semanticModel.Compilation;
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
41private static bool IsSymbolAccessible(Compilation compilation, ISymbol symbol)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (1)
113protected abstract bool IsImplicitReferenceConversion(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (3)
24Compilation compilation, 36Compilation compilation, ISet<string> availableTypeParameterNames, Project project, CancellationToken cancellationToken) : AsyncSymbolVisitor 40private readonly Compilation _compilation = compilation;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
217var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (5)
127Compilation compilation, ISymbol? throughMember, 139Compilation compilation, ISymbol member, ISymbol? throughMember, 153Compilation compilation, ISymbol member, ISymbol? throughMember, bool addUnsafe, 177Compilation compilation, IMethodSymbol method, ISymbol? throughMember, 196Compilation compilation,
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (1)
127var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (2)
219public static bool ShouldImplementDisposePattern(Compilation compilation, IImplementInterfaceInfo state, bool explicitly) 246public static IMethodSymbol? TryGetIDisposableDispose(Compilation compilation)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (5)
81var compilation = await this.Document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 107Compilation compilation, 177Compilation compilation, 278Compilation compilation, 310private ISymbol GenerateEvent(Compilation compilation, string memberName, bool generateInvisibly, SyntaxGenerator factory, DeclarationModifiers modifiers, bool useExplicitInterfaceSymbol, Accessibility accessibility, IEventSymbol @event)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (5)
50var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 118Compilation compilation, 136Compilation compilation, 187Compilation compilation, 243var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Method.cs (2)
23Compilation compilation, 50private SyntaxNode CreateStatement(Compilation compilation, IMethodSymbol method)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Property.cs (6)
29Compilation compilation, 84private static INamedTypeSymbol[] AttributesToRemove(Compilation compilation) 91Compilation compilation, 124Compilation compilation, 151Compilation compilation, 165Compilation compilation,
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
47var compilation = semanticModel.Compilation;
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
99var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (3)
43protected abstract TSwitchArmSyntax CreateSwitchArm(SyntaxGenerator generator, Compilation compilation, TMemberAccessExpression caseLabel); 44protected abstract TSwitchArmSyntax CreateNullSwitchArm(SyntaxGenerator generator, Compilation compilation); 45protected abstract TSwitchArmSyntax CreateDefaultSwitchArm(SyntaxGenerator generator, Compilation compilation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
52protected static TExpressionSyntax Exception(SyntaxGenerator generator, Compilation compilation)
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (3)
71protected sealed override TSwitchArmSyntax CreateDefaultSwitchArm(SyntaxGenerator generator, Compilation compilation) 74protected sealed override TSwitchArmSyntax CreateSwitchArm(SyntaxGenerator generator, Compilation compilation, TMemberAccessExpression caseLabel) 77protected override TSwitchArmSyntax CreateNullSwitchArm(SyntaxGenerator generator, Compilation compilation)
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
33var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 71var compilation = semanticModel.Compilation;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceSymbol.cs (1)
55public Compilation ContainingCompilation => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\KnownTypes.cs (1)
7internal readonly struct KnownTaskTypes(Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (2)
110public static async Task<Compilation> GetRequiredCompilationAsync(this Project project, CancellationToken cancellationToken) 112var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (12)
31this SyntaxGenerator codeDefinitionFactory, Compilation compilation) 38this SyntaxGenerator codeDefinitionFactory, Compilation compilation) 44private static SyntaxNode CreateNewNotImplementedException(SyntaxGenerator codeDefinitionFactory, Compilation compilation) 56this SyntaxGenerator codeDefinitionFactory, Compilation compilation) 76Compilation compilation, 87private static ITypeSymbol GetType(Compilation compilation, ISymbol symbol) 192this SyntaxGenerator generator, Compilation compilation, 216this SyntaxGenerator generator, Compilation compilation, 407this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter, SyntaxNode fieldAccess) 416public static SyntaxNode CreateThrowArgumentNullExpression(this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter) 419private static SyntaxNode CreateNewArgumentNullException(SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter) 451public static SyntaxNode CreateThrowArgumentNullExceptionStatement(this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (6)
35Compilation compilation, 49public static IMethodSymbol CreateEqualsMethod(this Compilation compilation, ImmutableArray<SyntaxNode> statements) 112Compilation compilation, 219SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, Compilation compilation, 274Compilation compilation, 323SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, Compilation compilation, ParseOptions parseOptions, SyntaxNode otherNameExpression, ArrayBuilder<SyntaxNode> expressions)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (3)
20Compilation compilation, 82Compilation compilation, 220Compilation compilation,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AbstractAddImportsService.cs (3)
31protected abstract ImmutableArray<SyntaxNode> GetGlobalImports(Compilation compilation, SyntaxGenerator generator); 55Compilation compilation, 131Compilation compilation,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\IAddImportsService.cs (3)
29bool HasExistingImport(Compilation compilation, SyntaxNode root, SyntaxNode? contextLocation, SyntaxNode import, SyntaxGenerator generator); 38Compilation compilation, SyntaxNode root, SyntaxNode? contextLocation, 45this IAddImportsService service, Compilation compilation, SyntaxNode root,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (2)
103protected static IMethodSymbol? FindDisposeMethod(Compilation compilation, ITypeSymbol? type, bool isAsync) 248public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
41protected Compilation Compilation => SemanticModel.Compilation;
Microsoft.CodeAnalysis.CSharp (80)
Binder\Binder_Conversions.cs (1)
547TryFindAsSpanCharMethod(Compilation, destination),
CommandLine\CSharpCommandLineArguments.cs (2)
13/// Gets the compilation options for the C# <see cref="Compilation"/> 19/// Gets the parse options for the C# <see cref="Compilation"/>.
CommandLine\CSharpCompiler.cs (3)
38public override Compilation? CreateCompilation( 236protected override string GetOutputFileName(Compilation compilation, CancellationToken cancellationToken) 381private protected override void DiagnoseBadAccesses(TextWriter consoleOutput, ErrorLogger? errorLogger, Compilation compilation, ImmutableArray<Diagnostic> diagnostics)
Compilation\CSharpCompilation.cs (11)
719internal override Compilation WithSemanticModelProvider(SemanticModelProvider? semanticModelProvider) 743internal override Compilation WithEventQueue(AsyncQueue<CompilationEvent>? eventQueue) 3900protected override Compilation CommonWithReferences(IEnumerable<MetadataReference> newReferences) 3905protected override Compilation CommonWithAssemblyName(string? assemblyName) 3939protected override Compilation CommonAddSyntaxTrees(IEnumerable<SyntaxTree> trees) 3944protected override Compilation CommonRemoveSyntaxTrees(IEnumerable<SyntaxTree> trees) 3949protected override Compilation CommonRemoveAllSyntaxTrees() 3954protected override Compilation CommonReplaceSyntaxTree(SyntaxTree oldTree, SyntaxTree? newTree) 3959protected override Compilation CommonWithOptions(CompilationOptions options) 3964protected override Compilation CommonWithScriptCompilationInfo(ScriptCompilationInfo? info) 3979protected override Compilation CommonClone()
Compilation\CSharpCompilationReference.cs (1)
23internal override Compilation CompilationCore
Compilation\CSharpScriptCompilationInfo.cs (2)
22internal override Compilation? CommonPreviousScriptCompilation => PreviousScriptCompilation; 27internal override ScriptCompilationInfo CommonWithPreviousScriptCompilation(Compilation? compilation) =>
Compilation\CSharpSemanticModel.cs (2)
24/// cref="Compilation.GetSemanticModel(SyntaxTree, bool)"/>. 4924protected sealed override Compilation CompilationCore
CSharpExtensions.cs (1)
438public static Conversion ClassifyConversion(this Compilation? compilation, ITypeSymbol source, ITypeSymbol destination)
Emitter\EditAndContinue\PEDeltaAssemblyBuilder.cs (6)
226Compilation.AnonymousTypeManager.GetAnonymousTypeMap(), 227Compilation.AnonymousTypeManager.GetAnonymousDelegates(), 228Compilation.AnonymousTypeManager.GetAnonymousDelegatesWithIndexedNames()); 327var exceptionType = Compilation.GetWellKnownType(WellKnownType.System_Exception); 328var stringType = Compilation.GetSpecialType(SpecialType.System_String); 329var intType = Compilation.GetSpecialType(SpecialType.System_Int32);
Emitter\Model\PEAssemblyBuilder.cs (4)
368Compilation.CheckIfAttributeShouldBeEmbedded(EmbeddableAttributes.NullablePublicOnlyAttribute, diagnostics, Location.None)) 373if (((SourceModuleSymbol)Compilation.SourceModule).RequiresRefSafetyRulesAttribute() && 374Compilation.CheckIfAttributeShouldBeEmbedded(EmbeddableAttributes.RefSafetyRulesAttribute, diagnostics, Location.None)) 466Debug.Assert(Compilation.ShouldEmitNativeIntegerAttributes());
Emitter\Model\PEModuleBuilder.cs (39)
68return (EmbeddableAttributes)_needsGeneratedAttributes | Compilation.GetNeedsGeneratedAttributes(); 93_metadataName = specifiedName != Microsoft.CodeAnalysis.Compilation.UnspecifiedModuleAssemblyName ? 117return Compilation.TrySynthesizeAttribute(attributeConstructor); 551return Compilation.AnonymousTypeManager.GetAllCreatedTemplates() 841return ((MethodSymbol)Compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_RuntimeHelpers__InitializeArrayArrayRuntimeFieldHandle))?.GetCciAdapter(); 851return (object)namedType == (object)Compilation.GetWellKnownType(WellKnownType.System_Type); 1494if ((object)Compilation.SourceModule != symbol.ContainingModule) 1505if ((object)Compilation.SourceModule != symbol.ContainingModule) 1516if ((object)Compilation.SourceModule != symbol.ContainingModule) 1527if ((object)Compilation.SourceModule != symbol.ContainingModule) 1538if ((object)Compilation.SourceModule != symbol.ContainingModule) 1554if ((object)Compilation.SourceModule != symbol.ContainingModule) 1578NamedTypeSymbol byteType = Compilation.GetSpecialType(SpecialType.System_Byte); 1599NamedTypeSymbol byteType = Compilation.GetSpecialType(SpecialType.System_Byte); 1609return Compilation.TrySynthesizeAttribute(member, arguments, isOptionalUse: true); 1614var module = Compilation.SourceModule; 1622ImmutableArray.Create(new TypedConstant(Compilation.GetSpecialType(SpecialType.System_Byte), TypedConstantKind.Primitive, value))); 1629return Compilation.TrySynthesizeAttribute(WellKnownMember.System_Runtime_CompilerServices_NullableContextAttribute__ctor, arguments, isOptionalUse: true); 1634return Compilation.TrySynthesizeAttribute(SpecialMember.System_Runtime_CompilerServices_PreserveBaseOverridesAttribute__ctor, isOptionalUse: true); 1641Debug.Assert(Compilation.ShouldEmitNativeIntegerAttributes()); 1643if ((object)Compilation.SourceModule != symbol.ContainingModule) 1662NamedTypeSymbol booleanType = Compilation.GetSpecialType(SpecialType.System_Boolean); 1676Debug.Assert(Compilation.ShouldEmitNativeIntegerAttributes()); 1680return Compilation.TrySynthesizeAttribute(member, arguments, isOptionalUse: true); 1689if ((object)Compilation.SourceModule != symbol.ContainingModule) 1702return Compilation.TrySynthesizeAttribute(member, isOptionalUse: true); 1709return Compilation.TrySynthesizeAttribute(WellKnownMember.System_Runtime_CompilerServices_RefSafetyRulesAttribute__ctor, arguments, isOptionalUse: true); 1716return Compilation.GetUsesNullableAttributes() && Compilation.EmitNullablePublicOnly; 1722return Compilation.TrySynthesizeAttribute(WellKnownMember.System_Runtime_CompilerServices_NullablePublicOnlyAttribute__ctor, arguments); 1728return Compilation.TrySynthesizeAttribute(WellKnownMember.System_Runtime_CompilerServices_IsReadOnlyAttribute__ctor); 1734return Compilation.TrySynthesizeAttribute(WellKnownMember.System_Runtime_CompilerServices_RequiresLocationAttribute__ctor); 1740return Compilation.TrySynthesizeAttribute(WellKnownMember.System_Runtime_CompilerServices_ParamCollectionAttribute__ctor); 1746return Compilation.TrySynthesizeAttribute(WellKnownMember.System_Runtime_CompilerServices_IsUnmanagedAttribute__ctor); 1752return Compilation.TrySynthesizeAttribute(WellKnownMember.System_Runtime_CompilerServices_IsByRefLikeAttribute__ctor); 1768if (Compilation.CheckIfAttributeShouldBeEmbedded(attribute, diagnosticsOpt, locationOpt)) 1806Debug.Assert(Compilation.ShouldEmitNativeIntegerAttributes()); 1857new SynthesizedPrivateImplementationDetailsType(base.GetPrivateImplClass(syntaxNodeOpt, diagnostics), SourceModule.GlobalNamespace, Compilation.ObjectType), 1923Debug.Assert(Compilation.Assembly.RuntimeSupportsInlineArrayTypes);
Errors\MessageID.cs (1)
436Compilation compilation,
Symbols\PublicModel\NamespaceSymbol.cs (1)
31Compilation INamespaceSymbol.ContainingCompilation => _underlying.ContainingCompilation;
Symbols\PublicModel\SourceAssemblySymbol.cs (1)
24Compilation ISourceAssemblySymbol.Compilation => _underlying.DeclaringCompilation;
Symbols\ReferenceManager.cs (2)
1081public override Compilation? SourceCompilation => null; 1184public override Compilation SourceCompilation => Compilation;
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (2)
1044if (!Compilation.ReportUnusedImportsInTree(alias.ExternAliasDirective!.SyntaxTree)) 1068if (Compilation.ReportUnusedImportsInTree(usingDirective.SyntaxTree))
Symbols\Symbol.cs (1)
225Compilation ISymbolInternal.DeclaringCompilation
Microsoft.CodeAnalysis.CSharp.CodeStyle (39)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (2)
17public static bool IsApplication(Compilation compilation) 26Compilation compilation,
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
37public static string? GetMainTypeName(Compilation compilation)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
60var compilation = semanticModel.Compilation;
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
54var compilation = compilationContext.Compilation;
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
37var compilation = context.Compilation;
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
33var compilation = context.Compilation;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
156var compilation = semanticModel.Compilation; 267private static bool IsIdentityOrImplicitConversion(Compilation compilation, ITypeSymbol type1, ITypeSymbol type2)
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (3)
42protected override bool SupportsReadOnlyProperties(Compilation compilation) 45protected override bool SupportsPropertyInitializer(Compilation compilation) 48protected override bool SupportsFieldExpression(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\AbstractCSharpUseCollectionExpressionDiagnosticAnalyzer.cs (2)
46protected virtual bool IsSupported(Compilation compilation) 55var compilation = context.Compilation;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
158var compilation = semanticModel.Compilation;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
41var compilation = semanticModel.Compilation;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (1)
28protected override bool IsSupported(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (4)
90var compilation = semanticModel.Compilation; 309public static bool IsConstructibleCollectionType(Compilation compilation, ITypeSymbol? type) 879var compilation = semanticModel.Compilation; 1047var compilation = semanticModel.Compilation;
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerDiagnosticAnalyzer.cs (2)
43protected override bool AreCollectionInitializersSupported(Compilation compilation) 46protected override bool AreCollectionExpressionsSupported(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (1)
43public static bool TryCreate(Compilation compilation, [NotNullWhen(true)] out InfoCache? infoCache)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
55public static bool TryCreate(Compilation compilation, [NotNullWhen(true)] out InfoCache? infoCache)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForReferenceEqualsDiagnosticAnalyzer.cs (2)
21protected override bool IsLanguageVersionSupported(Compilation compilation) 24protected override bool IsUnconstrainedGenericSupported(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (1)
35var compilation = context.Compilation;
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
57var compilation = compilationContext.Compilation;
src\Analyzers\CSharp\Analyzers\UseNullPropagation\CSharpUseNullPropagationDiagnosticAnalyzer.cs (1)
34protected override bool ShouldAnalyze(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UseObjectInitializer\CSharpUseObjectInitializerDiagnosticAnalyzer.cs (1)
32protected override bool AreObjectInitializersSupported(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
206var compilation = context.Compilation;
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
57var compilation = compilationContext.Compilation;
src\Analyzers\CSharp\Analyzers\UseThrowExpression\CSharpUseThrowExpressionDiagnosticAnalyzer.cs (1)
24protected override bool IsSupported(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
52var compilation = context.Compilation;
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
47var compilation = context.Compilation;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\CompilationExtensions.cs (1)
9public static LanguageVersion LanguageVersion(this Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
371public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
931protected override bool IsReferenceConversion(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (21)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (4)
23Compilation compilation, 67public static INamedTypeSymbol? GetIEquatableType(Compilation compilation, INamedTypeSymbol containingType) 75Compilation compilation, 1100private static bool OverridesEquals(Compilation compilation, IMethodSymbol equals, INamedTypeSymbol? equatableType)
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
156var compilation = semanticModel.Compilation;
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
182protected override bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (1)
143protected override bool IsImplicitReferenceConversion(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType)
src\Analyzers\CSharp\CodeFixes\PopulateSwitch\CSharpPopulateSwitchExpressionCodeFixProvider.cs (3)
30protected override SwitchExpressionArmSyntax CreateDefaultSwitchArm(SyntaxGenerator generator, Compilation compilation) 33protected override SwitchExpressionArmSyntax CreateSwitchArm(SyntaxGenerator generator, Compilation compilation, MemberAccessExpressionSyntax caseLabel) 36protected override SwitchExpressionArmSyntax CreateNullSwitchArm(SyntaxGenerator generator, Compilation compilation)
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
121private static bool IsFlagsEnum(ITypeSymbol type, Compilation compilation)
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
84var compilation = semanticModel.Compilation;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpAddImportsService.cs (1)
40protected override ImmutableArray<SyntaxNode> GetGlobalImports(Compilation compilation, SyntaxGenerator generator)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (8)
590invocationTypes.Any(t => Compilation.ClassifyConversion(m.ReturnType, t).IsImplicit)).ToList(); 1118static ITypeSymbol MakeNullable(ITypeSymbol symbol, Compilation compilation) 1252.Construct(Compilation.GetSpecialType(SpecialType.System_Object))); 1567var type = Compilation.CreateTupleTypeSymbol( 2239return inferredFutureUsage.Length > 0 ? inferredFutureUsage[0].InferredType : Compilation.ObjectType; 2243Compilation.CreateTupleTypeSymbol(elementTypes, elementNames))]; 2273return Compilation.CreateTupleTypeSymbol(elementTypes, elementNames, elementNullableAnnotations: GetNullableAnnotations(elementTypes)); 2358return [new TypeInferenceInfo(Compilation.GetSpecialType(SpecialType.System_Boolean))];
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (3)
CommandLineTests.cs (3)
304var comp = cmd.Compilation; 12026dir.CopyFile(typeof(Compilation).Assembly.Location); 12321var comp = csc.CreateCompilation(new StringWriter(), new TouchedFileLogger(), errorLogger: null);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (72)
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (1)
3185var compilation = await workspace.CurrentSolution.Projects.First(p => p.Name == "P3").GetCompilationAsync();
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (5)
41Func<Compilation, ISymbol> symbolMatcher, 81Func<Compilation, ISymbol> symbolMatcher, 193Func<Compilation, ISymbol> symbolMatcher, 208Func<Compilation, ISymbol> symbolMatcher, 270var compilation = compilationFactory
Semantics\SpeculationAnalyzerTests.cs (3)
527protected override Compilation CreateCompilation(SyntaxTree tree) 536protected override bool CompilationSucceeded(Compilation compilation, Stream temporaryStream) 538var langCompilation = compilation;
SymbolKey\SymbolKeyCompilationsTests.cs (32)
128var comp = (Compilation)CreateCompilation(src, assemblyName: "Test"); 155var comp = (Compilation)CreateCompilation(src, assemblyName: "Test"); 183var comp = (Compilation)CreateCompilation(src, assemblyName: "Test"); 226var compilation = (Compilation)CreateCompilation(src, assemblyName: "Test"); 460var comp1 = (Compilation)CreateCompilation(src1, assemblyName: "Test"); 461var comp2 = (Compilation)CreateCompilation(src2, assemblyName: "Test"); 543var comp1 = (Compilation)CreateCompilation(src1, assemblyName: "Test"); 544var comp2 = (Compilation)CreateCompilation(src2, assemblyName: "Test"); 568var comp1 = (Compilation)CreateCompilation(src, assemblyName: "Assembly1"); 569var comp2 = (Compilation)CreateCompilation(src, assemblyName: "Assembly2"); 590var comp1 = (Compilation)CreateCompilation(src, assemblyName: "Assembly"); 591var comp2 = (Compilation)CreateCompilation(src, assemblyName: "Assembly"); 619var compilation1 = (Compilation)CreateCompilation(src, assemblyName: "Assembly1"); 620var compilation2 = (Compilation)CreateCompilation(src, assemblyName: "Assembly2"); 663var comp1 = (Compilation)CreateCompilation(src, assemblyName: "Assembly"); 664var comp2 = (Compilation)CreateCompilation(src2, assemblyName: "Assembly");
SymbolKey\SymbolKeyErrorTypeTests.cs (3)
371private static void VerifyResolution(string source, Func<Compilation, ISymbol> symbolToResolve) 373var sourceCompilation = (Compilation)CreateCompilation(source, options: new(OutputKind.DynamicallyLinkedLibrary, allowUnsafe: true));
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (6)
64var comp2 = (Compilation)CreateCompilation(src2, [new CSharpCompilationReference(comp1)]); 234var comp20 = (Compilation)CreateEmptyCompilation(src1, [Net40.References.mscorlib]); 237var comp40 = (Compilation)CreateCompilation(src2, [comp20.EmitToImageReference()]);
SymbolKey\SymbolKeyTestBase.cs (3)
66internal static void ResolveAndVerifySymbol(ISymbol symbol1, ISymbol symbol2, Compilation compilation2, SymbolKeyComparison comparison = SymbolKeyComparison.None) 80internal static ISymbol ResolveSymbol(ISymbol originalSymbol, Compilation targetCompilation, SymbolKeyComparison comparison) 207Compilation c = compilation;
SymbolKey\SymbolKeyTests.cs (10)
46var compilation = await project.GetCompilationAsync(); 81var compilation = await project.GetCompilationAsync(); 120var compilation = await project.GetCompilationAsync(); 166var compilation = await project.GetCompilationAsync(); 254async Task<(Compilation bodyCompilation, Compilation referenceCompilation)> GetCompilationsAsync(Project bodyProject, Project referenceProject) 257Compilation bodyCompilation, referenceCompilation; 272async Task<(ISymbol bodyLocalSymbol, ISymbol referenceAssemblySymbol)> GetSymbolsAsync(Compilation bodyCompilation, Compilation referenceCompilation) 290async Task<ILocalSymbol> GetBodyLocalSymbol(Compilation bodyCompilation)
Workspaces\WorkspaceTests_EditorFeatures.cs (9)
414var compilation = await snapshot.GetProject(id1).GetCompilationAsync(); 437var compilation2 = await snapshot.GetProject(id2).GetCompilationAsync(); 465var compilation2 = await snapshot.GetProject(id2).GetCompilationAsync(); 498var compilation2 = await solutionY.GetProject(id2).GetCompilationAsync(); 517var compilation2Z = await solutionZ.GetProject(id2).GetCompilationAsync(); 552var compilation2y = await solutionY.GetProject(id2).GetCompilationAsync(); 620var compilation2y = await solutionY.GetProject(id2).GetCompilationAsync(); 651var compilation2Z = await partialDoc2Z.Project.GetCompilationAsync(); 672var compilation2Z = await doc2Z.Project.GetCompilationAsync();
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (72)
BreakingChanges.cs (3)
1417referencedCompilations: new Compilation[] { cs1Compilation }); 1424referencedCompilations: new Compilation[] { cs1Compilation, cs2Compilation }); 1437referencedCompilations: new Compilation[] { cs2Compilation, cs3Compilation });
CodeGen\CodeGenDeconstructTests.cs (2)
8583var compilation = CompileAndVerify(source, expectedOutput: @"C Convert D Convert2 A B").Compilation; 8627var compilation = CompileAndVerify(source, expectedOutput: @"1").Compilation;
CodeGen\CodeGenLocalFunctionTests.cs (3)
5744var comp = verifier.Compilation; 5819var comp = verifier.Compilation; 5894var comp = verifier.Compilation;
CodeGen\CodeGenOverridingAndHiding.cs (6)
4216referencedCompilations: new Compilation[] { vb1Compilation, cs1Compilation }); 4246referencedCompilations: new Compilation[] { vb1Compilation, cs1Compilation, vb2Compilation }); 4285referencedCompilations: new Compilation[] { vb1Compilation, cs1Compilation }); 4318referencedCompilations: new Compilation[] { vb1Compilation, cs1Compilation, vb2Compilation }); 4431referencedCompilations: new Compilation[] { vb1Compilation, cs1Compilation }); 4456referencedCompilations: new Compilation[] { vb1Compilation, cs1Compilation, vb2Compilation });
CodeGen\CodeGenTupleTest.cs (52)
6208var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, TestReferences.SymbolsTests.netModule.netModule1 }); 6599var comp = (Compilation)CreateCompilation(source); 6634var comp = (Compilation)CreateCompilation(source); 6676var comp = (Compilation)CreateCompilation(source); 6715var comp = (Compilation)CreateCompilation(source); 6756var comp = (Compilation)CreateCompilation(source); 6834var comp = (Compilation)CreateCompilation(source); 6864var comp = (Compilation)CreateCompilation(source); 6903var comp = (Compilation)CreateCompilation(source); 10956Assert.Equal("7.0", Compilation.GetRequiredLanguageVersion(comp.GetDiagnostics()[1])); 10957Assert.Equal("7.0", Compilation.GetRequiredLanguageVersion(comp.GetDiagnostics()[2])); 10958Assert.Null(Compilation.GetRequiredLanguageVersion(comp.GetDiagnostics()[3])); 10959Assert.Throws<ArgumentNullException>(() => Compilation.GetRequiredLanguageVersion(null)); 14396var comp = (Compilation)CreateCompilation(source, 18859var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18879var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18919var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp.ToMetadataReference() }); 18945var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp1.ToMetadataReference(), tupleComp2.ToMetadataReference() }); 18970var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp1.ToMetadataReference(), tupleComp2.ToMetadataReference() }); 18995var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp1.ToMetadataReference(), tupleComp2.ToMetadataReference() }); 19021var comp = (Compilation)CSharpCompilation.Create("test", references: new[] { MscorlibRef, tupleComp1.ToMetadataReference(), tupleComp2.ToMetadataReference() }); 19059var comp = (Compilation)CSharpCompilation.Create("test", syntaxTrees: new[] { tree }, references: new[] { (MetadataReference)Net40.References.mscorlib, tupleComp1.ToMetadataReference() }); 19098var comp = (Compilation)CSharpCompilation.Create("test", syntaxTrees: new[] { tree }, references: new[] { (MetadataReference)Net40.References.mscorlib, tupleComp1.ToMetadataReference() }); 19137var comp = (Compilation)CSharpCompilation.Create("test", syntaxTrees: new[] { tree }, references: new[] { MscorlibRef, tupleComp1.ToMetadataReference() }); 19176var comp = (Compilation)CSharpCompilation.Create("test", syntaxTrees: new[] { tree }, references: new[] { MscorlibRef, tupleComp1.ToMetadataReference() }); 20410var comp = (Compilation)CreateCompilation(source); 20626var comp = (Compilation)CreateCompilation(source); 20743var comp = (Compilation)CreateCompilation(source);
CodeGen\FixedSizeBufferTests.cs (1)
569var comp1 = CompileAndVerify(s1, options: TestOptions.UnsafeReleaseDll, verify: Verification.Passes).Compilation;
CodeGen\ObjectAndCollectionInitializerTests.cs (2)
1104var comp = compVerifier.Compilation; 3586var comp = verifier.Compilation;
Emit\CompilationEmitTests.cs (1)
1209Compilation comp2 = CreateCompilation(Parse(source2), options: TestOptions.DebugDll.WithDeterministic(true), assemblyName: name);
Emit\DeterministicTests.cs (1)
439var comp2 = cv.Compilation.RemoveAllSyntaxTrees().AddSyntaxTrees(trees[1], trees[0], trees[2]);
Emit\InAttributeModifierTests.cs (1)
48void verifyParameter(Compilation comp)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (8)
Emit\EditAndContinue\EditAndContinueTest.cs (1)
33protected override Compilation CreateCompilation(SyntaxTree tree)
Emit\EditAndContinue\EditAndContinueTestBase.cs (3)
44public static EmitBaseline CreateInitialBaseline(Compilation compilation, ModuleMetadata module, Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation> debugInformationProvider) 141Func<Compilation, ISymbol> symbolProvider, 142Func<Compilation, ISymbol>? newSymbolProvider = null,
PDB\CSharpDeterministicBuildCompilationTests.cs (1)
31Compilation compilation,
PDB\PDBTests.cs (3)
94Compilation compilation = CreateCompilation("class C { }", options: TestOptions.DebugDll, parseOptions: TestOptions.Regular); 111driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out _); 12964var compilerAssembly = typeof(Compilation).Assembly;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (27)
Attributes\AttributeTests_WellKnownAttributes.cs (1)
5764var compilation = verifier.Compilation;
Attributes\InternalsVisibleToAndStrongNameTests.cs (1)
588private void VerifySignedBitSetAfterEmit(Compilation comp, bool expectedToBeSigned = true)
Diagnostics\CompilationEventTests.cs (1)
149var comp = CreateCompilationWithMscorlib461(source).WithEventQueue(q);
Diagnostics\DiagnosticAnalyzerTests.cs (11)
1372private static Compilation GetCompilationWithConcurrentBuildEnabled(string source) 1398var compilation = GetCompilationWithConcurrentBuildEnabled(source); 1423var compilation = GetCompilationWithConcurrentBuildEnabled(source); 1693private static void VerifyGeneratedCodeAnalyzerDiagnostics(Compilation compilation, AnalyzerOptions analyzerOptions, Func<string, bool> isGeneratedFileName, GeneratedCodeAnalysisFlags? generatedCodeAnalysisFlagsOpt) 1699private static void VerifyGeneratedCodeAnalyzerDiagnostics(Compilation compilation, DiagnosticDescription[] expected, GeneratedCodeAnalysisFlags? generatedCodeAnalysisFlagsOpt, AnalyzerOptions analyzerOptions = null, bool testIsGeneratedCodeInCallbacks = false) 1705private static DiagnosticDescription[] GetExpectedGeneratedCodeAnalyzerDiagnostics(Compilation compilation, Func<string, bool> isGeneratedFileName, GeneratedCodeAnalysisFlags? generatedCodeAnalysisFlagsOpt) 2476static void testFieldReferenceAnalyzer_InAttributes_Core(Compilation compilation, bool doOperationBlockAnalysis) 2543private static void TestFieldReferenceAnalyzer_InConstructorInitializer_Core(Compilation compilation, bool doOperationBlockAnalysis) 2572private static void TestFieldReferenceAnalyzer_InConstructorDestructorExpressionBody_Core(Compilation compilation, bool doOperationBlockAnalysis) 4038Compilation compilation = CreateCompilation(new[] { tree }); 4056public override SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation, SemanticModelOptions options)
Diagnostics\GetDiagnosticsTests.cs (6)
169var compilation = CreateCompilationWithMscorlib461(new[] { tree1, tree2 }).WithEventQueue(eventQueue); 218var compilation = CreateCompilationWithMscorlib461(new[] { tree1, tree2 }).WithEventQueue(eventQueue); 270var compilation = CreateCompilationWithMscorlib461(new[] { tree1, tree2 }).WithEventQueue(eventQueue); 321var compilation = CreateCompilationWithMscorlib461(new[] { tree }).WithEventQueue(eventQueue); 374var compilation = CreateCompilationWithMscorlib461(CSharpTestSource.None).WithEventQueue(new AsyncQueue<CompilationEvent>()); 599static async Task verifyDiagnosticsAsync(Compilation compilation, DiagnosticAnalyzer analyzer, (string key, string value)? options)
FlowAnalysis\RegionAnalysisTests.cs (1)
5618var comp = verifier.Compilation;
RefReadonlyParameterTests.cs (1)
1443static void verifyModoptFromAssembly(Compilation comp, string assemblyName)
Semantics\PatternMatchingTestBase.cs (1)
454protected static void VerifyDecisionDagDump<T>(Compilation comp, string expectedDecisionDag, int index = 0)
Semantics\RecordTests.cs (4)
14671var comp = verifier.Compilation; 14720var comp = verifier.Compilation; 14776var comp = verifier.Compilation; 14853var comp = verifier.Compilation;
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
EndToEndTests.cs (1)
797Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions);
Microsoft.CodeAnalysis.CSharp.Features (74)
AddImport\CSharpAddImportFeatureService.cs (1)
392var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
190private static ITypeSymbol? GetDelegateType(TypeInferenceInfo typeInferenceInfo, Compilation compilation)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (2)
100private (ITypeSymbol, bool plural) UnwrapType(ITypeSymbol type, Compilation compilation, bool wasPlural, HashSet<ITypeSymbol> seenTypes) 174private bool LooksLikeWellKnownCollectionType(Compilation compilation, string name)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
319private static INamedTypeSymbol? TryGetCompletionListType(ITypeSymbol type, INamedTypeSymbol? within, Compilation compilation)
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
71var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
ConvertToInterpolatedString\CSharpConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
24protected override bool SupportsInterpolatedStringHandler(Compilation compilation)
DecompiledSource\CSharpDecompiledSourceService.cs (1)
31public async Task<Document?> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, MetadataReference? metadataReference, string? assemblyLocation, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken)
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (3)
40var compilation = semanticModel.Compilation; 114var compilation = semanticModel.Compilation; 119var compilationWithTestFile = compilation.RemoveAllSyntaxTrees().AddSyntaxTrees(testFileTree);
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
30Compilation compilation,
GenerateType\CSharpGenerateTypeService.cs (1)
564protected override bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType)
InitializeParameter\CSharpAddParameterCheckCodeRefactoringProvider.cs (1)
45protected override bool IsImplicitConversion(Compilation compilation, ITypeSymbol source, ITypeSymbol destination)
InitializeParameter\CSharpInitializeMemberFromParameterCodeRefactoringProvider.cs (1)
44protected override bool IsImplicitConversion(Compilation compilation, ITypeSymbol source, ITypeSymbol destination)
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
274Compilation compilation,
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (1)
141Compilation compilation, IParameterSymbol parameter, CancellationToken cancellationToken) where TSymbol : class, ISymbol
InitializeParameter\InitializeParameterHelpers.cs (2)
49public static bool IsImplicitConversion(Compilation compilation, ITypeSymbol source, ITypeSymbol destination) 198public static bool IsThrowNotImplementedProperty(Compilation compilation, IPropertySymbol property, CancellationToken cancellationToken)
MetadataAsSource\CSharpMetadataAsSourceService.cs (1)
37protected override async Task<Document> AddAssemblyInfoRegionAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken)
SemanticSearch\CSharpSemanticSearchService.cs (1)
23protected override Compilation CreateCompilation(
Snippets\AbstractCSharpForLoopSnippetProvider.cs (2)
48var compilation = semanticModel.Compilation; 69static (TypeSyntax iteratorTypeSyntax, SyntaxNode? inlineExpression) GetLoopHeaderParts(SyntaxGenerator generator, InlineExpressionInfo? inlineExpressionInfo, Compilation compilation)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (2)
17public static bool IsApplication(Compilation compilation) 26Compilation compilation,
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
37public static string? GetMainTypeName(Compilation compilation)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
60var compilation = semanticModel.Compilation;
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
54var compilation = compilationContext.Compilation;
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
37var compilation = context.Compilation;
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
33var compilation = context.Compilation;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
156var compilation = semanticModel.Compilation; 267private static bool IsIdentityOrImplicitConversion(Compilation compilation, ITypeSymbol type1, ITypeSymbol type2)
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (3)
42protected override bool SupportsReadOnlyProperties(Compilation compilation) 45protected override bool SupportsPropertyInitializer(Compilation compilation) 48protected override bool SupportsFieldExpression(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\AbstractCSharpUseCollectionExpressionDiagnosticAnalyzer.cs (2)
46protected virtual bool IsSupported(Compilation compilation) 55var compilation = context.Compilation;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
158var compilation = semanticModel.Compilation;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
41var compilation = semanticModel.Compilation;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (1)
28protected override bool IsSupported(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (4)
90var compilation = semanticModel.Compilation; 309public static bool IsConstructibleCollectionType(Compilation compilation, ITypeSymbol? type) 879var compilation = semanticModel.Compilation; 1047var compilation = semanticModel.Compilation;
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerDiagnosticAnalyzer.cs (2)
43protected override bool AreCollectionInitializersSupported(Compilation compilation) 46protected override bool AreCollectionExpressionsSupported(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (1)
43public static bool TryCreate(Compilation compilation, [NotNullWhen(true)] out InfoCache? infoCache)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
55public static bool TryCreate(Compilation compilation, [NotNullWhen(true)] out InfoCache? infoCache)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForReferenceEqualsDiagnosticAnalyzer.cs (2)
21protected override bool IsLanguageVersionSupported(Compilation compilation) 24protected override bool IsUnconstrainedGenericSupported(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (1)
35var compilation = context.Compilation;
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
57var compilation = compilationContext.Compilation;
src\Analyzers\CSharp\Analyzers\UseNullPropagation\CSharpUseNullPropagationDiagnosticAnalyzer.cs (1)
34protected override bool ShouldAnalyze(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UseObjectInitializer\CSharpUseObjectInitializerDiagnosticAnalyzer.cs (1)
32protected override bool AreObjectInitializersSupported(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
206var compilation = context.Compilation;
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
57var compilation = compilationContext.Compilation;
src\Analyzers\CSharp\Analyzers\UseThrowExpression\CSharpUseThrowExpressionDiagnosticAnalyzer.cs (1)
24protected override bool IsSupported(Compilation compilation)
src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
52var compilation = context.Compilation;
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
47var compilation = context.Compilation;
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (4)
23Compilation compilation, 67public static INamedTypeSymbol? GetIEquatableType(Compilation compilation, INamedTypeSymbol containingType) 75Compilation compilation, 1100private static bool OverridesEquals(Compilation compilation, IMethodSymbol equals, INamedTypeSymbol? equatableType)
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
156var compilation = semanticModel.Compilation;
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (1)
182protected override bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (1)
143protected override bool IsImplicitReferenceConversion(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType)
src\Analyzers\CSharp\CodeFixes\PopulateSwitch\CSharpPopulateSwitchExpressionCodeFixProvider.cs (3)
30protected override SwitchExpressionArmSyntax CreateDefaultSwitchArm(SyntaxGenerator generator, Compilation compilation) 33protected override SwitchExpressionArmSyntax CreateSwitchArm(SyntaxGenerator generator, Compilation compilation, MemberAccessExpressionSyntax caseLabel) 36protected override SwitchExpressionArmSyntax CreateNullSwitchArm(SyntaxGenerator generator, Compilation compilation)
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
121private static bool IsFlagsEnum(ITypeSymbol type, Compilation compilation)
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
84var compilation = semanticModel.Compilation;
UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (2)
45private static bool SupportsReadOnlyProperties(Compilation compilation) 81Compilation compilation,
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
220var updatedCompilation = semanticModel.Compilation.ReplaceSyntaxTree(
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (4)
EditAndContinue\Helpers\EditingTestBase.cs (4)
108internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, SyntaxMapDescription.Mapping? syntaxMap, IEnumerable<RuntimeRudeEditDescription>? rudeEdits = null, string? partialType = null) 111internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, IEnumerable<(TextSpan, TextSpan)>? syntaxMap, IEnumerable<RuntimeRudeEditDescription>? rudeEdits = null, string? partialType = null) 114internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, string? partialType = null, bool preserveLocalVariables = false, Func<Compilation, ISymbol>? deletedSymbolContainerProvider = null)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (4)
IOperation\IOperationTests_IArgument.cs (3)
4136private readonly Compilation _compilation; 4138private IndexerAccessArgumentVerifier(Compilation compilation) 4143public static void Verify(IOperation operation, Compilation compilation, SyntaxNode syntaxNode)
IOperation\IOperationTests_IConversionExpression.cs (1)
5377public void Verify(IOperation variableDeclaration, Compilation compilation, SyntaxNode syntaxNode)
Microsoft.CodeAnalysis.CSharp.Scripting (1)
CSharpScriptCompiler.cs (1)
33public override Compilation CreateSubmission(Script script)
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (4)
InteractiveSessionReferencesTests.cs (4)
502var c0 = s0.Script.GetCompilation(); 538var c0 = s0.Script.GetCompilation(); 638var c4 = s4.Script.GetCompilation(); 696var c4 = s4.Script.GetCompilation();
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (19)
CommandLineRunnerTests.cs (4)
793var libBase1 = TestCompilationFactory.CreateCSharpCompilation(@" 800var libBase2 = TestCompilationFactory.CreateCSharpCompilation(@" 807var lib1 = TestCompilationFactory.CreateCSharpCompilation(@" 814var lib2 = TestCompilationFactory.CreateCSharpCompilation(@"
InteractiveSessionTests.cs (9)
477var compilation1 = state1.Result.Script.GetCompilation(); 486var compilation2 = state2.Result.Script.GetCompilation(); 497var compilation3 = state3.Result.Script.GetCompilation(); 505INamedTypeSymbol lookupType(Compilation c, string name) 509ISymbol lookupMember(Compilation c, string typeName, string memberName) 1178var compilation = script.GetCompilation(); 1641var scriptCompilation = CSharpScript.Create( 1698var scriptCompilation = CSharpScript.Create( 1766var scriptCompilation = CSharpScript.Create(
ScriptTests.cs (6)
66var compilation = state.Script.GetCompilation(); 74var compilation = state.Script.GetCompilation(); 87var compilation = script.GetCompilation(); 956var compilation = script.GetCompilation(); 970var compilation = script.GetCompilation(); 992var compilation = script.GetCompilation();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (361)
Semantics\AccessCheckTests.cs (13)
698Compilation c = CreateCompilation(@" 736Compilation compilation = c; 855Compilation otherC = CreateCompilation(@" 867Compilation c1 = CreateCompilation(@" 894Compilation compilation1 = c1; 931Compilation c2 = CreateCompilation(@" 938Compilation c3 = CreateCompilation(@" 944Compilation compilation3 = c3; 956Compilation compilation = c; 969var c2 = ((Compilation)c).GlobalNamespace.GetMembers("C").OfType<INamedTypeSymbol>().Single(); 973classQ = ((Compilation)c).GlobalNamespace.GetMembers("Q").OfType<INamedTypeSymbol>().Single(); 1525Assert.Throws<ArgumentException>(() => ((Compilation)comp2).IsSymbolAccessibleWithin(ptr1, b)); 1526Assert.Throws<ArgumentException>(() => ((Compilation)comp2).IsSymbolAccessibleWithin(ptr2, b));
Semantics\FunctionPointerTests.cs (1)
208static void assertResult(SemanticModel model, ExpressionSyntax initializer1, Compilation comp)
Semantics\InitOnlyMemberTests.cs (2)
4380var s = ((Compilation)comp).GetTypeByMetadataName("S"); 4403var s = ((Compilation)comp).GetTypeByMetadataName("S");
Semantics\InteractiveUsingTests.cs (9)
80var sub = (Compilation)CreateSubmission(source); 113var typeSymbol = ((Compilation)sub3).ScriptClass.GetMember("C"); 193Assert.Equal(((Compilation)sub3).ScriptClass, GetSpeculativeType(sub3, "A").ContainingType); 212var sub = (Compilation)CreateSubmission(source); 232var typeSymbol = ((Compilation)sub3).ScriptClass.GetMember("C"); 580private static ISymbol GetSpeculativeSymbol(Compilation comp, string name) 590private static ITypeSymbol GetSpeculativeType(Compilation comp, string name)
Semantics\InterpolationTests.cs (1)
8425var verifier = base.CompileAndVerify((Compilation)comp, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: expectedOutput);
Semantics\LocalFunctionTests.cs (6)
392var comp = (Compilation)CreateCompilation(tree); 1739var comp = (Compilation)CreateCompilation(@" 1814var comp = (Compilation)CreateCompilation(@"
Semantics\NativeIntegerTests.cs (3)
1619static void verifyPublicType(Compilation comp, bool signed) 1662VerifyErrorType(((Compilation)comp).CreateNativeIntegerTypeSymbol(signed: true), SpecialType.System_IntPtr, isNativeInt: true); 1663VerifyErrorType(((Compilation)comp).CreateNativeIntegerTypeSymbol(signed: false), SpecialType.System_UIntPtr, isNativeInt: true);
Semantics\RawInterpolationTests_Handler.cs (1)
6604var verifier = base.CompileAndVerify((Compilation)comp, sourceSymbolValidator: validator, symbolValidator: validator, expectedOutput: expectedOutput);
Semantics\ReadOnlyStructsTests.cs (2)
1189Compilation comp = CreateCompilation(csharp); 1262Compilation comp = CreateCompilation(csharp);
Semantics\StructConstructorTests.cs (2)
4833((Compilation)comp).GlobalNamespace.GetTypeMember("S"), 4875((Compilation)comp).GlobalNamespace.GetTypeMember("S"),
Semantics\TopLevelStatementsTests.cs (15)
1678var getHashCode = ((Compilation)comp).GetMember("System.Object." + nameof(GetHashCode)); 1679var testType = ((Compilation)comp).GetTypeByMetadataName("Test"); 1851var getHashCode = ((Compilation)comp).GetMember("System.Object." + nameof(GetHashCode)); 1852var testType = ((Compilation)comp).GetTypeByMetadataName("Test"); 2078var testType = ((Compilation)comp).GetTypeByMetadataName("Test"); 2242var testType = ((Compilation)comp).GetTypeByMetadataName("Test"); 2420var testType = ((Compilation)comp).GetTypeByMetadataName("Test"); 3935var testType = ((Compilation)comp).GetTypeByMetadataName("args"); 4084var testType = ((Compilation)comp).GetTypeByMetadataName("args"); 6083var comp = verifier.Compilation; 6155var comp = verifier.Compilation; 6230var a = ((Compilation)comp).SourceModule.GlobalNamespace.GetTypeMember("A"); 6274var a = ((Compilation)comp).SourceModule.GlobalNamespace.GetTypeMember("A"); 6314var a = ((Compilation)comp).SourceModule.GlobalNamespace.GetTypeMember("A"); 6364var a = ((Compilation)comp).SourceModule.GlobalNamespace.GetTypeMember("A");
Semantics\UnsafeTests.cs (3)
12412var comp1 = CompileAndVerify(s1, options: TestOptions.UnsafeReleaseDll, verify: Verification.Passes).Compilation; 12414var comp2 = CompileAndVerify(s2, 12465var comp3 = CompileAndVerify(s3,
SourceGeneration\GeneratorDriverTests.cs (155)
35Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 41driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var diagnostics); 55Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 64driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var diagnostics); 77Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 98Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 107driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out _); 127Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 135driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out _); 158Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 167driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out _); 217Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 225driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation1, out _); 226driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation2, out _); 227driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation3, out _); 249Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 261driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 274Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 284driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 297Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 306driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out _); 318Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 328driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 341Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 352driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 371Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 385driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 402Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 412driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 428Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 439driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 454Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 470driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 483Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 509driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 522Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 530driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 582Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 612Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 657Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 704Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 739Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 764driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics, cts.Token) 776Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 798Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 823Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 851Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 882Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 895driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out _); 908Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 922driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out _); 935Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 950driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out _); 963Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 981driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out _); 995Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1009driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 1024Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1044driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 1059Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1086Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1131Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1158Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1204var updatedCompilation = compilation.WithOptions(options); 1206driver.RunGeneratorsAndUpdateCompilation(updatedCompilation, out var outputCompilation, out var diagnostics); 1257Compilation compilation = CreateCompilation(source, sourceFileName: "sourcefile.cs", options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1277driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var diagnostics); 1372driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var diagnostics); 1385Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1420Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1442Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1467Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1493Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1535Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1564Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1597Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1605driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var diagnostics); 1618Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1626driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var diagnostics); 1680Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1724Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1831var newCompilation = compilation.WithOptions(compilation.Options.WithModuleName("newComp")); 1943Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1948List<Compilation> compilationsCalledFor = new List<Compilation>(); 1952var compilationSource = ctx.CompilationProvider.WithComparer(new LambdaComparer<Compilation>((c1, c2) => true, 0)); 1966Compilation newCompilation = compilation.WithOptions(compilation.Options.WithModuleName("newCompilation")); 1979Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1990.WithComparer(new LambdaComparer<(Compilation, ImmutableArray<AdditionalText>)>((c1, c2) => c1.Item1 == c2.Item1, 0)) 2021var value = ((Compilation, ImmutableArray<AdditionalText>))output.Value; 2050var value = ((Compilation, ImmutableArray<AdditionalText>))output.Value; 2065var value = ((Compilation, ImmutableArray<AdditionalText>))source.Source.Outputs[source.OutputIndex].Value; 2073var value = ((Compilation, ImmutableArray<AdditionalText>))output.Value; 2081Compilation newCompilation = compilation.WithOptions(compilation.Options.WithModuleName("newCompilation")); 2102var value = ((Compilation, ImmutableArray<AdditionalText>))output.Value; 2135Compilation compilation = CreateCompilation(source, options: TestOptions.DebugExeThrowing, parseOptions: parseOptions); 2157static void verify(ref GeneratorDriver driver, Compilation compilation, string generatedContent) 2159driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 2166static void replace(ref Compilation compilation, CSharpParseOptions parseOptions, string source) 2194Compilation compilation = CreateCompilation(source, options: TestOptions.DebugExeThrowing, parseOptions: parseOptions); 2215static void verify(ref GeneratorDriver driver, Compilation compilation, string[] generatedContent) 2217driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 2228static void replace(ref Compilation compilation, CSharpParseOptions parseOptions, string source) 2241Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 2246List<Compilation> compilationsCalledFor = new List<Compilation>(); 2303Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugExeThrowing, parseOptions: parseOptions); 2358static void verify(ref GeneratorDriver driver, Compilation compilation, string[] generatedContent) 2360driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 2371static void replace(ref Compilation compilation, CSharpParseOptions parseOptions, string source) 2384Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 2432var c2 = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.First(), CSharpSyntaxTree.ParseText("class E{}", parseOptions)); 2456Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 2484Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 2547Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 2558IncrementalValueProvider<(Compilation, ImmutableArray<ClassDeclarationSyntax>)> compilationAndClasses = 2577Compilation newCompilation = CreateCompilation(newSource, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 2584static void validate(Compilation compilation, ImmutableArray<ClassDeclarationSyntax> nodes) 2613Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 2697Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 2884Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 3079Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 3145Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 3191Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 3227Compilation compilation = CreateEmptyCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions, references: metadataRefs); 3279Compilation compilation = CreateCompilation(builder.ToString(), options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 3305Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 3338Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 3384Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 3412Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 3443Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 3491Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 3535Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 3566Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 3610Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 3642Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 3676Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 3705Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 3736Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions, sourceFileName: "/original"); 3768Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions, sourceFileName: "/original"); 3801Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions, sourceFileName: "/original"); 3830Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions, sourceFileName: "/original"); 3860Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 3892Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 3925Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing); 3971Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing); 4006Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 4076Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 4094static void verify(ref GeneratorDriver driver, Compilation compilation) 4096driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 4101static void replace(ref Compilation compilation, CSharpParseOptions parseOptions, string className, string source) 4170Compilation compilation = CreateCompilation([source1], options: TestOptions.DebugExe, parseOptions: parseOptions); 4179void verify(ref GeneratorDriver driver, Compilation compilation) 4181driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 4358driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics);
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (47)
68Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 110Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 147Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 177Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 207Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 236Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 263Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 291Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 320Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 356Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 395Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 424Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 457Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 490Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 522Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 554Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 585Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 616Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 649Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 680Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 709Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 743Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 772Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 809Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 846Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 883Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 920Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 957Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 993Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1020Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1057Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1095Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1133Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1171Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1209Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1263Compilation compilation = CreateCompilation(new[] { source1, source2 }, new[] { comp0 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1289static void verify(ref GeneratorDriver driver, Compilation compilation, params (string HintName, string SourceText)[] expectedGeneratedSources) 1291driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 1297static void replace(ref Compilation compilation, CSharpParseOptions parseOptions, string className, string source) 1414Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1461Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1508Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1551Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1599Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1654Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1711Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1765Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions);
SourceGeneration\GeneratorDriverTests_Attributes_SimpleName.cs (46)
39Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 71Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 97Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 122Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 147Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 175Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 207Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 239Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 273Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 306Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 332Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 358Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 384Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 417Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 445Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 473Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 500Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 531Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 564Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 596Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 628Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 656Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 684Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 712Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 741Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 768Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 795Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 826Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 858Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 887Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 915Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 943Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 972Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1002Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1042Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1090Compilation compilation = CreateCompilation(new[] { source1, source2, source3 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1143Compilation compilation = CreateCompilation(new[] { source1, source2, source3 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1194Compilation compilation = CreateCompilation(new[] { source1, source2, source3 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1249Compilation compilation = CreateCompilation(new[] { source1, source2, source3 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1302Compilation compilation = CreateCompilation(new[] { source1, source2, source3 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1360Compilation compilation = CreateCompilation(new[] { source0, source1, source2, source3 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1408Compilation compilation = CreateCompilation(new[] { source2, source3 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1453Compilation compilation = CreateCompilation(new[] { source3 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1504Compilation compilation = CreateCompilation(new[] { source1, source2, source3 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1555Compilation compilation = CreateCompilation(new[] { source1, source2, source3 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions); 1616Compilation compilation = CreateCompilation(new[] { source1, source2, source3 }, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions);
SourceGeneration\SyntaxAwareGeneratorTests.cs (55)
33Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 59Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 72driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out _); 84Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 110Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 123driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out _); 135Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 162Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 234Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 273Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 314Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 370Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 382driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics); 412Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 424driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics); 454Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDll, parseOptions: parseOptions); 472driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics); 496Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 514driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics); 550Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 563driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics); 580Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 594driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics); 618Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 635driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics); 672Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 729Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 772Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 817Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 831driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics); 852Compilation compilation = CreateCompilation(source1, options: TestOptions.DebugDll, parseOptions: parseOptions); 892Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDll, parseOptions: parseOptions); 934Compilation compilation = CreateCompilation(source1, options: TestOptions.DebugDll, parseOptions: parseOptions); 1011Compilation compilation = CreateCompilation(source1, options: TestOptions.DebugDll, parseOptions: parseOptions); 1086Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDll, parseOptions: parseOptions); 1167Compilation compilation = CreateCompilation(new[] { source1, source2 }, options: TestOptions.DebugDll, parseOptions: parseOptions); 1217Compilation compilation = CreateCompilation(new[] { source1, source2, source3 }, options: TestOptions.DebugDll, parseOptions: parseOptions); 1300Compilation compilation = CreateCompilation(new[] { source1, source2, source3 }, options: TestOptions.DebugDll, parseOptions: parseOptions); 1377Compilation compilation = CreateCompilation(new[] { source1, source2, source3 }, options: TestOptions.DebugDll, parseOptions: parseOptions); 1510Compilation compilation = CreateCompilation(source1, options: TestOptions.DebugDll, parseOptions: parseOptions); 1565Compilation compilation = CreateCompilation(source1, options: TestOptions.DebugDll, parseOptions: parseOptions); 1614Compilation compilation = CreateCompilation(source1, options: TestOptions.DebugDll, parseOptions: parseOptions); 1675Compilation compilation = CreateCompilation(source1, options: TestOptions.DebugDll, parseOptions: parseOptions); 1734Compilation compilation = CreateCompilation(source1, options: TestOptions.DebugDll, parseOptions: parseOptions); 1787Compilation compilation = CreateCompilation(source1, options: TestOptions.DebugDll, parseOptions: parseOptions); 1850Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 1862driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics); 1891Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 1903driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics); 1932Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 1949driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var outputDiagnostics); 1981Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 2007Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 2045Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: parseOptions); 2079Compilation compilation = CreateCompilation(source, options: TestOptions.DebugDll);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (451)
Compilation\CompilationAPITests.cs (32)
2460var comp = (Compilation)CSharpCompilation.Create(""); 2489var comp = (Compilation)CSharpCompilation.Create(""); 2517var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2529var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2541var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2553var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2595var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2605var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2620var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2641var compilation = (Compilation)CSharpCompilation.Create("HelloWorld"); 2657var comp = (Compilation)CSharpCompilation.Create(""); 2687var comp = (Compilation)CSharpCompilation.Create(""); 2697var comp = (Compilation)CSharpCompilation.Create(""); 3030var comp = (Compilation)CreateCompilation(source); 3065var comp = (Compilation)CreateCompilation(source); 3644var type = ((Compilation)current).GetTypeByMetadataName("C"); 3672var type = ((Compilation)current).GetTypeByMetadataName("C");
Compilation\ForEachStatementInfoTests.cs (2)
20var c = (Compilation)CreateCompilation(@"
Compilation\GetSemanticInfoBrokenCodeTests.cs (2)
241var comp = (Compilation)CreateCompilation(source);
Compilation\GetSemanticInfoTests.cs (72)
371var comp = (Compilation)CreateCompilation(tree); 1022var comp = (Compilation)CreateCompilation(tree); 1263var comp = (Compilation)CreateCompilation(tree); 1291var comp = (Compilation)CreateCompilation(tree); 1319var comp = (Compilation)CreateCompilation(tree); 1346var comp = (Compilation)CreateCompilation(tree); 1385return GetSystemActionType((Compilation)comp); 1388private static INamedTypeSymbol GetSystemActionType(Compilation comp) 1602var comp = (Compilation)CreateCompilation(tree); 2219var comp = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(new[] { tree }); 2717var comp = (Compilation)CreateCompilation(tree); 2788var comp = (Compilation)CreateCompilation(tree); 2834var comp = (Compilation)CreateCompilation(tree); 2924var comp = (Compilation)CreateCompilationWithILAndMscorlib40(text, il); 3016var comp = (Compilation)CreateCompilationWithILAndMscorlib40(text, il); 3091var comp = (Compilation)CreateCompilation(tree); 3165var comp = (Compilation)CreateCompilation(tree); 3240var comp = (Compilation)CreateCompilation(tree); 3324var comp = (Compilation)CreateCompilation(tree); 3390var comp = (Compilation)CreateCompilation(tree); 3781var compilation = (Compilation)CreateCompilation(text); 3842var compilation = (Compilation)CreateCompilation(text); 3908var compilation = (Compilation)CreateCompilation(source2, new[] { reference1 }, assemblyName: "SpeculativelyBindPropertyGroup"); 4032var comp = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(source); 4426var compilation = (Compilation)CreateCompilation(text); 4480var compilation = (Compilation)CreateCompilation(text); 4526var compilation = (Compilation)CreateCompilation(text); 4670var comp = (Compilation)CreateCompilation(source); 4715var comp = (Compilation)CreateCompilation(source); 5398var compilation = (Compilation)CreateCompilation(text); 5517var comp = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(source); 5531var comp = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(source); 5573var comp = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(source); 5614var comp = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(source); 5658var comp = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(source); 5711var comp = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(source); 5946var comp = (Compilation)CreateCompilation(source);
Compilation\QueryClauseInfoTests.cs (2)
20var c = (Compilation)CreateCompilation("");
Compilation\SemanticModelAPITests.cs (29)
583var comp = (Compilation)CreateCompilation(tree); 606var comp = (Compilation)CreateCompilation(tree); 671var compilation = (Compilation)CreateCompilation(tree1); 699var compilation = (Compilation)CreateCompilation(new SyntaxTree[] { tree1, tree2 }); 722var comp = (Compilation)CreateCompilation(tree); 748var comp = (Compilation)CreateCompilation(tree); 814var comp = (Compilation)CreateCompilation(tree); 866var comp = (Compilation)CreateCompilation(tree); 1228var comp = (Compilation)CreateCompilation(source); 1355var comp = (Compilation)CreateCompilation(source); 1670private static void TestExpressionBodySpeculation(Compilation compilation, SyntaxTree tree, ArrowExpressionClauseSyntax expressionBody) 1714var comp = (Compilation)CreateCompilation(source); 2066var comp = (Compilation)CreateCompilation(source); 3736var comp = (Compilation)CreateCompilation(source); 3901var comp = (Compilation)CreateCompilation(source, options: TestOptions.ReleaseExe);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (42)
1677var compilation = (Compilation)CreateCompilation( 1798var compilation = (Compilation)CreateCompilation( 1925var compilation = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(source); 2771var compilation = (Compilation)CreateCompilation(@" 2894var compilation = (Compilation)CreateCompilation(@" 2927var compilation = (Compilation)CreateCompilation(@" 2949var compilation = (Compilation)CreateCompilation(@" 3008var compilation = (Compilation)CreateCompilation(@" 3061var compilation = (Compilation)CreateCompilation(@" 3102var comp = (Compilation)CSharpCompilation.Create( 3136var compilation = (Compilation)CreateCompilation(text1); 3224var compilation = (Compilation)CreateCompilation(@" 3720var compilation = (Compilation)CreateEmptyCompilation(new string[] { 3990var compilation = (Compilation)CreateCompilation(source); 4080var compilation = (Compilation)CreateCompilation(source); 4432var compilation = (Compilation)CreateCompilation(source); 4463var compilation = (Compilation)CreateCompilation(source); 4494var compilation = (Compilation)CreateCompilation(source); 4525var compilation = (Compilation)CreateCompilation(text); 4562var compilation = (Compilation)CreateCompilation(text); 4650var compilation = (Compilation)CreateCompilation(text);
Compilation\SemanticModelGetSemanticInfoTests.cs (9)
1111var compilation = (Compilation)CreateCompilation(source: sourceCode); 1145compilation = (Compilation)CreateCompilation(source: sourceCode); 1175compilation = (Compilation)CreateCompilation(source: sourceCode); 1205compilation = (Compilation)CreateCompilation(source: sourceCode); 1231compilation = (Compilation)CreateCompilation(source: sourceCode); 1258compilation = (Compilation)CreateCompilation(source: sourceCode); 1286compilation = (Compilation)CreateCompilation(source: sourceCode); 1313compilation = (Compilation)CreateCompilation(source: sourceCode);
Compilation\UsedAssembliesTests.cs (58)
76Compilation comp2 = AssertUsedAssemblyReferences(source2, reference); 81private void AssertUsedAssemblyReferences(Compilation comp, MetadataReference[] expected, DiagnosticDescription[] before, DiagnosticDescription[] after, MetadataReference[] specificReferencesToAssert) 88void assertUsedAssemblyReferences(Compilation comp, MetadataReference[] expected, DiagnosticDescription[] before, DiagnosticDescription[] after, MetadataReference[] specificReferencesToAssert) 107var comp2 = comp.RemoveAllReferences().AddReferences(used.Concat(comp.References.Where(r => r.Properties.Kind == MetadataImageKind.Module))); 120var comp3 = comp.RemoveReferences(reference); 133private static IEnumerable<(Compilation comp, DiagnosticDescription[] before, DiagnosticDescription[] after)> CloneCompilationsWithUsings(Compilation comp, DiagnosticDescription[] before, DiagnosticDescription[] after) 243private void AssertUsedAssemblyReferences(Compilation comp, params MetadataReference[] expected) 248private void AssertUsedAssemblyReferences(Compilation comp, MetadataReference[] expected, MetadataReference[] specificReferencesToAssert) 253private Compilation AssertUsedAssemblyReferences(string source, MetadataReference[] references, params MetadataReference[] expected) 256private Compilation AssertUsedAssemblyReferences(string source, MetadataReference[] references, MetadataReference[] expected, CSharpParseOptions parseOptions, CSharpCompilationOptions options = null) 258Compilation comp = CreateCompilation(source, parseOptions: parseOptions, references: references, options: options); 263private Compilation AssertUsedAssemblyReferences(string source, params MetadataReference[] references) 270Compilation comp = CreateCompilation(source, references: references); 277static void assertUsedAssemblyReferences(Compilation comp, params DiagnosticDescription[] expected) 297Compilation comp = CreateEmptyCompilation(source, 304private ImmutableArray<MetadataReference> CompileWithUsedAssemblyReferences(Compilation comp, string expectedOutput = null, MetadataReference[] specificReferencesToAssert = null) 324ImmutableArray<MetadataReference> compileWithUsedAssemblyReferences(Compilation comp, string expectedOutput = null, MetadataReference[] specificReferencesToAssert = null) 338var comp3 = comp.RemoveReferences(reference); 344var comp2 = comp.RemoveAllReferences().AddReferences(used.Concat(comp.References.Where(r => r.Properties.Kind == MetadataImageKind.Module))); 403Compilation comp2 = CreateEmptyCompilation(source2, references: new[] { reference, SystemCoreRef, SystemDrawingRef }, parseOptions: parseOptions); 437Compilation comp2 = CreateEmptyCompilation(source2, references: new[] { reference, SystemCoreRef, SystemDrawingRef }, parseOptions: parseOptions); 489Compilation comp2 = AssertUsedAssemblyReferences(source2, reference); 560Compilation comp2 = AssertUsedAssemblyReferences(source2, reference0, reference1); 602var comp2 = verify2<SourceAssemblySymbol>(source2, comp0Ref, comp1Ref); 656Compilation verify2<TAssemblySymbol>(string source2, MetadataReference reference0, MetadataReference reference1) where TAssemblySymbol : AssemblySymbol 658var comp2 = AssertUsedAssemblyReferences(source2, new[] { reference0, reference1 }, reference0); 665Compilation comp3 = AssertUsedAssemblyReferences(source3, references: references); 1097Compilation comp2 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.None)); 1102Compilation comp3 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)); 1105Compilation comp4 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Diagnose)); 1382Compilation comp2 = AssertUsedAssemblyReferences(source2, reference); 2004Compilation comp2 = AssertUsedAssemblyReferences(source2, reference); 2317Compilation comp = CreateCompilation(source, references: new[] { reference }); 2324static void verify(Compilation comp, params DiagnosticDescription[] expected) 2439var comp1 = AssertUsedAssemblyReferences(source1, references: new[] { comp0Ref }); 2471Compilation comp2 = AssertUsedAssemblyReferences(source2, new[] { reference0, reference1 }, reference1); 2506var comp1 = AssertUsedAssemblyReferences(source1, references: new[] { comp0Ref }); 2594var comp1 = AssertUsedAssemblyReferences(source1, references: new[] { comp0Ref }); 2682var comp1 = AssertUsedAssemblyReferences(source1, references: new[] { comp0Ref }); 2767var comp1 = AssertUsedAssemblyReferences(source1, references: new[] { comp0Ref }); 2855var comp1 = AssertUsedAssemblyReferences(source1, references: new[] { comp0Ref }); 2943var comp1 = AssertUsedAssemblyReferences(source1, references: new[] { comp0Ref }); 3034var comp1 = AssertUsedAssemblyReferences(source1, references: new[] { comp0Ref }); 3344var comp1 = AssertUsedAssemblyReferences(source1, references: new[] { comp0Ref }); 3692Compilation comp = CreateCompilation(source, parseOptions: TestOptions.Regular11, references: references); 3834Compilation comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview, references: references, options: TestOptions.UnsafeDebugDll); 4023Compilation comp2 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.None)); 4028Compilation comp3 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)); 4031Compilation comp4 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Diagnose)); 4126Compilation comp2 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.None)); 4129Compilation comp3 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)); 4627Compilation comp2 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.None)); 4630Compilation comp3 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)); 4633Compilation comp4 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Diagnose)); 4809Compilation comp2 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.None)); 4812Compilation comp3 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)); 4815Compilation comp4 = CreateCompilation(source, references: references, parseOptions: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Diagnose));
DocumentationComments\CrefTests.cs (76)
904var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 1000var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 1099var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 2967var expectedTypeSymbol = ((Compilation)compilation).GlobalNamespace.GetMember<INamedTypeSymbol>("C"); 3002var typeA = ((Compilation)compilation).GlobalNamespace.GetMember<INamedTypeSymbol>("A"); 3006var typeInt = ((Compilation)compilation).GetSpecialType(SpecialType.System_Int32); 4782var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 4844var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 4871var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 4932var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 4968var compilation = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(source, parseOptions: TestOptions.RegularWithDocumentationComments); 5003var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source, new[] { SystemCoreRef }); 5075var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source, new[] { SystemCoreRef }); 5123var compilation = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(new[] { tree }); 5229var compilation = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(new[] { tree }); 5394var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 5440var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 5466var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 5488var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 5587var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 5617var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 5843var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 5895var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 5918var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 5968var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6020var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6101var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6136var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6173var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6207var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6237var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6306var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(@" 6416var comp = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6454var comp = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6493var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6519var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6552var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6574var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6597var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 6612private static IEnumerable<CrefSyntax> GetCrefSyntaxes(Compilation compilation) => GetCrefSyntaxes((CSharpCompilation)compilation);
DocumentationComments\ParameterTests.cs (6)
565var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 593var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source); 642var compilation = (Compilation)CreateCompilationWithMscorlib40AndDocumentationComments(source);
SymbolDisplay\SymbolDisplayTests.cs (22)
5408var comp = (Compilation)CreateCompilationWithMscorlib46(text, references: new[] { SystemRuntimeFacadeRef, ValueTupleRef }); 5499private static void RefReturnInternal(Compilation comp) 5703private static void RefReadonlyReturnInternal(Compilation comp) 5921var comp = (Compilation)CreateCompilation(new[] { source }, parseOptions: TestOptions.Regular8, options: WithNullableEnable()); 5993var comp = (Compilation)CreateCompilation(source, parseOptions: TestOptions.Regular8); 6062var comp = (Compilation)CreateCompilation(source, parseOptions: TestOptions.Regular8); 6148var compilation = (Compilation)CreateCompilation(source); 6181var comp = (Compilation)CreateCompilation(source, parseOptions: TestOptions.Regular8); 6220var comp = (Compilation)CreateCompilation(source, parseOptions: TestOptions.Regular8); 6275var compilation = (Compilation)CreateCompilation(source); 6319var compilation = (Compilation)CreateCompilation(source); 6343var comp = (Compilation)CreateCompilation(source);
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (2)
1003var compilation = (Compilation)CreateCompilation(source);
Symbols\ConversionTests.cs (10)
348var comp = (Compilation)CreateCompilation(source); 386var compilation = (Compilation)CSharpCompilation.Create("MyCompilation") 2053var comp = (Compilation)CreateCompilation(source); 2135var comp = (Compilation)CreateCompilation(source); 2169var comp = (Compilation)CreateCompilation(source);
Symbols\CorLibrary\CorTypes.cs (2)
229Assert.Throws<ArgumentOutOfRangeException>(() => ((Compilation)c1).GetSpecialType(SpecialType.None)); 231Assert.Throws<ArgumentOutOfRangeException>(() => ((Compilation)c1).GetSpecialType(SpecialType.Count + 1));
Symbols\CustomModifiersTests.cs (4)
63var compilation = (Compilation)CreateCompilationWithILAndMscorlib40(source, ilSource, options: TestOptions.ReleaseExe); 133var compilation = (Compilation)CreateCompilationWithILAndMscorlib40(source, ilSource, options: TestOptions.ReleaseExe);
Symbols\DestructorTests.cs (2)
398var compilation = (Compilation)CreateCompilation(source);
Symbols\ExtensionMethodTests.cs (4)
2947var compilation = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(source); 3005var compilation = (Compilation)CreateCompilationWithMscorlib40AndSystemCore(source);
Symbols\FunctionPointerTypeSymbolTests.cs (16)
1528var comp = (Compilation)CreateCompilation(""); 1551var comp = (Compilation)CreateCompilation(""); 1563var comp = (Compilation)CreateCompilation(@"class C {}"); 1579var comp = (Compilation)CreateCompilation(""); 1595var comp = (Compilation)CreateCompilation(""); 1612var comp = (Compilation)CreateCompilation(""); 1635var comp = (Compilation)CreateCompilation(""); 1647var comp = (Compilation)CreateCompilation("");
Symbols\MethodEqualityTests.cs (2)
199var comp = (Compilation)CreateCompilation(text);
Symbols\Source\BaseClassTests.cs (4)
261var comp = (Compilation)CreateEmptyCompilation(text); 298var comp = (Compilation)CreateEmptyCompilation(text);
Symbols\Source\DeclaringSyntaxNodeTests.cs (13)
23private ImmutableArray<SyntaxReference> CheckDeclaringSyntaxNodes(Compilation compilation, 52private ImmutableArray<SyntaxReference> CheckDeclaringSyntaxNodesIncludingParameters(Compilation compilation, 77private ImmutableArray<SyntaxReference> CheckDeclaringSyntaxNodesWithoutGetDeclaredSymbol(Compilation compilation, 188var comp = (Compilation)CreateCompilation(text); 232var comp = (Compilation)CreateCompilation(text); 407var comp = (Compilation)CreateCompilation(text); 447var comp = (Compilation)CreateCompilation(text); 514var comp = (Compilation)CreateCompilation(text);
Symbols\Source\ExternAliasTests.cs (2)
472var comp = (Compilation)CreateCompilation(source, new[] { libRef });
Symbols\Source\FileModifierTests.cs (5)
4311var sourceType = ((Compilation)comp).GetTypeByMetadataName(metadataName); 4314Assert.Null(((Compilation)comp).GetTypeByMetadataName("C")); 4340var sourceType = ((Compilation)comp).GetTypeByMetadataName($"<SomeFile>F{checksum}__C"); 4420type = ((Compilation)referencingMetadataComp).GetTypeByMetadataName("<>FE3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855__C")!; 4429type = ((Compilation)referencingImageComp).GetTypeByMetadataName("<>FE3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855__C")!;
Symbols\Source\NullablePublicAPITests.cs (13)
146var c = ((Compilation)comp).GetTypeByMetadataName("C"); 213var c = ((Compilation)comp).GetTypeByMetadataName("C"); 287var c = ((Compilation)compilation).GetTypeByMetadataName("C"); 376var c = ((Compilation)compilation).GetTypeByMetadataName("C"); 479var c = ((Compilation)compilation).GetTypeByMetadataName("C"); 487var e = ((Compilation)compilation).GetTypeByMetadataName("Ext"); 636var c = ((Compilation)compilation).GetTypeByMetadataName("C"); 693comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 757comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 822comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("I")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 889comp => ((INamedTypeSymbol)((Compilation)comp).GetMember("IB")).GetMembers().OfType<IMethodSymbol>().Where(m => m.Name.StartsWith("F")).ToArray(), 1201var comp = (Compilation)CreateCompilation(source, options: WithNullableEnable());
Symbols\SymbolEqualityTests.cs (14)
222var comp = (Compilation)CreateCompilation(source); 246var comp = (Compilation)CreateCompilation(source); 282var comp = (Compilation)CreateCompilation(source); 306var comp = (Compilation)CreateCompilation(source); 329var comp1 = (Compilation)CreateCompilation(source1); 341var comp2 = (Compilation)CreateCompilation(source2, new[] { new CSharpCompilationReference((CSharpCompilation)comp1) }); 373var comp = (Compilation)CreateCompilation(source);
Symbols\TypeTests.cs (6)
1676var comp = (Compilation)CreateCompilation(tree); 1760var comp = (Compilation)CreateCompilation(tree); 1850var compilation = (Compilation)CreateCompilation(code);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (24)
CSharpTestBase.cs (9)
1021Compilation compilation, 1654public Tuple<TNode, SemanticModel> GetBindingNodeAndModel<TNode>(Compilation compilation, int treeIndex = 0) where TNode : SyntaxNode 1730public IList<TNode> GetBindingNodes<TNode>(Compilation compilation, int treeIndex = 0, int which = -1) where TNode : SyntaxNode 2066protected static IOperation VerifyOperationTreeForTest<TSyntaxNode>(CSharpCompilation compilation, string expectedOperationTree, Action<IOperation, Compilation, SyntaxNode> additionalOperationTreeVerifier = null) 2121Action<IOperation, Compilation, SyntaxNode> additionalOperationTreeVerifier = null) 2147Action<IOperation, Compilation, SyntaxNode> additionalOperationTreeVerifier = null, 2168Action<IOperation, Compilation, SyntaxNode> additionalOperationTreeVerifier = null) 2186Action<IOperation, Compilation, SyntaxNode> additionalOperationTreeVerifier = null, 2244Action<IOperation, Compilation, SyntaxNode> additionalOperationTreeVerifier = null,
Extensions.cs (11)
168public static ISymbol GetMember(this Compilation compilation, string qualifiedName) 174public static T GetMember<T>(this Compilation compilation, string qualifiedName) where T : ISymbol 177public static IMethodSymbol GetCopyConstructor(this Compilation compilation, string qualifiedTypeName) 188public static IMethodSymbol GetPrimaryConstructor(this Compilation compilation, string qualifiedTypeName) 194public static IMethodSymbol GetParameterlessConstructor(this Compilation compilation, string qualifiedTypeName) 200public static IMethodSymbol GetSpecializedEqualsOverload(this Compilation compilation, string qualifiedTypeName) 206public static IMethodSymbol GetPrimaryDeconstructor(this Compilation compilation, string qualifiedTypeName) 219public static ImmutableArray<T> GetMembers<T>(this Compilation compilation, string qualifiedName) where T : ISymbol 222public static ImmutableArray<Symbol> GetMembers(this Compilation compilation, string qualifiedName) 736public static ISymbol GetSpecialTypeMember(this Compilation compilation, SpecialMember specialMember) 741public static INamedTypeSymbol GetWellKnownType(this Compilation compilation, WellKnownType type)
MetadataTestHelpers.cs (1)
36internal static AssemblySymbol[] GetSymbolsForReferences(MetadataReference[] mrefs, Compilation[] compilations)
MockCSharpCompiler.cs (3)
22internal Compilation Compilation; 71public Compilation CreateCompilation( 77public override Compilation CreateCompilation(
Microsoft.CodeAnalysis.CSharp.Workspaces (19)
Diagnostics\CSharpDiagnosticPropertiesService.cs (2)
17private static readonly Compilation s_compilation = CSharpCompilation.Create("empty"); 25protected override Compilation GetCompilation() => s_compilation;
ExternalAccess\Pythia\Api\PythiaSymbolExtensions.cs (1)
23public static ImmutableArray<T> FilterToVisibleAndBrowsableSymbols<T>(this ImmutableArray<T> symbols, bool hideAdvancedMembers, Compilation compilation) where T : ISymbol
Recommendations\CSharpRecommendationServiceRunner_Conversions.cs (2)
145private static ITypeSymbol TryMakeNullable(Compilation compilation, ITypeSymbol container) 193private IMethodSymbol LiftConversion(Compilation compilation, IMethodSymbol method)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\CompilationExtensions.cs (1)
9public static LanguageVersion LanguageVersion(this Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
371public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
931protected override bool IsReferenceConversion(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpAddImportsService.cs (1)
40protected override ImmutableArray<SyntaxNode> GetGlobalImports(Compilation compilation, SyntaxGenerator generator)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (8)
590invocationTypes.Any(t => Compilation.ClassifyConversion(m.ReturnType, t).IsImplicit)).ToList(); 1118static ITypeSymbol MakeNullable(ITypeSymbol symbol, Compilation compilation) 1252.Construct(Compilation.GetSpecialType(SpecialType.System_Object))); 1567var type = Compilation.CreateTupleTypeSymbol( 2239return inferredFutureUsage.Length > 0 ? inferredFutureUsage[0].InferredType : Compilation.ObjectType; 2243Compilation.CreateTupleTypeSymbol(elementTypes, elementNames))]; 2273return Compilation.CreateTupleTypeSymbol(elementTypes, elementNames, elementNullableAnnotations: GetNullableAnnotations(elementTypes)); 2358return [new TypeInferenceInfo(Compilation.GetSpecialType(SpecialType.System_Boolean))];
Workspace\LanguageServices\CSharpCompilationFactoryService.cs (2)
26Compilation ICompilationFactoryService.CreateCompilation(string assemblyName, CompilationOptions options) 33Compilation ICompilationFactoryService.CreateSubmissionCompilation(string assemblyName, CompilationOptions options, Type? hostObjectType)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (32)
CodeGeneration\SymbolEditorTests.cs (4)
50var compilation = await solution.Projects.First().GetCompilationAsync(); 192var comp = await solution.Projects.First().GetCompilationAsync(); 238var comp = await solution.Projects.First().GetCompilationAsync(); 316var comp = await solution.Projects.First().GetCompilationAsync();
CodeGeneration\SyntaxGeneratorTests.cs (28)
41public static Compilation Compile(string code) 232var compilation = Compile(decl + "\r\n" + use + "\r\nclass C { }"); 1665var compilation = Compile(""" 3776var comp = Compile( 3959var comp = Compile( 3977var comp = Compile( 4016var comp = Compile( 4034var comp = Compile( 4052var comp = Compile( 4070var comp = Compile( 4088var comp = Compile( 4106var comp = Compile( 4124var comp = Compile( 4269var comp = Compile( 4298var comp = Compile( 4386var comp = Compile( 4592var comp = Compile( 4607var comp = Compile( 4630var comp = Compile( 4645var comp = Compile( 4668var comp = Compile( 4688var comp = Compile( 4706var comp = Compile( 4723var comp = Compile( 4738var comp = Compile( 4895var compilation = Compile(""" 4949var compilation = Compile(""" 4988var compilation = Compile(code);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
Semantics\SpeculationAnalyzerTestsBase.cs (4)
41var initialCompilation = CreateCompilation(initialTree); 53private void CheckCompilation(Compilation compilation) 63protected abstract Compilation CreateCompilation(SyntaxTree tree); 65protected abstract bool CompilationSucceeded(Compilation compilation, Stream temporaryStream);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (54)
CodeAnalysisResources.cs (1)
27s_codeAnalysisResourceManager ??= new ResourceManager(typeof(CodeAnalysisResources).FullName, typeof(Compilation).Assembly);
CodeGeneration\CodeGenerationTests.cs (2)
669private static ITypeSymbol GetTypeSymbol(Compilation compilation, Type type) 672private static ITypeSymbol GetTypeSymbol(Compilation compilation, string typeFullName, int arrayRank = 0)
MetadataAsSource\AbstractMetadataAsSourceTests.cs (1)
111var generatedCompilation = await generatedDocument.Project.GetCompilationAsync();
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
167public async Task<ISymbol?> ResolveSymbolAsync(string symbolMetadataName, Compilation? compilation = null)
MetadataAsSource\MetadataAsSourceTests.cs (1)
1714var compilation = await context.DefaultProject.GetCompilationAsync();
SymbolFinder\DependentTypeFinderTests.cs (27)
75var portableCompilation = await GetPortableProject(solution).GetCompilationAsync(); 78var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 116var portableCompilation = await GetPortableProject(solution).GetCompilationAsync(); 119var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 167var portableCompilation = await GetPortableProject(solution).GetCompilationAsync(); 170var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 208var portableCompilation = await GetPortableProject(solution).GetCompilationAsync(); 211var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 250var portableCompilation = await GetPortableProject(solution).GetCompilationAsync(); 253var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 292var portableCompilation = await GetPortableProject(solution).GetCompilationAsync(); 295var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 333var portableCompilation = await GetPortableProject(solution).GetCompilationAsync(); 336var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 374var portableCompilation = await GetPortableProject(solution).GetCompilationAsync(); 377var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 414var portableCompilation = await GetPortableProject(solution).GetCompilationAsync(); 417var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 438var compilation = await GetNormalProject(solution).GetCompilationAsync(); 483var compilation = await GetNormalProject(solution).GetCompilationAsync(); 535var compilation = await GetNormalProject(solution).GetCompilationAsync(); 572var compilation = await GetNormalProject(solution).GetCompilationAsync(); 602var compilation = await GetNormalProject(solution).GetCompilationAsync(); 700var compilation = await normalProject1.GetCompilationAsync(); 754var compilation1 = await solution.Projects.Single(p => p.Name == "PortableProject1").GetCompilationAsync(); 755var compilation2 = await solution.Projects.Single(p => p.Name == "PortableProject2").GetCompilationAsync(); 787var portableCompilation = await GetPortableProject(solution).GetCompilationAsync();
Utilities\SymbolEquivalenceComparerTests.cs (21)
1621var comp1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()); 1622var comp2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()); 1695var comp1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()); 1696var comp2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()); 1739var a1 = (Compilation)CS.CSharpCompilation.Create("a", [CS.SyntaxFactory.ParseSyntaxTree(source)], references, CSharpDllOptions); 1740var a2 = (Compilation)CS.CSharpCompilation.Create("a", [CS.SyntaxFactory.ParseSyntaxTree(source)], references, CSharpDllOptions); 1742var b1 = (Compilation)CS.CSharpCompilation.Create("b", [CS.SyntaxFactory.ParseSyntaxTree(sourceV1)], references, CSharpSignedDllOptions); 1743var b2 = (Compilation)CS.CSharpCompilation.Create("b", [CS.SyntaxFactory.ParseSyntaxTree(sourceV2)], references, CSharpSignedDllOptions); 1744var b3 = (Compilation)CS.CSharpCompilation.Create("b", [CS.SyntaxFactory.ParseSyntaxTree(sourceV2)], references, CSharpSignedDllOptions); 1833var c1 = (Compilation)CS.CSharpCompilation.Create("comp1", Array.Empty<SyntaxTree>(), [NetFramework.mscorlib, r1]); 1834var c2 = (Compilation)CS.CSharpCompilation.Create("comp2", Array.Empty<SyntaxTree>(), [NetFramework.mscorlib, r2]); 1864private static void TestReducedExtension<TInvocation>(Compilation comp1, Compilation comp2, string typeName, string methodName) 1884private static IMethodSymbol GetInvokedSymbol<TInvocation>(Compilation compilation, string typeName, string methodName)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Peek\DefinitionPeekableItem.cs (1)
75var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
IntelliSense\CSharpCompletionCommandHandlerTests.vb (1)
12386Dim compilation As Compilation = Nothing
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (3)
FrameDecoder.cs (1)
27where TCompilation : Compilation
InstructionDecoder.cs (1)
14where TCompilation : Compilation
LanguageInstructionDecoder.cs (1)
19where TCompilation : Compilation
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (3)
MetadataAsSource\OmniSharpMetadataAsSourceHelpers.cs (1)
16public static string GetAssemblyDisplay(Compilation compilation, IAssemblySymbol assemblySymbol)
MetadataAsSource\OmniSharpMetadataAsSourceService.cs (2)
28/// <param name="symbolCompilation">The <see cref="Compilation"/> in which <paramref name="symbol"/> is resolved.</param> 33public static Task<Document> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, OmniSharpSyntaxFormattingOptionsWrapper formattingOptions, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features (183)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
108private static bool HasDebuggerDisplayAttribute(ITypeSymbol typeSymbol, Compilation compilation)
AddImport\AbstractAddImportFeatureService.cs (5)
136var referenceToCompilation = new ConcurrentDictionary<PortableExecutableReference, Compilation>(concurrencyLevel: 2, capacity: project.Solution.Projects.Sum(p => p.MetadataReferences.Count)); 166ConcurrentDictionary<PortableExecutableReference, Compilation> referenceToCompilation, 253ConcurrentDictionary<PortableExecutableReference, Compilation> referenceToCompilation, 421private static Compilation CreateCompilation(Project project, PortableExecutableReference reference) 424var compilation = compilationService.CreateCompilation("TempAssembly", compilationService.GetDefaultCompilationOptions());
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (2)
179var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 200var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (3)
78var compilation = await currentProject.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 106var compilation = await currentProject.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 176var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.cs (1)
32var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractAwaitCompletionProvider.cs (1)
72private static bool IsConfigureAwaitable(Compilation compilation, ITypeSymbol symbol)
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
286var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (1)
100private static bool InSameProject(INamedTypeSymbol symbol, Compilation compilation)
Completion\Providers\CompletionUtilities.cs (1)
15public static bool IsTypeImplicitlyConvertible(Compilation compilation, ITypeSymbol sourceType, ImmutableArray<ITypeSymbol> targetTypes)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (2)
67private async Task<(ImmutableArray<TypeImportCompletionCacheEntry> results, bool isPartial)> GetCacheEntriesAsync(Project currentProject, Compilation originCompilation, bool forceCacheCreation, CancellationToken cancellationToken) 183Compilation originCompilation,
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (2)
143Compilation compilation, ImmutableArray<IMethodSymbol> extentsionMethodSymbols, ImmutableArray<ITypeSymbol> targetTypeSymbols, CancellationToken cancellationToken) 212Compilation compilation, IMethodSymbol methodSymbol, ImmutableArray<ITypeSymbol> targetTypeSymbols,
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
177private static (ISymbol? symbol, int overloadCount) GetSymbolAndOverloadCount(CompletionItem item, Compilation compilation)
Completion\Providers\ImportCompletionProvider\TypeImportCompletionCacheEntry.cs (1)
56Compilation originCompilation,
Completion\Providers\SymbolCompletionItem.cs (2)
165private static void DecodeSymbols(List<string> ids, Compilation compilation, ArrayBuilder<ISymbol> symbols) 183private static ISymbol? DecodeSymbol(string id, Compilation compilation)
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
340ITypeSymbol type1, ITypeSymbol type2, Compilation compilation)
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
27protected abstract bool SupportsInterpolatedStringHandler(Compilation compilation);
DecompiledSource\IDecompilationService.cs (1)
15Document? PerformDecompilation(Document document, string fullName, Compilation compilation, MetadataReference? metadataReference, string? assemblyLocation);
DecompiledSource\IDecompiledSourceService.cs (2)
20/// <param name="symbolCompilation">The <see cref="Compilation"/> in which symbol is resolved.</param> 27Task<Document?> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, MetadataReference? metadataReference, string? assemblyLocation, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken);
DesignerAttribute\DesignerAttributeDiscoveryService.cs (2)
327static IEnumerable<ITypeSymbol> GetBaseTypesAndThis(Compilation compilation, INamedTypeSymbol firstType) 340static INamedTypeSymbol? TryMapToNonErrorType(Compilation compilation, IErrorTypeSymbol errorType)
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (2)
269public string Format(string rawXmlText, Compilation compilation = null) 310private static void AppendTextFromNode(FormatterState state, XNode node, Compilation compilation)
DocumentationComments\IDocumentationCommentFormattingService.cs (1)
13string? Format(string? rawXmlText, Compilation? compilation = null);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
937Compilation oldCompilation,
EditAndContinue\DebuggingSession.cs (2)
315Compilation baselineCompilation, 359Compilation compilation,
EditAndContinue\EditSession.cs (6)
611Compilation oldCompilation, 612Compilation newCompilation, 671Compilation oldCompilation, 672Compilation newCompilation, 957var oldCompilation = await oldProject.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 995var newCompilation = await newProject.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
30public DateAndTimeLanguageDetector Create(Compilation compilation, EmbeddedLanguageInfo info)
EmbeddedLanguages\Json\LanguageServices\JsonLanguageDetector.cs (1)
32public JsonLanguageDetector Create(Compilation compilation, EmbeddedLanguageInfo info)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (1)
34public RegexLanguageDetector Create(Compilation compilation, EmbeddedLanguageInfo info)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (1)
230if (otherProject.TryGetCompilation(out var compilation))
ExtractMethod\MethodExtractor.Analyzer.cs (3)
66protected abstract VariableInfo CreateFromSymbol(Compilation compilation, ISymbol symbol, ITypeSymbol type, VariableStyle variableStyle, bool variableDeclared); 298var compilation = model.Compilation; 939Compilation compilation,
ExtractMethod\MethodExtractor.VariableSymbol.cs (5)
24protected VariableSymbol(Compilation compilation, ITypeSymbol type) 94protected abstract class NotMovableVariableSymbol(Compilation compilation, ITypeSymbol type) : VariableSymbol(compilation, type) 118public ParameterVariableSymbol(Compilation compilation, IParameterSymbol parameterSymbol, ITypeSymbol type) 197public LocalVariableSymbol(Compilation compilation, ILocalSymbol localSymbol, ITypeSymbol type, HashSet<int> nonNoisySet) 311public QueryVariableSymbol(Compilation compilation, IRangeVariableSymbol symbol, ITypeSymbol type)
FullyQualify\AbstractFullyQualifyService.cs (1)
294ImmutableArray<SymbolResult> symbols, Compilation compilation)
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (1)
176Compilation compilation,
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (4)
42var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 64var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 128SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, Compilation compilation, 148SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, Compilation compilation,
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (2)
142Compilation compilation, 170private static IMethodSymbol CreateInequalityOperator(Compilation compilation, SyntaxGenerator generator, ImmutableArray<IParameterSymbol> parameters)
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
29protected abstract bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType);
GenerateType\AbstractGenerateTypeService.State.cs (2)
60public Compilation Compilation { get; } 65private State(Compilation compilation)
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (4)
390Compilation compilation, SyntaxGenerator generator, IParameterSymbol parameter, string methodName, TSimplifierOptions options) 539Compilation compilation, SyntaxGenerator generator, Type type) 553Compilation compilation, SyntaxGenerator generator, IParameterSymbol parameter) 561Compilation compilation, SyntaxGenerator generator, IParameterSymbol parameter, string methodName)
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (1)
34protected abstract bool IsImplicitConversion(Compilation compilation, ITypeSymbol source, ITypeSymbol destination);
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (7)
43public async Task<SyntaxNode> RewriteDocumentAsync(Compilation compilation, Document document, List<TExpressionSyntax> invocations, CancellationToken cancellationToken) 135private int GetInsertionIndex(Compilation compilation) 219private async Task<SyntaxNode> ModifyDocumentInvocationsTrampolineOverloadAndIntroduceParameterAsync(Compilation compilation, Document currentDocument, 304SyntaxNode GenerateNewArgumentListSyntaxForTrampoline(Compilation compilation, SemanticModel invocationSemanticModel, 481private async Task<SyntaxNode> ModifyDocumentInvocationsAndIntroduceParameterAsync(Compilation compilation, Document document, int insertionIndex, 581private bool ShouldArgumentBeNamed(Compilation compilation, SemanticModel semanticModel, 602private static bool ShouldParameterBeSkipped(Compilation compilation, IParameterSymbol parameter)
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (1)
104private static bool IsLegalUsingStatementType(Compilation compilation, ITypeSymbol disposableType, ITypeSymbol type)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
147protected Compilation Compilation
MetadataAsSource\AbstractMetadataAsSourceService.cs (3)
25Compilation symbolCompilation, 84/// <param name="symbolCompilation">The <see cref="Compilation"/> in which symbol is resolved.</param> 88protected abstract Task<Document> AddAssemblyInfoRegionAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken);
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
232private (MetadataReference? metadataReference, string? assemblyLocation, bool isReferenceAssembly) GetReferenceInfo(Compilation compilation, IAssemblySymbol containingAssembly) 377var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
MetadataAsSource\IMetadataAsSourceService.cs (2)
20/// <param name="symbolCompilation">The <see cref="Compilation"/> in which <paramref name="symbol"/> is resolved.</param> 26Task<Document> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken);
MetadataAsSource\MetadataAsSourceHelpers.cs (1)
42public static string GetAssemblyDisplay(Compilation compilation, IAssemblySymbol assemblySymbol)
MoveToNamespace\AbstractMoveToNamespaceService.cs (1)
308var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
155var tmpCompilation = compilationFactory
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
399Compilation compilation, 427private static TSymbol? GetSymbolInCurrentCompilation<TSymbol>(Compilation compilation, TSymbol originalDefinition, CancellationToken cancellationToken)
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
399Compilation compilation, 430private static TSymbol? GetSymbolInCurrentCompilation<TSymbol>(Compilation compilation, TSymbol originalDefinition, CancellationToken cancellationToken)
SemanticSearch\AbstractSemanticSearchService.cs (4)
58protected abstract Compilation CreateCompilation(SourceText query, IEnumerable<MetadataReference> references, SolutionServices services, out SyntaxTree queryTree, CancellationToken cancellationToken); 242private static ImmutableArray<TaggedText> GetExceptionTypeTaggedText(Exception e, Compilation compilation) 418typeof(Compilation).IsAssignableFrom(paramType))); 422error = string.Format(FeaturesResources.Method_0_must_have_a_single_parameter_of_type_1_and_return_2, SemanticSearchUtilities.FindMethodName, nameof(Compilation));
Shared\Extensions\ISymbolExtensions_2.cs (3)
190public static DocumentationComment GetAppropriateDocumentationComment(this ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 204private static DocumentationComment? GetParameterDocumentation(IParameterSymbol parameter, Compilation compilation, CancellationToken cancellationToken) 249private static DocumentationComment GetMethodDocumentation(this IMethodSymbol method, Compilation compilation, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractConditionalBlockSnippetProvider.cs (1)
20protected sealed override bool IsValidAccessingType(ITypeSymbol type, Compilation compilation)
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (1)
90protected static INamedTypeSymbol? GetConsoleSymbolFromMetaDataName(Compilation compilation)
Snippets\SnippetProviders\AbstractForEachLoopSnippetProvider.cs (1)
13protected sealed override bool IsValidAccessingType(ITypeSymbol type, Compilation compilation)
Snippets\SnippetProviders\AbstractForLoopSnippetProvider.cs (4)
13protected sealed override bool IsValidAccessingType(ITypeSymbol type, Compilation compilation) 30protected static IPropertySymbol? FindLengthProperty(ITypeSymbol type, Compilation compilation) 33protected static IPropertySymbol? FindCountProperty(ITypeSymbol type, Compilation compilation) 36private static IPropertySymbol? FindAccessibleIntegerProperty(ITypeSymbol type, Compilation compilation, string propertyName)
Snippets\SnippetProviders\AbstractInlineStatementSnippetProvider.cs (1)
28protected abstract bool IsValidAccessingType(ITypeSymbol type, Compilation compilation);
src\Analyzers\Core\Analyzers\Helpers\DeserializationConstructorCheck.cs (1)
9internal readonly struct DeserializationConstructorCheck(Compilation compilation)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (3)
19private readonly Compilation _compilation; 26Compilation compilation, IMethodSymbol objectGetHashCodeMethod, 35public static bool TryGetAnalyzer(Compilation compilation, [NotNullWhen(true)] out HashCodeAnalyzer analyzer)
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
112Compilation compilation,
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
123var compilation = context.Compilation;
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (1)
70protected sealed class CompilationAnalyzer(Compilation compilation, INamedTypeSymbol suppressMessageAttributeType)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
614Compilation compilation)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (2)
16internal sealed partial class SuppressMessageAttributeState(Compilation compilation, INamedTypeSymbol suppressMessageAttributeType) 23private readonly Compilation _compilation = compilation;
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
115Compilation compilation, 133private static IEnumerable<INamedTypeSymbol> GetAttributesForMethodsToIgnore(Compilation compilation) 608Compilation compilation,
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
177private static IEnumerable<INamedTypeSymbol?> GetAttributesForMethodsToIgnore(Compilation compilation)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
72static bool TryGetEnumerableTypeSymbol(Compilation compilation, [NotNullWhen(true)] out INamedTypeSymbol? enumerableType)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (4)
89protected abstract bool SupportsReadOnlyProperties(Compilation compilation); 90protected abstract bool SupportsPropertyInitializer(Compilation compilation); 91protected abstract bool SupportsFieldExpression(Compilation compilation); 341var compilation = semanticModel.Compilation;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (2)
80protected abstract bool AreCollectionInitializersSupported(Compilation compilation); 81protected abstract bool AreCollectionExpressionsSupported(Compilation compilation);
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
81static bool AreEqualOrHaveImplicitConversion(ITypeSymbol? firstType, ITypeSymbol? secondType, Compilation compilation)
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (2)
52protected abstract bool IsLanguageVersionSupported(Compilation compilation); 53protected abstract bool IsUnconstrainedGenericSupported(Compilation compilation);
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
67protected abstract bool ShouldAnalyze(Compilation compilation);
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
89protected abstract bool AreObjectInitializersSupported(Compilation compilation);
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
51protected abstract bool IsSupported(Compilation compilation);
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (3)
437var compilation = semanticModel.Compilation; 518Compilation compilation, TypeInfo argumentTypeInfo, IParameterSymbol parameter, 535Compilation compilation, TypeInfo argumentTypeInfo, ITypeSymbol parameterType,
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
41protected abstract bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
291var compilation = semanticModel.Compilation;
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (2)
33var compilation = semanticModel.Compilation; 41private static bool IsSymbolAccessible(Compilation compilation, ISymbol symbol)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (1)
113protected abstract bool IsImplicitReferenceConversion(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (3)
24Compilation compilation, 36Compilation compilation, ISet<string> availableTypeParameterNames, Project project, CancellationToken cancellationToken) : AsyncSymbolVisitor 40private readonly Compilation _compilation = compilation;
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (5)
127Compilation compilation, ISymbol? throughMember, 139Compilation compilation, ISymbol member, ISymbol? throughMember, 153Compilation compilation, ISymbol member, ISymbol? throughMember, bool addUnsafe, 177Compilation compilation, IMethodSymbol method, ISymbol? throughMember, 196Compilation compilation,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (2)
219public static bool ShouldImplementDisposePattern(Compilation compilation, IImplementInterfaceInfo state, bool explicitly) 246public static IMethodSymbol? TryGetIDisposableDispose(Compilation compilation)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (4)
107Compilation compilation, 177Compilation compilation, 278Compilation compilation, 310private ISymbol GenerateEvent(Compilation compilation, string memberName, bool generateInvisibly, SyntaxGenerator factory, DeclarationModifiers modifiers, bool useExplicitInterfaceSymbol, Accessibility accessibility, IEventSymbol @event)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (3)
118Compilation compilation, 136Compilation compilation, 187Compilation compilation,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Method.cs (2)
23Compilation compilation, 50private SyntaxNode CreateStatement(Compilation compilation, IMethodSymbol method)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Property.cs (6)
29Compilation compilation, 84private static INamedTypeSymbol[] AttributesToRemove(Compilation compilation) 91Compilation compilation, 124Compilation compilation, 151Compilation compilation, 165Compilation compilation,
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (3)
43protected abstract TSwitchArmSyntax CreateSwitchArm(SyntaxGenerator generator, Compilation compilation, TMemberAccessExpression caseLabel); 44protected abstract TSwitchArmSyntax CreateNullSwitchArm(SyntaxGenerator generator, Compilation compilation); 45protected abstract TSwitchArmSyntax CreateDefaultSwitchArm(SyntaxGenerator generator, Compilation compilation);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
52protected static TExpressionSyntax Exception(SyntaxGenerator generator, Compilation compilation)
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (3)
71protected sealed override TSwitchArmSyntax CreateDefaultSwitchArm(SyntaxGenerator generator, Compilation compilation) 74protected sealed override TSwitchArmSyntax CreateSwitchArm(SyntaxGenerator generator, Compilation compilation, TMemberAccessExpression caseLabel) 77protected override TSwitchArmSyntax CreateNullSwitchArm(SyntaxGenerator generator, Compilation compilation)
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
37private readonly Compilation _compilation; 42public TargetSymbolResolver(Compilation compilation, TargetScope scope, string fullyQualifiedName)
StackTraceExplorer\StackFrameLocalMethodResolver.cs (1)
30var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
SymbolMapping\SymbolMappingServiceFactory.cs (1)
26var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
81var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
UnusedReferences\UnusedReferencesRemover.cs (1)
38var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
54Compilation compilation,
Microsoft.CodeAnalysis.Features.Test.Utilities (12)
EditAndContinue\EditAndContinueTestVerifier.cs (2)
277Compilation oldCompilation, 278Compilation newCompilation,
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (3)
279Compilation compilation = CSharpTestBase.CreateCompilation(trees.ToArray(), options: TestOptions.DebugDll, targetFramework: DefaultTargetFramework, assemblyName: assemblyName); 294generatorDriver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var generatorDiagnostics); 302internal Guid EmitLibrary(Compilation compilation, DebugInformationFormat pdbFormat = DebugInformationFormat.PortablePdb)
EditAndContinue\SemanticEditDescription.cs (6)
15Func<Compilation, ISymbol> symbolProvider, 16Func<Compilation, ITypeSymbol>? partialType, 20Func<Compilation, ISymbol>? deletedSymbolContainerProvider) 23public readonly Func<Compilation, ISymbol> SymbolProvider = symbolProvider; 24public readonly Func<Compilation, ITypeSymbol>? PartialType = partialType; 25public readonly Func<Compilation, ISymbol>? DeletedSymbolContainerProvider = deletedSymbolContainerProvider;
EditAndContinue\SymReaderTestHelpers.cs (1)
38public static (ImmutableArray<byte> PEImage, ImmutableArray<byte> PdbImage) EmitToArrays(this Compilation compilation, EmitOptions options)
Microsoft.CodeAnalysis.Features.UnitTests (29)
FindUsages\DefinitionItemFactoryTests.cs (29)
132var compilation = await project.GetCompilationAsync(); 168var compilation = await project.GetCompilationAsync(); 210var compilation = await project.GetCompilationAsync(); 246var compilation = await project.GetCompilationAsync(); 288var compilation = await project.GetCompilationAsync(); 330var compilation = await project.GetCompilationAsync(); 383var compilation = await project.GetCompilationAsync(); 437var compilation = await project.GetCompilationAsync(); 477var compilation = await project.GetCompilationAsync(); 517var compilation = await project.GetCompilationAsync(); 559var compilation = await project.GetCompilationAsync(); 617var compilation = await project.GetCompilationAsync(); 663var compilation = await project.GetCompilationAsync(); 700var compilation = await project.GetCompilationAsync(); 762var compilation = await project.GetCompilationAsync(); 818var compilation = await project.GetCompilationAsync(); 872var compilation = await project.GetCompilationAsync(); 932var compilation = await project.GetCompilationAsync(); 977var compilation = await project.GetCompilationAsync(); 1032var compilation = await project.GetCompilationAsync(); 1084var compilation = await project.GetCompilationAsync(); 1146var compilation = await project.GetCompilationAsync(); 1203var compilation = await project.GetCompilationAsync(); 1260var compilation = await project.GetCompilationAsync(); 1337var compilation = await project.GetCompilationAsync(); 1397var compilation = await project.GetCompilationAsync(); 1448var compilation = await project.GetCompilationAsync(); 1512var compilation = await project.GetCompilationAsync(); 1583var compilation = await project.GetCompilationAsync();
Microsoft.CodeAnalysis.LanguageServer (1)
Logging\RoslynLogger.cs (1)
37FatalError.CopyHandlersTo(typeof(Compilation).Assembly);
Microsoft.CodeAnalysis.LanguageServer.Protocol (9)
Features\DecompiledSource\AssemblyResolver.cs (2)
26private readonly Compilation _parentCompilation; 30public AssemblyResolver(Compilation parentCompilation, StringBuilder logger)
Features\DecompiledSource\CSharpCodeDecompilerDecompilationService.cs (1)
37public Document? PerformDecompilation(Document document, string fullName, Compilation compilation, MetadataReference? metadataReference, string? assemblyLocation)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (5)
139var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 201private static void AssertCompilation(Project project, Compilation compilation1) 204Contract.ThrowIfFalse(project.TryGetCompilation(out var compilation2)); 243Compilation? compilation, 283Compilation? compilation,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (1)
239Compilation? compilation,
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Diagnostics\NonLocalDiagnosticTests.cs (1)
86var compilation = context.Compilation;
Microsoft.CodeAnalysis.Rebuild (6)
CompilationFactory.cs (4)
45public Compilation CreateCompilation(IRebuildArtifactResolver resolver) 51public abstract Compilation CreateCompilation( 81Compilation rebuildCompilation, 101Compilation rebuildCompilation,
CSharpCompilationFactory.cs (1)
47public override Compilation CreateCompilation(
VisualBasicCompilationFactory.cs (1)
47public override Compilation CreateCompilation(
Microsoft.CodeAnalysis.Rebuild.UnitTests (18)
BasicDeterministicKeyBuilderTests.cs (1)
51/// that contribute to the deterministic checksum of a <see cref="Compilation"/>. When
CompilationOptionsReaderTests.cs (1)
29private CompilationOptionsReader GetOptionsReader(Compilation compilation)
CompilationRebuildArtifactResolver.cs (2)
14internal Compilation Compilation { get; } 16public CompilationRebuildArtifactResolver(Compilation compilation)
CSharpDeterministicKeyBuilderTests.cs (2)
50/// that contribute to the deterministic checksum of a <see cref="Compilation"/>. When 225var compilerVersion = typeof(Compilation).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
CSharpRebuildTests.cs (1)
41var rebuild = compilationFactory.CreateCompilation(sources, original.References.ToImmutableArray());
DeterministicKeyBuilderTests.cs (8)
29where TCompilation : Compilation 90var compilation = compiler.CreateCompilation( 175protected JObject GetCompilationValue(Compilation compilation) 191protected JArray GetReferenceValues(Compilation compilation) 215protected static JArray GetSyntaxTreeValues(Compilation compilation, ImmutableArray<KeyValuePair<string, string>> pathMap = default) 221protected static JArray GetAdditionalTextValues(Compilation compilation, ImmutableArray<AdditionalText> additionalTexts, ImmutableArray<KeyValuePair<string, string>> pathMap = default) 227protected static JArray GetAnalyzerValues(Compilation compilation, params DiagnosticAnalyzer[] analyzers) 233protected static JArray GetGeneratorValues(Compilation compilation, params ISourceGenerator[] generators)
RebuildCommandLineTests.cs (1)
104var compilation = commonCompiler.CreateCompilation(
RoundTripUtil.cs (2)
69where TCompilation : Compilation 93var rebuild = compilationFactory.CreateCompilation(
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
src\VisualStudio\Core\Def\Watson\FaultReporter.cs (1)
38FatalError.CopyHandlersTo(typeof(Compilation).Assembly);
Microsoft.CodeAnalysis.Scripting (8)
Script.cs (4)
38private Compilation _lazyCompilation; 143/// Get's the <see cref="Compilation"/> that represents the semantics of the script. 145public Compilation GetCompilation() 149var compilation = Compiler.CreateSubmission(this);
ScriptBuilder.cs (3)
78internal Func<object[], Task<T>> CreateExecutor<T>(ScriptCompiler compiler, Compilation compilation, bool emitDebugInformation, CancellationToken cancellationToken) 123Compilation compilation, 175Compilation compilation,
ScriptCompiler.cs (1)
16public abstract Compilation CreateSubmission(Script script);
Microsoft.CodeAnalysis.Scripting.TestUtilities (3)
TestCompilationFactory.cs (3)
20internal static Compilation CreateCSharpCompilationWithCorlib(string source, string assemblyName = null) 29internal static Compilation CreateVisualBasicCompilationWithCorlib(string source, string assemblyName = null) 38internal static Compilation CreateCSharpCompilation(string source, IEnumerable<MetadataReference> references, string assemblyName = null, CSharpCompilationOptions options = null)
Microsoft.CodeAnalysis.Scripting.UnitTests (3)
ScriptOptionsTests.cs (3)
246var compilation = CSharpScript.Create(string.Empty, scriptOptions).GetCompilation(); 274var compilation = CSharpScript.Create(string.Empty, scriptOptions).GetCompilation(); 311var compilation = CSharpScript.Create(string.Empty, scriptOptions).GetCompilation();
Microsoft.CodeAnalysis.Test.Utilities (91)
BaseCompilerFeatureRequiredTests.cs (1)
12public abstract class BaseCompilerFeatureRequiredTests<TCompilation, TSource> : CommonTestBase where TCompilation : Compilation
CommonTestBase.cs (15)
75Compilation compilation, 133internal CompilationVerifier CompileAndVerifyFieldMarshalCommon(Compilation compilation, Dictionary<string, byte[]> expectedBlobs, bool isField = true) 145internal CompilationVerifier CompileAndVerifyFieldMarshalCommon(Compilation compilation, Func<string, PEAssembly, byte[]> getExpectedBlob, bool isField = true) 176Compilation compilation, 276IEnumerable<Compilation> referencedCompilations = null) 303IEnumerable<Compilation> referencedCompilations = null) 330IEnumerable<Compilation> referencedCompilations = null) 341IEnumerable<Compilation> referencedCompilations = null) 353IEnumerable<Compilation> referencedCompilations = null) 426IEnumerable<Compilation> referencedCompilations = null, 437IEnumerable<Compilation> referencedCompilations = null, 484private void AddReferencedCompilations(IEnumerable<Compilation> referencedCompilations, List<MetadataReference> references) 488foreach (var referencedCompilation in referencedCompilations) 495internal static MetadataReference AsReference(Compilation comp, bool useCompilationReference) 527dllCharacteristics: Compilation.GetDllCharacteristics(enableHighEntropyVA: true, configureToExecuteInAppContainer: false),
Compilation\CompilationExtensions.cs (12)
51this Compilation compilation, 100public static MemoryStream EmitToStream(this Compilation compilation, EmitOptions options = null, DiagnosticDescription[] expectedWarnings = null) 116this Compilation comp, 123this Compilation comp, 141this Compilation compilation, 172internal static void VerifyAssemblyVersionsAndAliases(this Compilation compilation, params string[] expectedAssembliesAndAliases) 180internal static void VerifyAssemblyAliases(this Compilation compilation, params string[] expectedAssembliesAndAliases) 188internal static void VerifyOperationTree(this Compilation compilation, SyntaxNode node, string expectedOperationTree) 194internal static void VerifyOperationTree(this Compilation compilation, string expectedOperationTree, bool skipImplicitlyDeclaredSymbols = false) 199internal static void VerifyOperationTree(this Compilation compilation, string symbolToVerify, string expectedOperationTree, bool skipImplicitlyDeclaredSymbols = false) 269public static void ValidateIOperations(Func<Compilation> createCompilation) 276var compilation = createCompilation();
Compilation\ControlFlowGraphVerifier.cs (4)
82public static void VerifyGraph(Compilation compilation, string expectedFlowGraph, ControlFlowGraph graph, ISymbol associatedSymbol) 98public static string GetFlowGraph(Compilation compilation, ControlFlowGraph graph, ISymbol associatedSymbol) 108private static void GetFlowGraph(System.Text.StringBuilder stringBuilder, Compilation compilation, ControlFlowGraph graph, 1805Compilation compilation, IOperation root, int initialIndent, ISymbol associatedSymbol) :
Compilation\IRuntimeEnvironment.cs (18)
91/// Emit all of the references which are not directly or indirectly a <see cref="Compilation"/> value. 93internal static void EmitReferences(Compilation compilation, HashSet<string> fullNameSet, List<ModuleData> dependencies, AssemblyIdentity corLibIdentity) 148/// Find all of the <see cref="Compilation"/> values reachable from this instance. 152private static List<Compilation> FindReferencedCompilations(Compilation original) 154var list = new List<Compilation>(); 155var toVisit = new Queue<Compilation>(FindDirectReferencedCompilations(original)); 159var current = toVisit.Dequeue(); 167foreach (var other in FindDirectReferencedCompilations(current)) 176private static List<Compilation> FindDirectReferencedCompilations(Compilation compilation) 178var list = new List<Compilation>(); 179var previousCompilation = compilation.ScriptCompilationInfo?.PreviousScriptCompilation; 194Compilation compilation, 209foreach (var referencedCompilation in referencedCompilations) 227foreach (var current in (new[] { compilation }).Concat(referencedCompilations)) 236Compilation compilation, 394void Emit(Compilation mainCompilation, IEnumerable<ResourceDescription> manifestResources, EmitOptions emitOptions, bool usePdbForDebugging = false);
Compilation\OperationTreeVerifier.cs (3)
25protected readonly Compilation _compilation; 36public OperationTreeVerifier(Compilation compilation, IOperation root, int initialIndent) 49public static string GetOperationTree(Compilation compilation, IOperation operation, int initialIndent = 0)
CompilationVerifier.cs (4)
33private readonly Compilation _compilation; 46Compilation compilation, 56public Compilation Compilation => _compilation; 690var dummy = _compilation
Diagnostics\CommonDiagnosticAnalyzers.cs (9)
103public static string GetExpectedV1ErrorLogResultsAndRulesText(Compilation compilation, bool warnAsError = false) 181public static string GetExpectedV1ErrorLogWithSuppressionResultsAndRulesText(Compilation compilation) 258public static string GetExpectedV2ErrorLogResultsText(Compilation compilation, bool warnAsError = false) 311public static string GetExpectedV2ErrorLogWithSuppressionResultsText(Compilation compilation, string justification, string suppressionType) 2821private static void ReportSymbolDiagnostics(string actionName, ISymbol symbol, Compilation compilation, Action<Diagnostic> reportDiagnostic) 2832private static void ReportDiagnosticsInAllTrees(string actionName, SyntaxTree analyzedTree, Compilation compilation, Action<Diagnostic> reportDiagnostic) 2916CanceledCompilations = new ConcurrentSet<Compilation>(); 2920public ConcurrentSet<Compilation> CanceledCompilations { get; } 2951private void HandleCallback(Location analysisLocation, Compilation compilation, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken)
Diagnostics\DiagnosticExtensions.cs (17)
106where TCompilation : Compilation 116TCompilation c, ImmutableArray<Diagnostic> diagnostics) where TCompilation : Compilation 147where TCompilation : Compilation 158where TCompilation : Compilation 170where TCompilation : Compilation 183where TCompilation : Compilation 195where TCompilation : Compilation 208where TCompilation : Compilation 230where TCompilation : Compilation 287where TCompilation : Compilation 304where TCompilation : Compilation 339public static IEnumerable<Diagnostic> GetEffectiveDiagnostics(this Compilation compilation, IEnumerable<Diagnostic> diagnostics) 354where TCompilation : Compilation 364where TCompilation : Compilation 371where TCompilation : Compilation 377where TCompilation : Compilation 383where TCompilation : Compilation
InstrumentationChecker.cs (2)
170public void CompleteCheck(Compilation compilation, XElement source) 320public void CompleteCheck(Compilation compilation, string source)
PDB\DeterministicBuildCompilationTestHelpers.cs (2)
47internal static void AssertCommonOptions(EmitOptions emitOptions, CompilationOptions compilationOptions, Compilation compilation, ImmutableDictionary<string, string> pdbOptions) 62var compilerVersion = typeof(Compilation).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
PDB\TestMetadataReferenceInfo.cs (3)
21public readonly Compilation Compilation; 30Compilation compilation, 52public static TestMetadataReferenceInfo Create(Compilation compilation, string fullPath, EmitOptions emitOptions)
Platform\Desktop\DesktopRuntimeEnvironment.cs (1)
201Compilation mainCompilation,
Microsoft.CodeAnalysis.UnitTests (21)
Diagnostics\AnalysisContextInfoTests.cs (3)
28var compilation = CreateCompilation(code, parseOptions: parseOptions); 44private static void Verify(Compilation compilation, AnalyzerOptions options, string context) 108private static Compilation CreateCompilation(string source, CSharpParseOptions parseOptions = null)
Diagnostics\SuppressMessageAttributeCompilerTests.cs (2)
30var compilation = CreateCompilation(source, language, rootNamespace); 67private static Compilation CreateCompilation(string source, string language, string rootNamespace)
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (5)
383var compilation = CreateCompilation(syntaxTree, LanguageNames.CSharp, ""); 1345var compilation = CreateCompilation(syntaxTree, language, rootNamespace); 1413var compilation = CreateCompilation(source, language, rootNamespace); 1425private static Compilation CreateCompilation(SyntaxTree syntaxTree, string language, string rootNamespace) 1446private static Compilation CreateCompilation(string source, string language, string rootNamespace)
GivesAccessTo.cs (4)
44var csc = (Compilation)CSharpCompilation.Create("CS", new[] { csharpTree }, new MetadataReference[] { TestBase.MscorlibRef }); 47var csc2 = (Compilation)CSharpCompilation.Create("CS2", new[] { csharpTree2 }, new MetadataReference[] { TestBase.MscorlibRef });
IsSymbolAccessibleWithinTests.cs (4)
28var csc = CSharpCompilation.Create("CS", new[] { csharpTree }, new MetadataReference[] { TestBase.MscorlibRef }) as Compilation; 31var vbc = VisualBasicCompilation.Create("VB", new[] { vbTree }, new MetadataReference[] { TestBase.MscorlibRef }) as Compilation;
MetadataReferences\MetadataReferenceTests.cs (2)
571var comp = (Compilation)CS.CSharpCompilation.Create("goo",
Win32Res.cs (1)
94Microsoft.CodeAnalysis.Compilation.AppendNullResource(strm);
Microsoft.CodeAnalysis.VisualBasic (34)
CommandLine\VisualBasicCompiler.vb (3)
90globalAnalyzerConfigOptions As AnalyzerConfigOptionsResult) As Compilation 177Protected Overrides Function GetOutputFileName(compilation As Compilation, cancellationToken As CancellationToken) As String 305Private Protected Overrides Sub DiagnoseBadAccesses(consoleOutput As TextWriter, errorLogger As ErrorLogger, compilation As Compilation, diagnostics As ImmutableArray(Of Diagnostic))
Compilation\SemanticModel.vb (1)
3073Protected NotOverridable Overrides ReadOnly Property CompilationCore As Compilation
Compilation\VisualBasicCompilation.vb (11)
710Friend Overrides Function WithSemanticModelProvider(semanticModelProvider As SemanticModelProvider) As Compilation 736Friend Overrides Function WithEventQueue(eventQueue As AsyncQueue(Of CompilationEvent)) As Compilation 2720Protected Overrides Function CommonWithReferences(newReferences As IEnumerable(Of MetadataReference)) As Compilation 2724Protected Overrides Function CommonWithAssemblyName(assemblyName As String) As Compilation 2728Protected Overrides Function CommonWithScriptCompilationInfo(info As ScriptCompilationInfo) As Compilation 2761Protected Overrides Function CommonAddSyntaxTrees(trees As IEnumerable(Of SyntaxTree)) As Compilation 2774Protected Overrides Function CommonRemoveSyntaxTrees(trees As IEnumerable(Of SyntaxTree)) As Compilation 2787Protected Overrides Function CommonRemoveAllSyntaxTrees() As Compilation 2791Protected Overrides Function CommonReplaceSyntaxTree(oldTree As SyntaxTree, newTree As SyntaxTree) As Compilation 2795Protected Overrides Function CommonWithOptions(options As CompilationOptions) As Compilation 2807Protected Overrides Function CommonClone() As Compilation
Compilation\VisualBasicCompilationReference.vb (1)
31Friend Overrides ReadOnly Property CompilationCore As Compilation
Compilation\VisualBasicScriptCompilationInfo.vb (2)
19Friend Overrides ReadOnly Property CommonPreviousScriptCompilation As Compilation 29Friend Overrides Function CommonWithPreviousScriptCompilation(compilation As Compilation) As ScriptCompilationInfo
Emit\EditAndContinue\PEDeltaAssemblyBuilder.vb (4)
222Compilation.AnonymousTypeManager.GetAnonymousTypeMap(), 313Dim exceptionType = Compilation.GetWellKnownType(WellKnownType.System_Exception) 314Dim stringType = Compilation.GetSpecialType(SpecialType.System_String) 315Dim intType = Compilation.GetSpecialType(SpecialType.System_Int32)
Emit\PEModuleBuilder.vb (2)
611Return DirectCast(Compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_RuntimeHelpers__InitializeArrayArrayRuntimeFieldHandle), MethodSymbol)?.GetCciAdapter() 619Return namedType Is Compilation.GetWellKnownType(WellKnownType.System_Type)
Symbols\NamespaceSymbol.vb (1)
583Private ReadOnly Property INamespaceSymbol_ContainingCompilation As Compilation Implements INamespaceSymbol.ContainingCompilation
Symbols\ReferenceManager.vb (2)
922Public Overrides ReadOnly Property SourceCompilation As Compilation 1006Public Overrides ReadOnly Property SourceCompilation As Compilation
Symbols\Source\SourceAssemblySymbol.vb (1)
1815Private ReadOnly Property ISourceAssemblySymbol_Compilation As Compilation Implements ISourceAssemblySymbol.Compilation
Symbols\Symbol.vb (1)
266ReadOnly Property ISymbolInternal_DeclaringCompilation As Compilation Implements ISymbolInternal.DeclaringCompilation
VisualBasicExtensions.vb (5)
725Public Function RootNamespace(compilation As Compilation) As INamespaceSymbol 740Public Function AliasImports(compilation As Compilation) As ImmutableArray(Of IAliasSymbol) 755Public Function MemberImports(compilation As Compilation) As ImmutableArray(Of INamespaceOrTypeSymbol) 772Public Function ClassifyConversion(compilation As Compilation, source As ITypeSymbol, destination As ITypeSymbol) As Conversion 788Public Function GetSpecialType(compilation As Compilation, typeId As SpecialType) As INamedTypeSymbol
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (11)
src\Analyzers\VisualBasic\Analyzers\UseAutoProperty\VisualBasicUseAutoPropertyAnalyzer.vb (3)
29Protected Overrides Function SupportsReadOnlyProperties(compilation As Compilation) As Boolean 33Protected Overrides Function SupportsPropertyInitializer(compilation As Compilation) As Boolean 37Protected Overrides Function SupportsFieldExpression(compilation As Compilation) As Boolean
src\Analyzers\VisualBasic\Analyzers\UseCollectionInitializer\VisualBasicUseCollectionInitializerDiagnosticAnalyzer.vb (2)
35Protected Overrides Function AreCollectionInitializersSupported(compilation As Compilation) As Boolean 39Protected Overrides Function AreCollectionExpressionsSupported(compilation As Compilation) As Boolean
src\Analyzers\VisualBasic\Analyzers\UseIsNullCheck\VisualBasicUseIsNullCheckForReferenceEqualsDiagnosticAnalyzer.vb (2)
19Protected Overrides Function IsLanguageVersionSupported(compilation As Compilation) As Boolean 23Protected Overrides Function IsUnconstrainedGenericSupported(compilation As Compilation) As Boolean
src\Analyzers\VisualBasic\Analyzers\UseNullPropagation\VisualBasicUseNullPropagationDiagnosticAnalyzer.vb (1)
33Protected Overrides Function ShouldAnalyze(compilation As Compilation) As Boolean
src\Analyzers\VisualBasic\Analyzers\UseObjectInitializer\VisualBasicUseObjectInitializerDiagnosticAnalyzer.vb (1)
27Protected Overrides Function AreObjectInitializersSupported(compilation As Compilation) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (1)
275Public Function GetLocalFunctionSymbols(compilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As ImmutableArray(Of IMethodSymbol) Implements ISemanticFacts.GetLocalFunctionSymbols
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (1)
608Protected Overrides Function IsReferenceConversion(compilation As Compilation, sourceType As ITypeSymbol, targetType As ITypeSymbol) As Boolean
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (10)
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
165Protected Overrides Function IsConversionImplicit(compilation As Compilation, sourceType As ITypeSymbol, targetType As ITypeSymbol) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (1)
162Protected Overrides Function IsImplicitReferenceConversion(compilation As Compilation, sourceType As ITypeSymbol, targetType As ITypeSymbol) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ITypeSymbolExtensions.vb (1)
59Public Function GetTypeFromPredefinedCastKeyword(compilation As Compilation, castKeyword As SyntaxKind) As ITypeSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb (2)
11Public Function IsMyNamespace(symbol As ISymbol, compilation As Compilation) As Boolean 23Public Function IsMyFormsProperty(symbol As ISymbol, compilation As Compilation) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicAddImportsService.vb (1)
51Protected Overrides Function GetGlobalImports(compilation As Compilation, generator As SyntaxGenerator) As ImmutableArray(Of SyntaxNode)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (3)
235Return CreateResult(Compilation.GetSpecialType(SpecialType.System_Int32)) 282Return CreateResult(Compilation.GetSpecialType(SpecialType.System_Int32)) 665Return CreateResult(type.Construct(Compilation.GetSpecialType(SpecialType.System_Object)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb (1)
10Public Function FindRelatedExplicitlyDeclaredSymbol(symbol As ISymbol, compilation As Compilation) As ISymbol
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (1)
CommandLineTests.vb (1)
9683dir.CopyFile(GetType(Compilation).Assembly.Location)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
Utilities\NamedTypeSymbolExtensions.vb (1)
14Public Function IsDesignerGeneratedTypeWithInitializeComponent(type As INamedTypeSymbol, compilation As Compilation) As Boolean
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (22)
Attributes\AssemblyAttributes.vb (1)
1265Private Shared Function CreateTestModuleBuilder(compilation As Compilation) As PEModuleBuilder
Attributes\InternalsVisibleToAndStrongNameTests.vb (3)
55Private Shared Sub VerifySigned(comp As Compilation, Optional expectedToBeSigned As Boolean = True) 130Dim comp As Compilation = CreateCompilationWithMscorlib40({syntaxTree}, options:=TestOptions.SigningReleaseDll) 1955Public Sub PublicSignCore(compilation As Compilation, Optional assertNoDiagnostics As Boolean = True)
CodeGen\CodeGenTuples.vb (6)
14849Assert.Equal("15", Compilation.GetRequiredLanguageVersion(comp.GetDiagnostics()(0))) 14850Assert.Null(Compilation.GetRequiredLanguageVersion(comp.GetDiagnostics()(2))) 14851Assert.Throws(Of ArgumentNullException)(Sub() Compilation.GetRequiredLanguageVersion(Nothing)) 22528Private Sub FailedDecodingOfTupleNamesWhenMissingValueTupleType_Verify(compilation As Compilation, successfulDecoding As Boolean) 22616Private Sub FailedDecodingOfTupleNamesWhenMissingContainerType_Verify(compilation As Compilation, decodingSuccessful As Boolean) 22639Dim getReference As Func(Of Compilation, MetadataReference) = Function(c) If(useImageReferences, c.EmitToImageReference(), c.ToMetadataReference())
Emit\CompilationEmitTests.vb (5)
1467Dim comp As Compilation = CreateEmptyCompilation(source, references:={MscorlibRef}, 1585Dim comp As Compilation = CreateEmptyCompilation(source, references:={MscorlibRef}, 1663Dim comp As Compilation = CreateEmptyCompilation(source, references:={MscorlibRef}, 1730Dim comp As Compilation = CreateEmptyCompilation(source, references:={MscorlibRef}, 2034Dim c As Compilation = CreateCompilationWithMscorlib40AndVBRuntime(source)
Emit\DynamicAnalysis\DynamicInstrumentationTests.vb (1)
2810Private Function CreateCompilation(source As XElement) As Compilation
Emit\EditAndContinue\EditAndContinueTest.vb (1)
40Protected Overrides Function CreateCompilation(tree As SyntaxTree) As Compilation
Emit\EditAndContinue\EditAndContinueTestBase.vb (3)
39Public Shared Function CreateInitialBaseline(compilation As Compilation, [module] As ModuleMetadata, debugInformationProvider As Func(Of MethodDefinitionHandle, EditAndContinueMethodDebugInformation)) As EmitBaseline 57symbolProvider As Func(Of Compilation, ISymbol), 58Optional newSymbolProvider As Func(Of Compilation, ISymbol) = Nothing,
Emit\ResourceTests.vb (1)
694Dim c1 As Compilation = CreateCompilationWithMscorlib40AndVBRuntime(
PDB\PDBTests.vb (1)
4745Dim compilerAssembly = GetType(Compilation).Assembly
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
Binders\PlaceholderLocalBinder.vb (1)
73Dim type = Compilation.GetSpecialType(If(specialType = SpecialType.None, SpecialType.System_Object, specialType))
Microsoft.CodeAnalysis.VisualBasic.Features (20)
Completion\CompletionProviders\CompletionListTagCompletionProvider.vb (1)
71Private Shared Function GetCompletionListType(inferredType As ITypeSymbol, within As INamedTypeSymbol, compilation As Compilation, cancellationToken As CancellationToken) As ITypeSymbol
ConvertToInterpolatedString\VisualBasicConvertConcatenationToInterpolatedStringRefactoringProvider.vb (1)
21Protected Overrides Function SupportsInterpolatedStringHandler(compilation As Compilation) As Boolean
ExtractMethod\VisualBasicMethodExtractor.Analyzer.vb (1)
30compilation As Compilation, symbol As ISymbol,
GenerateType\VisualBasicGenerateTypeService.vb (1)
422Protected Overrides Function IsConversionImplicit(compilation As Compilation, sourceType As ITypeSymbol, targetType As ITypeSymbol) As Boolean
InitializeParameter\InitializeParameterHelpers.vb (1)
39Public Shared Function IsImplicitConversion(compilation As Compilation, source As ITypeSymbol, destination As ITypeSymbol) As Boolean
InitializeParameter\VisualBasicAddParameterCheckCodeRefactoringProvider.vb (1)
44Protected Overrides Function IsImplicitConversion(compilation As Compilation, source As ITypeSymbol, destination As ITypeSymbol) As Boolean
InitializeParameter\VisualBasicInitializeMemberFromParameterCodeRefactoringProvider.vb (1)
40Protected Overrides Function IsImplicitConversion(compilation As Compilation, source As ITypeSymbol, destination As ITypeSymbol) As Boolean
MetadataAsSource\VisualBasicMetadataAsSourceService.vb (1)
28Protected Overrides Async Function AddAssemblyInfoRegionAsync(document As Document, symbolCompilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As Task(Of Document)
src\Analyzers\VisualBasic\Analyzers\UseAutoProperty\VisualBasicUseAutoPropertyAnalyzer.vb (3)
29Protected Overrides Function SupportsReadOnlyProperties(compilation As Compilation) As Boolean 33Protected Overrides Function SupportsPropertyInitializer(compilation As Compilation) As Boolean 37Protected Overrides Function SupportsFieldExpression(compilation As Compilation) As Boolean
src\Analyzers\VisualBasic\Analyzers\UseCollectionInitializer\VisualBasicUseCollectionInitializerDiagnosticAnalyzer.vb (2)
35Protected Overrides Function AreCollectionInitializersSupported(compilation As Compilation) As Boolean 39Protected Overrides Function AreCollectionExpressionsSupported(compilation As Compilation) As Boolean
src\Analyzers\VisualBasic\Analyzers\UseIsNullCheck\VisualBasicUseIsNullCheckForReferenceEqualsDiagnosticAnalyzer.vb (2)
19Protected Overrides Function IsLanguageVersionSupported(compilation As Compilation) As Boolean 23Protected Overrides Function IsUnconstrainedGenericSupported(compilation As Compilation) As Boolean
src\Analyzers\VisualBasic\Analyzers\UseNullPropagation\VisualBasicUseNullPropagationDiagnosticAnalyzer.vb (1)
33Protected Overrides Function ShouldAnalyze(compilation As Compilation) As Boolean
src\Analyzers\VisualBasic\Analyzers\UseObjectInitializer\VisualBasicUseObjectInitializerDiagnosticAnalyzer.vb (1)
27Protected Overrides Function AreObjectInitializersSupported(compilation As Compilation) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
165Protected Overrides Function IsConversionImplicit(compilation As Compilation, sourceType As ITypeSymbol, targetType As ITypeSymbol) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (1)
162Protected Overrides Function IsImplicitReferenceConversion(compilation As Compilation, sourceType As ITypeSymbol, targetType As ITypeSymbol) As Boolean
UseAutoProperty\VisualBasicUseAutoPropertyCodeFixProvider.vb (1)
49compilation As Compilation,
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (8)
EditAndContinue\Helpers\EditingTestBase.vb (8)
149symbolProvider As Func(Of Compilation, ISymbol), 153Optional deletedSymbolContainerProvider As Func(Of Compilation, ISymbol) = Nothing) As SemanticEditDescription 158symbolProvider As Func(Of Compilation, ISymbol), 162Optional deletedSymbolContainerProvider As Func(Of Compilation, ISymbol) = Nothing) As SemanticEditDescription 166If(partialType Is Nothing, Nothing, Function(c As Compilation) CType(c.GetMember(partialType), ITypeSymbol)), 174symbolProvider As Func(Of Compilation, ISymbol), 177Optional deletedSymbolContainerProvider As Func(Of Compilation, ISymbol) = Nothing) As SemanticEditDescription 181If(partialType Is Nothing, Nothing, Function(c As Compilation) CType(c.GetMember(partialType), ITypeSymbol)),
Microsoft.CodeAnalysis.VisualBasic.Scripting (1)
VisualBasicScriptCompiler.vb (1)
50Public Overrides Function CreateSubmission(script As Script) As Compilation
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (2)
InteractiveSessionTests.vb (2)
155Function lookupType(c As Compilation, name As String) As INamedTypeSymbol 158Function lookupMember(c As Compilation, typeName As String, memberName As String) As ISymbol
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (82)
Compilation\CompilationAPITests.vb (11)
323Dim comp = DirectCast(VisualBasicCompilation.Create("compilation", Nothing, Nothing, Nothing), Compilation) 565Dim c2 As Compilation = compCollection1.WithReferences(hs1) 571Dim c3 As Compilation = compCollection1.WithReferences(ref1, ref2, ref3) 1510Dim comp = DirectCast(VisualBasicCompilation.Create(""), Compilation) 1535Dim comp = DirectCast(VisualBasicCompilation.Create(""), Compilation) 1676Dim comp = DirectCast(CreateCompilation(""), Compilation) 1705Dim comp = DirectCast(VisualBasicCompilation.Create(""), Compilation) 1714Dim comp = DirectCast(CreateCompilation(""), Compilation) 1940Dim comp = DirectCast(CreateCompilation(source), Compilation) 1972Dim comp = DirectCast(CreateCompilation(source), Compilation) 2503Dim comp As Compilation = CreateCompilation("")
Diagnostics\DiagnosticAnalyzerTests.vb (7)
1157Private Shared Sub VerifyGeneratedCodeAnalyzerDiagnostics(compilation As Compilation, isGeneratedFileName As Func(Of String, Boolean), generatedCodeAnalysisFlagsOpt As GeneratedCodeAnalysisFlags?) 1162Private Shared Sub VerifyGeneratedCodeAnalyzerDiagnostics(compilation As Compilation, expected As DiagnosticDescription(), generatedCodeAnalysisFlagsOpt As GeneratedCodeAnalysisFlags?, Optional testIsGeneratedCodeInCallbacks As Boolean = False) 1167Private Shared Function GetExpectedGeneratedCodeAnalyzerDiagnostics(compilation As Compilation, isGeneratedFileName As Func(Of String, Boolean), generatedCodeAnalysisFlagsOpt As GeneratedCodeAnalysisFlags?) As DiagnosticDescription() 1460Private Shared Sub TestFieldReferenceAnalyzer_InAttributes_Core(comp As Compilation, doOperationBlockAnalysis As Boolean) 1615Private Shared Sub verifyFlowGraphs(compilation As Compilation, flowGraphs As ImmutableArray(Of (Graph As ControlFlowGraph, AssociatedSymbol As ISymbol)), expectedFlowGraphs As String()) 1690Dim compilation As Compilation = CreateCompilation({tree}) 1710Public Overrides Function GetSemanticModel(tree As SyntaxTree, compilation As Compilation, Optional options As SemanticModelOptions = SemanticModelOptions.None) As SemanticModel
Semantics\AccessCheckTests.vb (1)
719Dim compilation As Compilation = c
Semantics\GetSemanticInfoTests.vb (1)
6393DirectCast(compilation, Compilation).GetSpecialType(type)
Semantics\NativeIntegerTests.vb (1)
21Dim comp As Compilation = CreateCSharpCompilation(source0, parseOptions:=New CSharp.CSharpParseOptions(CSharp.LanguageVersion.CSharp9))
SourceGeneration\GeneratorDriverTests.vb (36)
30Dim outputCompilation As Compilation = Nothing 45Dim compilation As Compilation = GetCompilation(parseOptions) 54Dim outputCompilation As Compilation = Nothing 64Dim compilation As Compilation = GetCompilation(parseOptions) 68Dim outputCompilation As Compilation = Nothing 92Dim compilation As Compilation = GetCompilation(parseOptions, source) 96Dim outputCompilation As Compilation = Nothing 112Dim compilation As Compilation = GetCompilation(parseOptions) 119Dim outputCompilation As Compilation = Nothing 128Dim compilation As Compilation = GetCompilation(parseOptions) 135Dim outputCompilation As Compilation = Nothing 145Dim compilation As Compilation = GetCompilation(parseOptions) 151Dim outputCompilation As Compilation = Nothing 160Dim compilation As Compilation = GetCompilation(parseOptions) 182Dim compilation As Compilation = GetCompilation(TestOptions.Regular) 297Dim compilation As Compilation = GetCompilation(parseOptions) 327Dim compilation As Compilation = GetCompilation(parseOptions) 359Dim compilation As Compilation = GetCompilation(parseOptions) 388Dim compilation As Compilation = GetCompilation(parseOptions) 419Dim compilation As Compilation = GetCompilation(parseOptions, sourcePath:="/original") 449Dim compilation As Compilation = GetCompilation(parseOptions, sourcePath:="/original") 480Dim compilation As Compilation = GetCompilation(parseOptions, sourcePath:="/original") 509Dim compilation As Compilation = GetCompilation(parseOptions, sourcePath:="/original") 539Dim compilation As Compilation = GetCompilation(parseOptions) 569Dim compilation As Compilation = GetCompilation(parseOptions) 598Dim compilation As Compilation = GetCompilation(parseOptions) 602Dim outputCompilation As Compilation = Nothing 616Dim compilation As Compilation = GetCompilation(parseOptions) 620Dim outputCompilation As Compilation = Nothing 632Shared Function GetCompilation(parseOptions As VisualBasicParseOptions, Optional source As String = "", Optional sourcePath As String = "") As Compilation 640Dim compilation As Compilation = CreateCompilation(BasicTestSource.Parse(source, sourcePath, parseOptions), options:=TestOptions.DebugDll) 647Shared Sub VerifyDiagnosticsWithOptions(generator As ISourceGenerator, compilation As Compilation, ParamArray expected As DiagnosticDescription()) 654Dim outputCompilation As Compilation = Nothing 665Dim compilation As Compilation = CreateCompilation(source) 681Dim outputCompilation As Compilation = Nothing 716Dim outputCompilation As Compilation = Nothing
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.vb (25)
74Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 115Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 158Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 186Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 215Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 243Dim compilation As Compilation = CreateCompilation({source1, source2}, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 272Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 301Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 330Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 359Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 390Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 433Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 474Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 514Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 553Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 592Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 632Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 889Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 936Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 983Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 1026Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 1075Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 1130Dim compilation As Compilation = CreateCompilation({source1, source2}, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 1186Dim compilation As Compilation = CreateCompilation(source, options:=TestOptions.DebugDll, parseOptions:=parseOptions) 1242Dim compilation As Compilation = CreateCompilation({source1, source2}, options:=TestOptions.DebugDll, parseOptions:=parseOptions)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (37)
SymbolDisplay\SymbolDisplayTests.vb (1)
5347Private Shared Sub RefReturnInternal(comp As Compilation)
SymbolsTests\CorLibrary\CorTypes.vb (2)
194Assert.Throws(Of ArgumentOutOfRangeException)(Function() DirectCast(c1, Compilation).GetSpecialType(SpecialType.None)) 196Assert.Throws(Of ArgumentOutOfRangeException)(Function() DirectCast(c1, Compilation).GetSpecialType(CType(SpecialType.Count + 1, SpecialType)))
SymbolsTests\DefaultInterfaceImplementationTests.vb (1)
11084Assert.True(DirectCast(comp1, Compilation).IsSymbolAccessibleWithin(symbol:=comp1.GetMember("I1.M1"),
SymbolsTests\Metadata\MetadataMemberTests.vb (1)
716Dim mtdata = DirectCast(comp1, Compilation).EmitToArray(options:=New EmitOptions(metadataOnly:=True))
SymbolsTests\ParamsCollectionTests.vb (2)
77Dim m1 = DirectCast(csCompilation, Compilation).GetTypeByMetadataName("C1").GetMembers().Where(Function(s) s.Name = "M1").Single() 78Dim m2 = DirectCast(csCompilation, Compilation).GetTypeByMetadataName("C1").GetMembers().Where(Function(s) s.Name = "M2").Single()
SymbolsTests\Source\OverridesTests.vb (1)
6725Private Sub AssertOverridingProperty(compilation As Compilation)
UsedAssembliesTests.vb (29)
71Dim comp2 As Compilation = AssertUsedAssemblyReferences(source2, reference) 76Dim comp2 As Compilation = AssertUsedAssemblyReferences(source2, {reference0, reference1}, reference1) 80Private Sub AssertUsedAssemblyReferences(comp As Compilation, expected As MetadataReference(), before As XElement, after As XElement, specificReferencesToAssert As MetadataReference()) 110Private Sub AssertUsedAssemblyReferences(comp As Compilation, ParamArray expected As MetadataReference()) 114Private Sub AssertUsedAssemblyReferences(comp As Compilation, expected As MetadataReference(), specificReferencesToAssert As MetadataReference()) 118Private Function AssertUsedAssemblyReferences(source As BasicTestSource, references As MetadataReference(), ParamArray expected As MetadataReference()) As Compilation 119Dim comp As Compilation = CreateCompilation(source, references:=references) 124Private Function AssertUsedAssemblyReferences(source As BasicTestSource, ParamArray references As MetadataReference()) As Compilation 129Dim comp As Compilation = CreateCompilation(source, references:=references) 142Dim comp As Compilation = CreateEmptyCompilation(source, 149Private Function CompileWithUsedAssemblyReferences(comp As Compilation, Optional expectedOutput As String = Nothing, Optional specificReferencesToAssert As MetadataReference() = Nothing) As ImmutableArray(Of MetadataReference) 222Dim comp2 As Compilation = CreateEmptyCompilation(source2, references:={reference, SystemCoreRef, SystemDrawingRef}) 256Dim comp2 As Compilation = CreateEmptyCompilation(source2, references:={reference, SystemCoreRef, SystemDrawingRef}) 379Dim comp2 As Compilation = AssertUsedAssemblyReferences(source2, reference0, reference1) 479Private Function Verify2_FieldReference_03(Of TAssemblySymbol As AssemblySymbol)(source2 As BasicTestSource, reference0 As MetadataReference, reference1 As MetadataReference) As Compilation 480Dim comp2 As Compilation = AssertUsedAssemblyReferences(source2, {reference0, reference1}, reference0) 486Dim comp3 As Compilation = AssertUsedAssemblyReferences(source3, references) 927Dim comp2 As Compilation = CreateCompilation(source, references:=references, parseOptions:=TestOptions.Regular.WithDocumentationMode(DocumentationMode.None)) 932Dim comp3 As Compilation = CreateCompilation(source, references:=references, parseOptions:=TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)) 2040Dim comp As Compilation = CreateCompilation(source, references:={reference}, options:=TestOptions.DebugDll.WithGlobalImports(globalImports)) 3476Dim comp2 As Compilation = CreateCompilation(source, references:=references, parseOptions:=TestOptions.Regular.WithDocumentationMode(DocumentationMode.None)) 3479Dim comp3 As Compilation = CreateCompilation(source, references:=references, parseOptions:=TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)) 3905Dim comp As Compilation = CreateCompilation(source, references:=useReferences, parseOptions:=TestOptions.Regular.WithDocumentationMode(DocumentationMode.None)) 3917Dim comp3 As Compilation = CreateCompilation(source, references:=useReferences, parseOptions:=TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)) 3920Dim comp4 As Compilation = CreateCompilation(source, references:=useReferences, parseOptions:=TestOptions.Regular.WithDocumentationMode(DocumentationMode.Diagnose)) 4087Dim comp As Compilation = CreateCompilation(source, references:=useReferences, parseOptions:=TestOptions.Regular.WithDocumentationMode(DocumentationMode.None)) 4103Dim comp3 As Compilation = CreateCompilation(source, references:=useReferences, parseOptions:=TestOptions.Regular.WithDocumentationMode(DocumentationMode.Parse)) 4106Dim comp4 As Compilation = CreateCompilation(source, references:=useReferences, parseOptions:=TestOptions.Regular.WithDocumentationMode(DocumentationMode.Diagnose)) 4738Dim getReference As Func(Of Compilation, MetadataReference) = Function(c) If(useImageReferences, c.EmitToImageReference(), c.ToMetadataReference())
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (44)
BasicTestBase.vb (8)
64compilation As Compilation, 95compilation As Compilation, 804Optional useLatestFrameworkReferences As Boolean = False) As (tree As String, syntax As SyntaxNode, operation As IOperation, compilation As Compilation) 815Friend Shared Sub VerifyOperationTreeForTest(Of TSyntaxNode As SyntaxNode)(compilation As VisualBasicCompilation, fileName As String, expectedOperationTree As String, Optional which As Integer = 0, Optional additionalOperationTreeVerifier As Action(Of IOperation, Compilation, SyntaxNode) = Nothing) 841Optional additionalOperationTreeVerifier As Action(Of IOperation, Compilation, SyntaxNode) = Nothing, 862Friend Shared Sub VerifyOperationTreeAndDiagnosticsForTest(Of TSyntaxNode As SyntaxNode)(compilation As VisualBasicCompilation, fileName As String, expectedOperationTree As String, expectedDiagnostics As String, Optional which As Integer = 0, Optional additionalOperationTreeVerifier As Action(Of IOperation, Compilation, SyntaxNode) = Nothing) 880Optional additionalOperationTreeVerifier As Action(Of IOperation, Compilation, SyntaxNode) = Nothing, 916Friend Shared Function GetOperationAndSyntaxForTest(Of TSyntaxNode As SyntaxNode)(compilation As Compilation, fileName As String, Optional which As Integer = 0) As (operation As IOperation, syntaxNode As SyntaxNode)
CompilationTestUtils.vb (20)
424Public Function FindBindingText(Of TNode As SyntaxNode)(compilation As Compilation, Optional fileName As String = Nothing, Optional which As Integer = 0, Optional prefixMatch As Boolean = False) As TNode 460Public Function FindBindingTextPosition(compilation As Compilation, fileName As String, ByRef bindText As String, Optional which As Integer = 0) As Integer 499Public Function FindBindingTextPosition(compilation As Compilation, fileName As String) As Integer 504Public Function FindBindingStartText(Of TNode As SyntaxNode)(compilation As Compilation, fileName As String, Optional which As Integer = 0) As TNode 605Public Function GetSemanticInfoSummary(compilation As Compilation, node As SyntaxNode) As SemanticInfoSummary 611Public Function GetSemanticInfoSummary(Of TSyntax As SyntaxNode)(compilation As Compilation, fileName As String, Optional which As Integer = 0) As SemanticInfoSummary 616Public Function GetPreprocessingSymbolInfo(compilation As Compilation, fileName As String, Optional which As Integer = 0) As VisualBasicPreprocessingSymbolInfo 622Public Function GetSemanticModel(compilation As Compilation, fileName As String) As VBSemanticModel 687Public Function GetTree(compilation As Compilation, name As String) As SyntaxTree 756Public Sub AssertNoErrors(compilation As Compilation) 801Public Sub AssertTheseCompileDiagnostics(compilation As Compilation, Optional errs As XElement = Nothing, Optional suppressInfos As Boolean = True) 817Public Sub AssertTheseEmitDiagnostics(compilation As Compilation, Optional errs As XElement = Nothing, Optional suppressInfos As Boolean = True) 843Public Sub AssertTheseDiagnostics(compilation As Compilation, Optional errs As XElement = Nothing, Optional suppressInfos As Boolean = True) 851Public Sub AssertTheseDiagnostics(compilation As Compilation, errs As XCData, Optional suppressInfos As Boolean = True) 857Public Sub AssertTheseDiagnostics(compilation As Compilation, errs As String, Optional suppressInfos As Boolean = True) 1083Public Function GetTypeSymbol(compilation As Compilation, 1097Public Function GetEnumSymbol(compilation As Compilation, 1111Public Function GetDelegateSymbol(compilation As Compilation, 1125Public Function GetTypeSymbol(compilation As Compilation, 1169Public Function VerifyGlobalNamespace(compilation As Compilation,
Extensions.vb (5)
17Public Function GetReferencedAssemblySymbol(compilation As Compilation, reference As MetadataReference) As AssemblySymbol 22Public Function GetReferencedModuleSymbol(compilation As Compilation, reference As MetadataReference) As ModuleSymbol 37Public Function GetMember(comp As Compilation, qualifiedName As String) As Symbol 42Public Function GetMember(Of T As Symbol)(comp As Compilation, qualifiedName As String) As T 47Public Function GetMembers(comp As Compilation, qualifiedName As String) As ImmutableArray(Of Symbol)
MockVisualBasicCompiler.vb (3)
18Public Compilation As Compilation 69Public Overloads Function CreateCompilation(consoleOutput As TextWriter, touchedFilesLogger As TouchedFileLogger, errorLogger As ErrorLogger, syntaxTreeDiagnosticOptionsOpt As ImmutableArray(Of AnalyzerConfigOptionsResult)) As Compilation 73Public Overrides Function CreateCompilation(consoleOutput As TextWriter, touchedFilesLogger As TouchedFileLogger, errorLogger As ErrorLogger, syntaxTreeDiagnosticOptionsOpt As ImmutableArray(Of AnalyzerConfigOptionsResult), globalConfigOptions As AnalyzerConfigOptionsResult) As Compilation
SemanticModelTestBase.vb (8)
28Protected Function FindBindingText(Of TNode As SyntaxNode)(compilation As Compilation, fileName As String, Optional which As Integer = 0) As TNode 47Private Function FindBindingTextPosition(compilation As Compilation, fileName As String, ByRef bindText As String, Optional which As Integer = 0) As Integer 64Protected Function FindBindingTextPosition(compilation As Compilation, fileName As String) As Integer 69Protected Function FindBindingStartText(Of TNode As SyntaxNode)(compilation As Compilation, fileName As String, Optional which As Integer = 0) As TNode 94Friend Function GetAliasInfoForTest(compilation As Compilation, fileName As String, Optional which As Integer = 0) As AliasSymbol 101Protected Function GetBlockOrStatementInfoForTest(Of StmtSyntax As SyntaxNode)(compilation As Compilation, fileName As String, Optional which As Integer = 0, Optional useParent As Boolean = False) As Object 119Friend Function GetLookupNames(compilation As Compilation, filename As String, Optional container As NamespaceOrTypeSymbol = Nothing) As List(Of String) 126Friend Function GetLookupSymbols(compilation As Compilation, filename As String, Optional container As NamespaceOrTypeSymbol = Nothing, Optional name As String = Nothing, Optional arity As Integer? = Nothing, Optional includeReducedExtensionMethods As Boolean = False, Optional mustBeStatic As Boolean = False) As List(Of ISymbol)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (15)
Diagnostics\VisualBasicDiagnosticPropertiesService.vb (2)
14Private Shared ReadOnly s_compilation As Compilation = VisualBasicCompilation.Create("empty") 21Protected Overrides Function GetCompilation() As Compilation
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (1)
275Public Function GetLocalFunctionSymbols(compilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As ImmutableArray(Of IMethodSymbol) Implements ISemanticFacts.GetLocalFunctionSymbols
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (1)
608Protected Overrides Function IsReferenceConversion(compilation As Compilation, sourceType As ITypeSymbol, targetType As ITypeSymbol) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ITypeSymbolExtensions.vb (1)
59Public Function GetTypeFromPredefinedCastKeyword(compilation As Compilation, castKeyword As SyntaxKind) As ITypeSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb (2)
11Public Function IsMyNamespace(symbol As ISymbol, compilation As Compilation) As Boolean 23Public Function IsMyFormsProperty(symbol As ISymbol, compilation As Compilation) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicAddImportsService.vb (1)
51Protected Overrides Function GetGlobalImports(compilation As Compilation, generator As SyntaxGenerator) As ImmutableArray(Of SyntaxNode)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (3)
235Return CreateResult(Compilation.GetSpecialType(SpecialType.System_Int32)) 282Return CreateResult(Compilation.GetSpecialType(SpecialType.System_Int32)) 665Return CreateResult(type.Construct(Compilation.GetSpecialType(SpecialType.System_Object)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb (1)
10Public Function FindRelatedExplicitlyDeclaredSymbol(symbol As ISymbol, compilation As Compilation) As ISymbol
Utilities\IntrinsicOperators\PredefinedCastExpressionDocumentation.vb (1)
12Public Sub New(keywordKind As SyntaxKind, compilation As Compilation)
Workspace\LanguageServices\VisualBasicCompilationFactoryService.vb (2)
25options As CompilationOptions) As Compilation Implements ICompilationFactoryService.CreateCompilation 35hostObjectType As Type) As Compilation Implements ICompilationFactoryService.CreateSubmissionCompilation
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.vb (1)
37Public Shared Function Compile(code As String) As Compilation
Microsoft.CodeAnalysis.Workspaces (309)
Diagnostics\AbstractDiagnosticPropertiesService.cs (3)
16protected abstract Compilation GetCompilation(); 20Compilation compilation) 23var requiredVersion = Compilation.GetRequiredLanguageVersion(diagnostic);
Diagnostics\CompilationWithAnalyzersPair.cs (2)
38public Compilation? ProjectCompilation => _projectCompilationWithAnalyzers?.Compilation; 40public Compilation? HostCompilation => _hostCompilationWithAnalyzers?.Compilation;
Diagnostics\Extensions.cs (3)
107Compilation compilation, 241Compilation compilation, 259Compilation compilation,
Editing\SymbolEditor.cs (1)
153var comp = await solution.GetProject(projectId).GetCompilationAsync(cancellationToken).ConfigureAwait(false);
FindSymbols\Declarations\DeclarationFinder.cs (1)
55var compilation = await project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\DependentProjectsFinder.cs (5)
209var compilation = await project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 210var previous = compilation.ScriptCompilationInfo?.PreviousScriptCompilation; 363var compilation = CreateCompilation(project); 395static Compilation CreateCompilation(Project project) 398if (project.TryGetCompilation(out var compilation))
FindSymbols\FindReferences\DependentTypeFinder.cs (2)
298var compilation = await project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 334Compilation compilation,
FindSymbols\ReferenceLocationExtensions.cs (1)
31var compilation = await project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
FindSymbols\SymbolFinder.cs (3)
172if (sourceProject.TryGetCompilation(out var compilation) && 190if (project?.TryGetCompilation(out var projectCompilation) is true) 217public static IEnumerable<TSymbol> FindSimilarSymbols<TSymbol>(TSymbol symbol, Compilation compilation, CancellationToken cancellationToken = default)
FindSymbols\SymbolFinder_Declarations_CustomQueries.cs (1)
105var compilation = await project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
FindSymbols\SymbolFinder_Helpers.cs (2)
157/// <paramref name="forwardedTo"/>'s <see cref="Compilation"/>. 169var forwardedToCompilation = solution.GetOriginatingCompilation(forwardedTo);
FindSymbols\SymbolTree\SymbolTreeInfo.cs (1)
498string baseTypeName, Compilation compilation, CancellationToken cancellationToken)
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (1)
121var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
ReassignedVariable\AbstractReassignedVariableService.cs (1)
45var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
Remote\IRemoteKeepAliveService.cs (1)
20/// cref="Compilation"/>s) will stay alive as well.
Remote\RemoteArguments.cs (1)
104var compilation = await project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
477var compilation = await currentProject.GetRequiredCompilationAsync(_cancellationToken).ConfigureAwait(false);
Shared\Extensions\ISolutionExtensions.cs (1)
29var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Shared\Extensions\ISymbolExtensions.cs (9)
38Compilation compilation, 54Compilation compilation, 221public static DocumentationComment GetDocumentationComment(this ISymbol symbol, Compilation compilation, CultureInfo? preferredCulture = null, bool expandIncludes = false, bool expandInheritdoc = false, CancellationToken cancellationToken = default) 224private static DocumentationComment GetDocumentationComment(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, CultureInfo? preferredCulture, bool expandIncludes, bool expandInheritdoc, CancellationToken cancellationToken) 297private static XNode[] RewriteInheritdocElements(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode node, CancellationToken cancellationToken) 334private static XNode[] RewriteMany(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode[] nodes, CancellationToken cancellationToken) 345private static XNode[]? RewriteInheritdocElement(ISymbol memberSymbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XElement element, CancellationToken cancellationToken) 646this ImmutableArray<T> symbols, bool hideAdvancedMembers, Compilation compilation) where T : ISymbol 683this ImmutableArray<T> symbols, bool hideAdvancedMembers, Compilation compilation) where T : ISymbol
Shared\Extensions\ITypeSymbolExtensions.cs (1)
186public static bool CanBeAsynchronouslyEnumerated(this ITypeSymbol type, Compilation compilation)
Shared\Extensions\SyntaxGeneratorExtensions.cs (2)
59var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 248var compilation = await newDocument.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
Shared\Utilities\EditorBrowsableHelpers.cs (7)
14public readonly struct EditorBrowsableInfo(Compilation compilation) 16public Compilation Compilation { get; } = compilation; 32public static IMethodSymbol? GetSpecialEditorBrowsableAttributeConstructor(Compilation compilation) 62public static ImmutableArray<IMethodSymbol> GetSpecialTypeLibTypeAttributeConstructors(Compilation compilation) 70public static ImmutableArray<IMethodSymbol> GetSpecialTypeLibFuncAttributeConstructors(Compilation compilation) 78public static ImmutableArray<IMethodSymbol> GetSpecialTypeLibVarAttributeConstructors(Compilation compilation) 94Compilation compilation,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CompilationExtensions.cs (5)
12/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 33/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 36public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 73public static IMethodSymbol? GetTopLevelStatementsMethod(this Compilation compilation) 87public static INamedTypeSymbol? TryGetCallingConventionSymbol(this Compilation compilation, string callingConvention)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICompilationExtensions.cs (69)
23public static ImmutableArray<Compilation> GetReferencedCompilations(this Compilation compilation) 25var builder = ArrayBuilder<Compilation>.GetInstance(); 32var previous = compilation.ScriptCompilationInfo?.PreviousScriptCompilation; 42public static ImmutableArray<IAssemblySymbol> GetReferencedAssemblySymbols(this Compilation compilation, bool excludePreviousSubmissions = false) 54var previous = compilation.ScriptCompilationInfo?.PreviousScriptCompilation; 72public static INamedTypeSymbol? AttributeType(this Compilation compilation) 75public static INamedTypeSymbol? ExceptionType(this Compilation compilation) 78public static INamedTypeSymbol? DebuggerDisplayAttributeType(this Compilation compilation) 81public static INamedTypeSymbol? StructLayoutAttributeType(this Compilation compilation) 84public static INamedTypeSymbol? DesignerCategoryAttributeType(this Compilation compilation) 87public static INamedTypeSymbol? DesignerGeneratedAttributeType(this Compilation compilation) 90public static INamedTypeSymbol? HideModuleNameAttribute(this Compilation compilation) 93public static INamedTypeSymbol? ThreadStaticAttributeType(this Compilation compilation) 96public static INamedTypeSymbol? EventArgsType(this Compilation compilation) 99public static INamedTypeSymbol? NotImplementedExceptionType(this Compilation compilation) 102public static INamedTypeSymbol? EqualityComparerOfTType(this Compilation compilation) 105public static INamedTypeSymbol? ActionType(this Compilation compilation) 108public static INamedTypeSymbol? ExpressionOfTType(this Compilation compilation) 111public static INamedTypeSymbol? EditorBrowsableAttributeType(this Compilation compilation) 114public static INamedTypeSymbol? EditorBrowsableStateType(this Compilation compilation) 117public static INamedTypeSymbol? TaskType(this Compilation compilation) 120public static INamedTypeSymbol? TaskOfTType(this Compilation compilation) 123public static INamedTypeSymbol? ValueTaskType(this Compilation compilation) 126public static INamedTypeSymbol? ValueTaskOfTType(this Compilation compilation) 129public static INamedTypeSymbol? IEnumerableType(this Compilation compilation) 132public static INamedTypeSymbol? IEnumerableOfTType(this Compilation compilation) 135public static INamedTypeSymbol? IEnumeratorOfTType(this Compilation compilation) 138public static INamedTypeSymbol? IListOfTType(this Compilation compilation) 141public static INamedTypeSymbol? IReadOnlyListOfTType(this Compilation compilation) 144public static INamedTypeSymbol? IAsyncEnumerableOfTType(this Compilation compilation) 147public static INamedTypeSymbol? IAsyncEnumeratorOfTType(this Compilation compilation) 150public static INamedTypeSymbol? ImmutableArrayOfTType(this Compilation compilation) 153public static INamedTypeSymbol? SerializableAttributeType(this Compilation compilation) 156public static INamedTypeSymbol? CoClassType(this Compilation compilation) 159public static INamedTypeSymbol? ComAliasNameAttributeType(this Compilation compilation) 162public static INamedTypeSymbol? SuppressMessageAttributeType(this Compilation compilation) 165public static INamedTypeSymbol? TupleElementNamesAttributeType(this Compilation compilation) 168public static INamedTypeSymbol? NativeIntegerAttributeType(this Compilation compilation) 171public static INamedTypeSymbol? DynamicAttributeType(this Compilation compilation) 174public static INamedTypeSymbol? LazyOfTType(this Compilation compilation) 177public static INamedTypeSymbol? ISerializableType(this Compilation compilation) 180public static INamedTypeSymbol? SerializationInfoType(this Compilation compilation) 183public static INamedTypeSymbol? StreamingContextType(this Compilation compilation) 186public static INamedTypeSymbol? OnDeserializingAttribute(this Compilation compilation) 189public static INamedTypeSymbol? OnDeserializedAttribute(this Compilation compilation) 192public static INamedTypeSymbol? OnSerializingAttribute(this Compilation compilation) 195public static INamedTypeSymbol? OnSerializedAttribute(this Compilation compilation) 198public static INamedTypeSymbol? ComRegisterFunctionAttribute(this Compilation compilation) 201public static INamedTypeSymbol? ComUnregisterFunctionAttribute(this Compilation compilation) 204public static INamedTypeSymbol? ConditionalAttribute(this Compilation compilation) 207public static INamedTypeSymbol? ObsoleteAttribute(this Compilation compilation) 210public static INamedTypeSymbol? SystemCompositionImportingConstructorAttribute(this Compilation compilation) 213public static INamedTypeSymbol? SystemComponentModelCompositionImportingConstructorAttribute(this Compilation compilation) 216public static INamedTypeSymbol? SystemIDisposableType(this Compilation compilation) 219public static INamedTypeSymbol? NotNullAttribute(this Compilation compilation) 222public static INamedTypeSymbol? MaybeNullAttribute(this Compilation compilation) 225public static INamedTypeSymbol? MaybeNullWhenAttribute(this Compilation compilation) 228public static INamedTypeSymbol? AllowNullAttribute(this Compilation compilation) 231public static INamedTypeSymbol? DisallowNullAttribute(this Compilation compilation) 234public static INamedTypeSymbol? DataMemberAttribute(this Compilation compilation) 237public static INamedTypeSymbol? DataContractAttribute(this Compilation compilation) 240public static INamedTypeSymbol? AsyncMethodBuilderAttribute(this Compilation compilation) 243public static INamedTypeSymbol? CancellationTokenType(this Compilation compilation) 246public static INamedTypeSymbol? ValueTupleType(this Compilation compilation, int arity) 249public static INamedTypeSymbol? ListOfTType(this Compilation compilation) 252public static INamedTypeSymbol? ReadOnlySpanOfTType(this Compilation compilation) 255public static INamedTypeSymbol? SpanOfTType(this Compilation compilation) 258public static INamedTypeSymbol? InterpolatedStringHandlerAttributeType(this Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (1)
113public static bool IsAsyncReturningVoidTask(this IMethodSymbol method, Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
447Compilation compilation,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
478Compilation compilation,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
14private sealed class AnonymousTypeRemover(Compilation compilation) : SymbolVisitor<ITypeSymbol>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.CompilationTypeGenerator.cs (1)
11private sealed class CompilationTypeGenerator(Compilation compilation) : ITypeGenerator
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (7)
414public static INamedTypeSymbol? GetDelegateType(this ITypeSymbol? typeSymbol, Compilation compilation) 597public static bool IsOrDerivesFromExceptionType([NotNullWhen(returnValue: true)] this ITypeSymbol? type, Compilation compilation) 769Compilation compilation, 778Compilation compilation, 787Compilation compilation) 795Compilation compilation) 819Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
15private sealed class UnavailableTypeParameterRemover(Compilation compilation, ISet<string> availableTypeParameterNames) : SymbolVisitor<ITypeSymbol>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
14private sealed class UnnamedErrorTypeRemover(Compilation compilation) : SymbolVisitor<ITypeSymbol>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
401var compilation = firstBlock.SemanticModel!.Compilation;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (1)
107ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Simplification\SymbolAnnotation.cs (2)
20public static ISymbol? GetSymbol(SyntaxAnnotation annotation, Compilation compilation) 23public static ImmutableArray<ISymbol> GetSymbols(SyntaxAnnotation annotation, Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AssemblySymbolKey.cs (1)
26var compilation = reader.Compilation;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (2)
79var compilation = ((ISourceAssemblySymbol)symbol.ContainingAssembly).Compilation; 116Compilation compilation, SyntaxTree? syntaxTree,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (7)
157var compilation = ((ISourceAssemblySymbol)symbol.ContainingAssembly).Compilation; 165string symbolKey, Compilation compilation, 172string symbolKey, Compilation compilation, 179string symbolKey, Compilation compilation, bool ignoreAssemblyKey, 223Compilation compilation, bool ignoreAssemblyKey = false, CancellationToken cancellationToken = default) 231/// to the corresponding <see cref="ISymbol"/> in a future <see cref="Compilation"/>. 267private static bool Equals(Compilation compilation, string? name1, string? name2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (4)
327public Compilation Compilation { get; private set; } 357string data, Compilation compilation, 368Compilation compilation, 728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
108protected abstract bool IsReferenceConversion(Compilation model, ITypeSymbol sourceType, ITypeSymbol targetType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
19private static readonly ConditionalWeakTable<Compilation, TreeMap> s_treeAliasMap = new();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceSymbol.cs (1)
55public Compilation ContainingCompilation => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\KnownTypes.cs (1)
7internal readonly struct KnownTaskTypes(Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (2)
110public static async Task<Compilation> GetRequiredCompilationAsync(this Project project, CancellationToken cancellationToken) 112var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (12)
31this SyntaxGenerator codeDefinitionFactory, Compilation compilation) 38this SyntaxGenerator codeDefinitionFactory, Compilation compilation) 44private static SyntaxNode CreateNewNotImplementedException(SyntaxGenerator codeDefinitionFactory, Compilation compilation) 56this SyntaxGenerator codeDefinitionFactory, Compilation compilation) 76Compilation compilation, 87private static ITypeSymbol GetType(Compilation compilation, ISymbol symbol) 192this SyntaxGenerator generator, Compilation compilation, 216this SyntaxGenerator generator, Compilation compilation, 407this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter, SyntaxNode fieldAccess) 416public static SyntaxNode CreateThrowArgumentNullExpression(this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter) 419private static SyntaxNode CreateNewArgumentNullException(SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter) 451public static SyntaxNode CreateThrowArgumentNullExceptionStatement(this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (6)
35Compilation compilation, 49public static IMethodSymbol CreateEqualsMethod(this Compilation compilation, ImmutableArray<SyntaxNode> statements) 112Compilation compilation, 219SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, Compilation compilation, 274Compilation compilation, 323SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, Compilation compilation, ParseOptions parseOptions, SyntaxNode otherNameExpression, ArrayBuilder<SyntaxNode> expressions)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (3)
20Compilation compilation, 82Compilation compilation, 220Compilation compilation,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AbstractAddImportsService.cs (3)
31protected abstract ImmutableArray<SyntaxNode> GetGlobalImports(Compilation compilation, SyntaxGenerator generator); 55Compilation compilation, 131Compilation compilation,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\IAddImportsService.cs (3)
29bool HasExistingImport(Compilation compilation, SyntaxNode root, SyntaxNode? contextLocation, SyntaxNode import, SyntaxGenerator generator); 38Compilation compilation, SyntaxNode root, SyntaxNode? contextLocation, 45this IAddImportsService service, Compilation compilation, SyntaxNode root,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (2)
103protected static IMethodSymbol? FindDisposeMethod(Compilation compilation, ITypeSymbol? type, bool isAsync) 248public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
41protected Compilation Compilation => SemanticModel.Compilation;
Utilities\Documentation\DeferredDocumentationProvider.cs (2)
24internal sealed class DeferredDocumentationProvider(Compilation compilation) : DocumentationProvider 26private readonly Compilation _compilation = compilation.Clone();
Workspace\Host\CompilationFactory\ICompilationFactoryService.cs (2)
14Compilation CreateCompilation(string assemblyName, CompilationOptions options); 15Compilation CreateSubmissionCompilation(string assemblyName, CompilationOptions options, Type? hostObjectType);
Workspace\Solution\Document.cs (1)
352var compilation = await this.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
Workspace\Solution\Project.cs (6)
478/// Tries to get the cached <see cref="Compilation"/> for this project if it has already been created and is still cached. In almost all 479/// cases you should call <see cref="GetCompilationAsync"/> which will either return the cached <see cref="Compilation"/> 482public bool TryGetCompilation([NotNullWhen(returnValue: true)] out Compilation? compilation) 486/// Get the <see cref="Compilation"/> for this project asynchronously. 489/// Returns the produced <see cref="Compilation"/>, or <see langword="null"/> if <see 493public Task<Compilation?> GetCompilationAsync(CancellationToken cancellationToken = default)
Workspace\Solution\Solution.cs (2)
202/// Returns the <see cref="Compilation"/> that produced the symbol. In the case of a symbol that was retargetted 205internal Compilation? GetOriginatingCompilation(ISymbol symbol)
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (23)
48public abstract Compilation CompilationWithoutGeneratedDocuments { get; } 67public readonly Lazy<Compilation> LazyCompilationWithoutGeneratedDocuments; 75public readonly CancellableLazy<Compilation?> LazyStaleCompilationWithGeneratedDocuments; 83public override Compilation CompilationWithoutGeneratedDocuments => LazyCompilationWithoutGeneratedDocuments.Value; 87Lazy<Compilation> compilationWithoutGeneratedDocuments, 89CancellableLazy<Compilation?> staleCompilationWithGeneratedDocuments, 112Compilation compilationWithoutGeneratedDocuments, 114Compilation? staleCompilationWithGeneratedDocuments, 118new Lazy<Compilation>(() => compilationWithoutGeneratedDocuments), 126private static CancellableLazy<Compilation?> CreateLazyCompilation(Compilation? staleCompilationWithGeneratedDocuments) 133/// cref="Compilation"/> provided to any clients of the <see cref="SolutionState"/> (for example, through 138/// cref="Compilation"/>s from other <see cref="CompilationTrackerState"/>s are passed out, then these other 156/// cref="Compilation"/>, which in the <see cref="FinalCompilationTrackerState"/> case will be the 158/// source generators consumes <see cref="Compilation"/> which will avoid generators being ran a second 160/// not active, this is equal to <see cref="Compilation"/>. 162public readonly Compilation FinalCompilationWithGeneratedDocuments; 171public override Compilation CompilationWithoutGeneratedDocuments { get; } 176Compilation finalCompilationWithGeneratedDocuments, 177Compilation compilationWithoutGeneratedDocuments, 215Compilation finalCompilationWithGeneratedDocuments, 216Compilation compilationWithoutGeneratedDocuments, 250private static void RecordAssemblySymbols(ProjectId projectId, Compilation compilation, Dictionary<MetadataReference, ProjectId>? metadataReferenceToProjectId)
Workspace\Solution\SolutionCompilationState.cs (5)
39/// cref="Compilation"/>s or semantics. 1115public bool TryGetCompilation(ProjectId projectId, [NotNullWhen(returnValue: true)] out Compilation? compilation) 1131private Task<Compilation?> GetCompilationAsync(ProjectId projectId, CancellationToken cancellationToken) 1144public Task<Compilation?> GetCompilationAsync(ProjectState project, CancellationToken cancellationToken) 1148: SpecializedTasks.Null<Compilation>();
Workspace\Solution\SolutionCompilationState.ICompilationTracker.cs (9)
20/// Returns <see langword="true"/> if this <see cref="Project"/>/<see cref="Compilation"/> could produce the 25/// If <paramref name="primary"/> is true, then <see cref="Compilation.References"/> will not be considered 28/// return true if the symbol is <see cref="Compilation.Assembly"/>. If <paramref name="primary"/> is 29/// false, then it can return true if <paramref name="symbol"/> is <see cref="Compilation.Assembly"/> or any 30/// of the symbols returned by <see cref="Compilation.GetAssemblyOrModuleSymbol(MetadataReference)"/> for 31/// any of the references of the <see cref="Compilation.References"/>. 35[NotNullWhen(true)] out Compilation? compilation, 40Task<Compilation> GetCompilationAsync(SolutionCompilationState compilationState, CancellationToken cancellationToken); 73bool TryGetCompilation([NotNullWhen(true)] out Compilation? compilation);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (28)
35private static readonly CancellableLazy<Compilation?> s_lazyNullCompilation = new CancellableLazy<Compilation?>((Compilation?)null); 104[NotNullWhen(true)] out Compilation? compilation, 148FinalCompilationTrackerState finalState => (new Lazy<Compilation>(() => finalState.CompilationWithoutGeneratedDocuments), new CancellableLazy<Compilation?>(finalState.FinalCompilationWithGeneratedDocuments)), 196public bool TryGetCompilation([NotNullWhen(true)] out Compilation? compilation) 212public Task<Compilation> GetCompilationAsync(SolutionCompilationState compilationState, CancellationToken cancellationToken) 214if (this.TryGetCompilation(out var compilation)) 223return Task.FromCanceled<Compilation>(cancellationToken); 231private async Task<Compilation> GetCompilationSlowAsync( 306Constraint = "Avoid calling " + nameof(Compilation.AddSyntaxTrees) + " in a loop due to allocation overhead.")] 318var initialCompilation = this.CreateEmptyCompilation(); 333var compilationWithoutGeneratedDocuments = CreateEmptyCompilation(); 342new Lazy<Compilation>(CreateEmptyCompilation), 400async Task<(Compilation compilationWithoutGeneratedDocuments, Compilation? staleCompilationWithGeneratedDocuments, CompilationTrackerGeneratorInfo generatorInfo)> 406var compilationWithoutGeneratedDocuments = inProgressState.CompilationWithoutGeneratedDocuments; 407var staleCompilationWithGeneratedDocuments = inProgressState.LazyStaleCompilationWithGeneratedDocuments.GetValue(cancellationToken); 478var compilationWithoutGeneratedDocuments = inProgressState.CompilationWithoutGeneratedDocuments; 479var staleCompilationWithGeneratedDocuments = inProgressState.LazyStaleCompilationWithGeneratedDocuments.GetValue(cancellationToken); 549var inProgressCompilationNotRef = staleCompilationWithGeneratedDocuments ?? compilationWithoutGeneratedDocuments; 647private Compilation CreateEmptyCompilation() 782var lazyCompilationWithoutGeneratedDocuments = new Lazy<Compilation>(() => 794var lazyCompilationWithGeneratedDocuments = new CancellableLazy<Compilation?>(cancellationToken => lazyCompilationWithoutGeneratedDocuments.Value); 820var compilationWithGeneratedDocuments = new CancellableLazy<Compilation?>(cancellationToken => 936if (inProgressState.LazyStaleCompilationWithGeneratedDocuments.GetValue(CancellationToken.None) is Compilation staleCompilationWithGeneratedDocuments) 947private static void ValidateCompilationTreesMatchesProjectState(Compilation compilation, ProjectState projectState, CompilationTrackerGeneratorInfo? generatorInfo)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (13)
29private async Task<(Compilation compilationWithGeneratedFiles, CompilationTrackerGeneratorInfo nextGeneratorInfo)> AddExistingOrComputeNewGeneratorInfoAsync( 32Compilation compilationWithoutGeneratedFiles, 34Compilation? compilationWithStaleGeneratedTrees, 44var compilationWithGeneratedFiles = compilationWithoutGeneratedFiles.AddSyntaxTrees(generatedSyntaxTrees); 75private async Task<(Compilation compilationWithGeneratedFiles, TextDocumentStates<SourceGeneratedDocumentState> generatedDocuments)?> TryComputeNewGeneratorInfoInRemoteProcessAsync( 77Compilation compilationWithoutGeneratedFiles, 79Compilation? compilationWithStaleGeneratedTrees, 222var compilationWithGeneratedFiles = compilationWithoutGeneratedFiles.AddSyntaxTrees( 228private async Task<(Compilation compilationWithGeneratedFiles, TextDocumentStates<SourceGeneratedDocumentState> generatedDocuments, GeneratorDriver? generatorDriver)> ComputeNewGeneratorInfoInCurrentProcessAsync( 230Compilation compilationWithoutGeneratedFiles, 233Compilation? compilationWithStaleGeneratedTrees, 263var compilationToRunGeneratorsOn = compilationWithoutGeneratedFiles.RemoveSyntaxTrees(treesToRemove); 364var compilationWithGeneratedFiles = compilationWithoutGeneratedFiles.AddSyntaxTrees(
Workspace\Solution\SolutionCompilationState.RootedSymbolSet.cs (7)
37Compilation? Compilation, 53public readonly Compilation Compilation; 57/// cref="Compilation.GetAssemblyOrModuleSymbol(MetadataReference)"/> for all the references exposed by <see 58/// cref="Compilation.References"/>. Sorted by the hash code produced by <see 64Compilation compilation, 71public static RootedSymbolSet Create(Compilation compilation) 95[NotNullWhen(true)] out Compilation? compilation,
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (3)
101private static readonly ConditionalWeakTable<Compilation, AsyncLazy<SkeletonReferenceSet?>> s_compilationToSkeletonSet = new(); 203var compilation = await compilationTracker.GetCompilationAsync(compilationState, cancellationToken).ConfigureAwait(false); 219SolutionServices services, Compilation compilation, CancellationToken cancellationToken)
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (1)
193if (tracker.ContainsAssemblyOrModuleOrDynamic(symbol, primary, out var compilation, out var referencedThrough))
Workspace\Solution\SolutionCompilationState.TranslationAction.cs (3)
13/// Represents a change that needs to be made to a <see cref="Compilation"/>, <see cref="GeneratorDriver"/>, or both 34public abstract Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken);
Workspace\Solution\SolutionCompilationState.TranslationAction_Actions.cs (7)
30public override async Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken) 32var finalCompilation = oldCompilation; 84public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken) 119public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken)
Workspace\Solution\SolutionCompilationState.WithFrozenSourceGeneratedDocumentsCompilationTracker.cs (5)
38private Compilation? _compilationWithReplacements; 61[NotNullWhen(true)] out Compilation? compilation, 99public async Task<Compilation> GetCompilationAsync(SolutionCompilationState compilationState, CancellationToken cancellationToken) 112var newCompilation = await UnderlyingTracker.GetCompilationAsync(compilationState, cancellationToken).ConfigureAwait(false); 208public bool TryGetCompilation([NotNullWhen(true)] out Compilation? compilation)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (35)
MSBuildWorkspaceTestBase.cs (1)
126var c1 = await p1.GetCompilationAsync();
NetCoreTests.cs (2)
423var compilation = await project.GetCompilationAsync(); 511var compilation = await project.GetCompilationAsync();
VisualStudioMSBuildWorkspaceTests.cs (32)
87var compilation = await vbProject.GetCompilationAsync(); 227var compilation1 = await projects[0].GetCompilationAsync(); 228var compilation2 = await projects[1].GetCompilationAsync(); 321var c2 = await p2.GetCompilationAsync(); 348var c2 = await p2.GetCompilationAsync(); 373var compilation = await project2.GetCompilationAsync(); 491var compilation = await project.GetCompilationAsync(); 506var compilation = await project.GetCompilationAsync(); 520var compilation = await project.GetCompilationAsync(); 535var compilation = await project.GetCompilationAsync(); 550var compilation = await project.GetCompilationAsync(); 615var compilation = await project.GetCompilationAsync(); 630var compilation = await project.GetCompilationAsync(); 644var compilation = await project.GetCompilationAsync(); 659var compilation = await project.GetCompilationAsync(); 674var compilation = await project.GetCompilationAsync(); 807var comp = await project.GetCompilationAsync(); 825var comp = await project.GetCompilationAsync(); 1468var compilation = await project.GetCompilationAsync(); 1900var compilation = await project.GetCompilationAsync(); 1923var compilation = await project.GetCompilationAsync(); 1947var compilation = await project.GetCompilationAsync(); 1970var compilation = await project.GetCompilationAsync(); 2307var comp = await proj.GetCompilationAsync(); 2412var comp = await proj.GetCompilationAsync(); 2429var comp = await proj.GetCompilationAsync(); 2536var comp = await project.GetCompilationAsync(); 2554var comp = await project.GetCompilationAsync(); 2572var comp = await project.GetCompilationAsync(); 2590var cscomp = await csproject.GetCompilationAsync(); 2598var vbcomp = await vbproject.GetCompilationAsync(); 3221var compilation = await project.GetCompilationAsync();
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
Workspaces\TestWorkspace_XmlConsumption.cs (3)
726var compilation = CreateCompilation(referencedSource); 753private Compilation CreateCompilation(XElement referencedSource) 770var compilation = compilationFactory.CreateCompilation(assemblyName, options);
Microsoft.CodeAnalysis.Workspaces.UnitTests (161)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (1)
48var compilation = await project.GetCompilationAsync();
FindReferencesTests.cs (11)
179var comp = await prj.GetCompilationAsync(); 218var comp = await prj.GetCompilationAsync(); 282var comp = await prj.GetCompilationAsync(); 324var comp = await project.GetCompilationAsync(); 436var compilation = await project.GetCompilationAsync(); 479var portableCompilation = await solution.Projects.Single(p => p.Name == "PortableProject").GetCompilationAsync(); 483var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 514var comp = await project.GetCompilationAsync(); 541var compilation = await project.GetCompilationAsync(); 574var compilation = await project.GetCompilationAsync(); 616var compilation = await project.GetCompilationAsync();
Host\LanguageServices\TestCSharpCompilationFactoryServiceWithIncrementalGeneratorTracking.cs (2)
28Compilation ICompilationFactoryService.CreateCompilation(string assemblyName, CompilationOptions options) 35Compilation ICompilationFactoryService.CreateSubmissionCompilation(string assemblyName, CompilationOptions options, Type? hostObjectType)
SolutionTests\SolutionTests.cs (61)
337var compilation = (await project.GetCompilationAsync())!; 2844var compilation = await project.GetCompilationAsync(); 3482var compilation = proj.GetCompilationAsync().Result; 3729private static ObjectReference<Compilation> GetObservedCompilationAsync(Solution solution, ProjectId projectId) 3731var observed = solution.GetProject(projectId).GetCompilationAsync().Result; 3732return new ObjectReference<Compilation>(observed); 3754private static ObjectReference<Compilation> GetObservedCompilation(Solution solution, ProjectId projectId) 3756var observed = solution.GetProject(projectId).GetCompilationAsync().Result; 3757return new ObjectReference<Compilation>(observed); 3924var compilation = await doc.Project.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 3972var comp3 = project3.GetCompilationAsync().Result; 4131var compilation = await project.GetCompilationAsync(); 4176var compilation = await project.GetCompilationAsync(); 4253var originalCompilation = await project.GetCompilationAsync(); 4287var originalCompilation = await originalProject.GetCompilationAsync(); 4298var frozenCompilation = await frozenDocument.Project.GetCompilationAsync(); 4311var originalCompilation = await originalProject.GetCompilationAsync(); 4326var frozenCompilation = await frozenDocument.Project.GetCompilationAsync(); 4339var originalCompilation = await document.Project.GetCompilationAsync(); 4363var originalCompilation = await solution.Projects.Single().GetCompilationAsync(); 4680var originalCompilation = await solution.GetProject(projectId).GetCompilationAsync(); 4692var newCompilation = await project.GetCompilationAsync(); 4739var finalCompilation = await project.GetCompilationAsync(); 4785var finalCompilation = await project.GetCompilationAsync(); 4843var originalCompilation = await solution.GetProject(projectId).GetCompilationAsync(); 4859var newCompilation = await solution.GetProject(projectId).GetCompilationAsync(); 4972var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync(); 4973var compilation2 = await solution.GetProject(projectId2).GetCompilationAsync(); 4998var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync(); 4999var compilation2 = await solution.GetProject(projectId2).GetCompilationAsync(); 5026var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync(); 5027var compilation2 = await solution.GetProject(projectId2).GetCompilationAsync(); 5043var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync(); 5055var compilation1New = await solution.GetProject(projectId1).GetCompilationAsync(); 5073var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync(); 5086var compilation1New = await solution.GetProject(projectId1).GetCompilationAsync(); 5105var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync(); 5118var compilation1New = await solution.GetProject(projectId1).GetCompilationAsync(); 5123var compilation2 = await solution.GetProject(projectId2).GetCompilationAsync(); 5124var compilation3 = await solution.GetProject(projectId2).GetCompilationAsync(); 5170var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync(); 5171var compilation2 = await solution.GetProject(projectId2).GetCompilationAsync(); 5172var compilation3 = await solution.GetProject(projectId2).GetCompilationAsync(); 5187var compilation1New = await solution.Projects.Single().GetCompilationAsync(); 5215var compilation1 = await solution.GetProject(projectId1).GetCompilationAsync(); 5216var compilation2 = await solution.GetProject(projectId2).GetCompilationAsync(); 5217var compilation3 = await solution.GetProject(projectId2).GetCompilationAsync(); 5231var compilation1New = await solution.Projects.Single().GetCompilationAsync(); 5465var originalCompilation = await solution.Projects.Single().GetCompilationAsync(); 5586var frozenCompilation = await frozenProject.GetCompilationAsync(); 5605var frozenCompilation = await frozenProject.GetCompilationAsync(); 5630var frozenCompilation1 = await frozenProject1.GetCompilationAsync(); 5634var frozenCompilation2 = await frozenProject2.GetCompilationAsync(); 5657var frozenCompilation1 = await frozenProject1.GetCompilationAsync(); 5664var frozenCompilation2 = await frozenProject2.GetCompilationAsync(); 5687var frozenCompilation1 = await frozenProject1.GetCompilationAsync(); 5694var frozenCompilation2 = await frozenProject2.GetCompilationAsync(); 5710var compilation1 = await project1.GetCompilationAsync(); 5721var forkedCompilation1 = await forkedProject1.GetCompilationAsync(); 5743var compilation1 = await project1.GetCompilationAsync(); 5790var frozenCompilation = await frozenProject.GetCompilationAsync();
SolutionTests\SolutionWithSourceGeneratorTests.cs (4)
55Compilation? originalCompilation = null; 555static object GetDeclarationManagerCachedStateForUnchangingTrees(Compilation compilation) 755var objectReference = await project.GetCompilationAsync(); 784var objectReference = await project.GetCompilationAsync();
SymbolKeyTests.cs (66)
58var compilation = GetCompilation(source, LanguageNames.CSharp); 66static void Test(ISymbol symbol, Compilation compilation) 73static void TestVersion(ISymbol symbol, Compilation compilation, int version) 113var compilation = GetCompilation(source, LanguageNames.CSharp); 131var compilation1 = GetCompilation(source, LanguageNames.CSharp, references: [.. netstandardReferences]); 132var compilation2 = GetCompilation(source, LanguageNames.CSharp, references: [.. netcoreReferences]); 149var compilation = GetCompilation(source, LanguageNames.CSharp); 165var compilation = GetCompilation(source, LanguageNames.CSharp); 181var compilation = GetCompilation(source, LanguageNames.CSharp); 196var compilation = GetCompilation(source, LanguageNames.VisualBasic); 211var compilation = GetCompilation(source, LanguageNames.VisualBasic); 226var compilation = GetCompilation(source, LanguageNames.VisualBasic); 241var compilation = GetCompilation(source, LanguageNames.VisualBasic); 256var compilation = GetCompilation(source, LanguageNames.VisualBasic); 271var compilation = GetCompilation(source, LanguageNames.VisualBasic); 287var compilation = GetCompilation(source, LanguageNames.CSharp); 303var compilation = GetCompilation(source, LanguageNames.CSharp); 317var compilation = GetCompilation(source, LanguageNames.VisualBasic); 331var compilation = GetCompilation(source, LanguageNames.CSharp); 358var compilation = GetCompilation(source, LanguageNames.CSharp); 376var compilation = GetCompilation(source, LanguageNames.CSharp); 397var compilation = GetCompilation(source, LanguageNames.CSharp); 416var compilation1 = GetCompilation(source1, LanguageNames.CSharp); 417var compilation2 = GetCompilation(source2, LanguageNames.CSharp); 440var compilation1 = GetCompilation(source1, LanguageNames.CSharp); 441var compilation2 = GetCompilation(source2, LanguageNames.CSharp); 507var compilation = GetCompilation(source, LanguageNames.CSharp); 541var compilation = GetCompilation(source, LanguageNames.CSharp); 563var compilation = GetCompilation(source, LanguageNames.CSharp); 590var compilation = GetCompilation(source, LanguageNames.CSharp); 617var compilation = GetCompilation(source, LanguageNames.CSharp); 653var compilation = GetCompilation(source, LanguageNames.CSharp); 675var compilation = GetCompilation(source, LanguageNames.CSharp); 700var compilation = GetCompilation(source, LanguageNames.CSharp); 718var compilation = GetCompilation(source, LanguageNames.CSharp); 736var compilation = GetCompilation(source, LanguageNames.CSharp); 756var compilation = GetCompilation(source, LanguageNames.CSharp); 779var compilation = GetCompilation(source, LanguageNames.CSharp); 822var compilation = GetCompilation(source, LanguageNames.CSharp); 836var compilation = GetCompilation(source, LanguageNames.CSharp); 952var compilation1 = GetCompilation(source1, LanguageNames.CSharp); 953var compilation2 = GetCompilation(source2, LanguageNames.CSharp); 979var compilation = GetCompilation(source, LanguageNames.CSharp); 1018var compilation1 = GetCompilation(source, LanguageNames.CSharp, "File1.cs"); 1019var compilation2 = GetCompilation(source, LanguageNames.CSharp, "File2.cs"); 1055var compilation1 = GetCompilation(source, LanguageNames.CSharp, "File1.cs"); 1056var compilation2 = GetCompilation(source, LanguageNames.CSharp, "File2.cs"); 1088var compilation1 = GetCompilation(source, LanguageNames.CSharp, "File1.cs", []); 1089var compilation2 = GetCompilation(source, LanguageNames.CSharp, "File2.cs", []); 1123var compilation1 = GetCompilation(source, LanguageNames.VisualBasic, "File1.vb", []); 1124var compilation2 = GetCompilation(source, LanguageNames.VisualBasic, "File2.vb", []); 1169var compilation1 = GetCompilation(source1, LanguageNames.CSharp, "File1.cs"); 1170var compilation2 = GetCompilation(source2, LanguageNames.CSharp, "File2.cs", 1216var compilation1 = GetCompilation(source1, LanguageNames.VisualBasic, "File1.vb"); 1217var compilation2 = GetCompilation(source2, LanguageNames.VisualBasic, "File2.vb", 1256var comp = GetCompilation(source, LanguageNames.CSharp); 1272var compilation1 = GetCompilation(source1, LanguageNames.CSharp, "File1.cs"); 1310var compilation1 = GetCompilation("", LanguageNames.CSharp); 1311var compilation2 = GetCompilation("", LanguageNames.VisualBasic); 1402var compilation = GetCompilation(source, LanguageNames.CSharp); 1420var newCompilation = compilation.ReplaceSyntaxTree(syntaxTree, newTree); 1438IEnumerable<ISymbol> symbols, Compilation compilation, Func<ISymbol, object> fnId = null, bool useSymbolEquivalence = false) 1445ISymbol symbol, Compilation compilation, Func<ISymbol, object> fnId = null, bool useSymbolEquivalence = false) 1471private static Compilation GetCompilation(string source, string language, string path = "", MetadataReference[] references = null) 1529private static List<ISymbol> GetDeclaredSymbols(Compilation compilation) 1549private static IEnumerable<ISymbol> GetInteriorSymbols(ISymbol containingSymbol, Compilation compilation)
UtilityTest\DocumentationCommentIdTests.cs (4)
23private static void CheckDeclarationId(string expectedId, INamespaceOrTypeSymbol symbol, Compilation compilation) 32private static TSymbol CheckDeclarationId<TSymbol>(string expectedId, Compilation compilation, Func<TSymbol, bool> test) 42private static void CheckDeclarationIdExact<TSymbol>(string expectedId, Compilation compilation, Func<TSymbol, bool> test) 51private static void CheckReferenceId(string expectedId, INamespaceOrTypeSymbol symbol, Compilation compilation)
UtilityTest\XmlDocumentationProviderTests.cs (1)
19var roslynCompilersLocation = typeof(Compilation).Assembly.Location;
WorkspaceTests\AdhocWorkspaceTests.cs (1)
383var comp = await proj.GetCompilationAsync();
WorkspaceTests\WorkspaceReferenceTests.cs (10)
32var compilation1 = await project.GetCompilationAsync(); 40var compilation2 = await document.Project.GetCompilationAsync(); 72var compilation1 = await project.GetCompilationAsync(); 80var compilation2 = await document.Project.GetCompilationAsync(); 112var compilation1 = await project.GetCompilationAsync(); 120var compilation2 = await document.Project.GetCompilationAsync(); 152var compilation1 = await project.GetCompilationAsync(); 164var compilation2 = await document.Project.GetCompilationAsync(); 185var compilation1 = await project.GetCompilationAsync(); 194var compilation2 = await forkedProject.GetCompilationAsync();
Microsoft.Extensions.Logging.Generators (8)
LoggerMessageGenerator.Parser.cs (2)
24private readonly Compilation _compilation; 27public Parser(Compilation compilation, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (6)
14/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 35/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 38public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 82/// A thin wrapper over <see cref="GetBestTypeByMetadataName(Compilation, string)"/>, 85/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
Microsoft.Extensions.Options.SourceGeneration (16)
Emitter.cs (3)
40public Emitter(Compilation compilation, SymbolHolder symbolHolder, OptionsSourceGenContext optionsSourceGenContext, bool emitPreamble = true) : base(emitPreamble) 81/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 87private static string GetNullableAnnotationStringForTryValidateValueToUseInGeneratedCode(Compilation compilation)
Generator.cs (2)
27IncrementalValueProvider<(Compilation, ImmutableArray<(TypeDeclarationSyntax? TypeSyntax, SemanticModel SemanticModel)>)> compilationAndTypes = 33private static void HandleAnnotatedTypes(Compilation compilation, ImmutableArray<(TypeDeclarationSyntax? TypeSyntax, SemanticModel SemanticModel)> types, SourceProductionContext context)
OptionsSourceGenContext.cs (1)
16public OptionsSourceGenContext(Compilation compilation)
Parser.cs (2)
25private readonly Compilation _compilation; 33Compilation compilation,
ParserUtilities.cs (1)
52internal static bool IsBaseOrIdentity(ITypeSymbol source, ITypeSymbol dest, Compilation comp)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (6)
14/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 35/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 38public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 82/// A thin wrapper over <see cref="GetBestTypeByMetadataName(Compilation, string)"/>, 85/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
SymbolLoader.cs (1)
28public static bool TryLoad(Compilation compilation, out SymbolHolder? symbolHolder)
Microsoft.Gen.ComplianceReports (6)
Parser.cs (2)
16private readonly Compilation _compilation; 20public Parser(Compilation compilation, SymbolHolder symbolHolder, CancellationToken cancellationToken)
src\Generators\Shared\GeneratorUtilities.cs (3)
46Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) => Initialize(context, fullyQualifiedAttributeNames, x => x, process); 53Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) 74var compilation = source.Left;
SymbolLoader.cs (1)
13public static bool TryLoad(Compilation compilation, out SymbolHolder? symbolHolder)
Microsoft.Gen.ComplianceReports.Unit.Tests (9)
test\Generators\Shared\RoslynTestUtils.cs (9)
230Compilation compilation, 276var comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 320Compilation? comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 355public static async Task<Compilation> RunSyntaxContextReceiver( 369var comp = await proj.GetCompilationAsync().ConfigureAwait(false); 379Func<TReceiver, Compilation, TParserOutput> parser, 385var comp = await RunSyntaxContextReceiver(receiver, references, sources, includeBaseReferences); 409var comp = await proj!.GetCompilationAsync().ConfigureAwait(false); 473var comp = await proj!.GetCompilationAsync().ConfigureAwait(false);
Microsoft.Gen.ContextualOptions (7)
ContextReceiver.cs (1)
37public bool TryGetTypeDeclarations(Compilation compilation, out Dictionary<INamedTypeSymbol, List<TypeDeclarationSyntax>>? typeDeclarations)
ContextualOptionsGenerator.cs (2)
24IncrementalValueProvider<(Compilation, ImmutableArray<SyntaxNode>)> compilationAndTypes = 30private static void HandleAnnotatedTypes(Compilation compilation, IEnumerable<SyntaxNode> nodes, SourceProductionContext context)
src\Generators\Shared\GeneratorUtilities.cs (3)
46Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) => Initialize(context, fullyQualifiedAttributeNames, x => x, process); 53Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) 74var compilation = source.Left;
SymbolLoader.cs (1)
10public static bool TryLoad(Compilation compilation, out SymbolHolder? symbolHolder)
Microsoft.Gen.ContextualOptions.Unit.Tests (9)
test\Generators\Shared\RoslynTestUtils.cs (9)
230Compilation compilation, 276var comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 320Compilation? comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 355public static async Task<Compilation> RunSyntaxContextReceiver( 369var comp = await proj.GetCompilationAsync().ConfigureAwait(false); 379Func<TReceiver, Compilation, TParserOutput> parser, 385var comp = await RunSyntaxContextReceiver(receiver, references, sources, includeBaseReferences); 409var comp = await proj!.GetCompilationAsync().ConfigureAwait(false); 473var comp = await proj!.GetCompilationAsync().ConfigureAwait(false);
Microsoft.Gen.Logging (16)
LoggingGenerator.cs (2)
25IncrementalValueProvider<(Compilation, ImmutableArray<TypeDeclarationSyntax>)> compilationAndTypes = 31private static void HandleAnnotatedTypes(Compilation compilation, ImmutableArray<TypeDeclarationSyntax> types, SourceProductionContext context)
Parsing\Parser.cs (2)
20private readonly Compilation _compilation; 24public Parser(Compilation compilation, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken)
Parsing\SymbolHolder.cs (1)
12Compilation Compilation,
Parsing\SymbolLoader.cs (1)
53Compilation compilation,
src\Generators\Shared\GeneratorUtilities.cs (3)
46Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) => Initialize(context, fullyQualifiedAttributeNames, x => x, process); 53Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) 74var compilation = source.Left;
src\Generators\Shared\ParserUtilities.cs (1)
57internal static bool IsBaseOrIdentity(ITypeSymbol source, ITypeSymbol dest, Compilation comp)
src\Generators\Shared\RoslynExtensions.cs (6)
19/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 40/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 44public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 96/// A thin wrapper over <see cref="GetBestTypeByMetadataName(Compilation, string)"/>, 99/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 101public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
Microsoft.Gen.Logging.Unit.Tests (14)
CompilationHelper.cs (2)
20public static Compilation CreateCompilation( 54public static byte[] CreateAssemblyImage(Compilation compilation)
ParserTests.cs (2)
653Compilation referencedCompilation = CompilationHelper.CreateCompilation(referencedSource); 673Compilation compilation = CompilationHelper.CreateCompilation(source, additionalReferences);
SymbolLoaderTests.cs (1)
28var compilationMock = new Mock<Compilation>(
test\Generators\Shared\RoslynTestUtils.cs (9)
230Compilation compilation, 276var comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 320Compilation? comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 355public static async Task<Compilation> RunSyntaxContextReceiver( 369var comp = await proj.GetCompilationAsync().ConfigureAwait(false); 379Func<TReceiver, Compilation, TParserOutput> parser, 385var comp = await RunSyntaxContextReceiver(receiver, references, sources, includeBaseReferences); 409var comp = await proj!.GetCompilationAsync().ConfigureAwait(false); 473var comp = await proj!.GetCompilationAsync().ConfigureAwait(false);
Microsoft.Gen.Metrics (14)
MetricsGenerator.cs (1)
31private static void HandleAnnotatedTypes(Compilation compilation, IEnumerable<SyntaxNode> nodes, SourceProductionContext context)
Parser.cs (2)
46private readonly Compilation _compilation; 50public Parser(Compilation compilation, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken)
src\Generators\Shared\GeneratorUtilities.cs (3)
46Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) => Initialize(context, fullyQualifiedAttributeNames, x => x, process); 53Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) 74var compilation = source.Left;
src\Generators\Shared\ParserUtilities.cs (1)
57internal static bool IsBaseOrIdentity(ITypeSymbol source, ITypeSymbol dest, Compilation comp)
src\Generators\Shared\RoslynExtensions.cs (6)
19/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 40/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 44public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 96/// A thin wrapper over <see cref="GetBestTypeByMetadataName(Compilation, string)"/>, 99/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 101public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
SymbolLoader.cs (1)
18internal static SymbolHolder? LoadSymbols(Compilation compilation)
Microsoft.Gen.Metrics.Unit.Tests (9)
test\Generators\Shared\RoslynTestUtils.cs (9)
230Compilation compilation, 276var comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 320Compilation? comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 355public static async Task<Compilation> RunSyntaxContextReceiver( 369var comp = await proj.GetCompilationAsync().ConfigureAwait(false); 379Func<TReceiver, Compilation, TParserOutput> parser, 385var comp = await RunSyntaxContextReceiver(receiver, references, sources, includeBaseReferences); 409var comp = await proj!.GetCompilationAsync().ConfigureAwait(false); 473var comp = await proj!.GetCompilationAsync().ConfigureAwait(false);
Microsoft.Gen.MetricsReports (7)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
46private readonly Compilation _compilation; 50public Parser(Compilation compilation, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken)
src\Generators\Microsoft.Gen.Metrics\SymbolLoader.cs (1)
18internal static SymbolHolder? LoadSymbols(Compilation compilation)
src\Generators\Shared\GeneratorUtilities.cs (3)
46Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) => Initialize(context, fullyQualifiedAttributeNames, x => x, process); 53Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) 74var compilation = source.Left;
src\Generators\Shared\ParserUtilities.cs (1)
57internal static bool IsBaseOrIdentity(ITypeSymbol source, ITypeSymbol dest, Compilation comp)
Microsoft.Gen.MetricsReports.Unit.Tests (9)
test\Generators\Shared\RoslynTestUtils.cs (9)
230Compilation compilation, 276var comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 320Compilation? comp = await proj!.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false); 355public static async Task<Compilation> RunSyntaxContextReceiver( 369var comp = await proj.GetCompilationAsync().ConfigureAwait(false); 379Func<TReceiver, Compilation, TParserOutput> parser, 385var comp = await RunSyntaxContextReceiver(receiver, references, sources, includeBaseReferences); 409var comp = await proj!.GetCompilationAsync().ConfigureAwait(false); 473var comp = await proj!.GetCompilationAsync().ConfigureAwait(false);
Microsoft.Interop.ComInterfaceGenerator (9)
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (1)
75var comp = editor.SemanticModel.Compilation;
ComInterfaceInfo.cs (1)
121|| (baseSymbol.ContainingAssembly is ISourceAssemblySymbol { Compilation: Compilation baseComp }
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (6)
14/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 35/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 38public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 82/// A thin wrapper over <see cref="GetBestTypeByMetadataName(Compilation, string)"/>, 85/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
VtableIndexStubGenerator.cs (1)
324private static MarshallingInfo CreateExceptionMarshallingInfo(AttributeData virtualMethodIndexAttr, ISymbol symbol, Compilation compilation, GeneratorDiagnosticsBag diagnostics, VirtualMethodIndexCompilationData virtualMethodIndexData)
Microsoft.Interop.JavaScript.JSImportGenerator (1)
JSMarshalAsAttributeInfoParser.cs (1)
17public JSMarshalAsAttributeParser(Compilation compilation)
Microsoft.Interop.LibraryImportGenerator (11)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (2)
630private readonly Compilation _compilation; 635public PerCompilationAnalyzer(Compilation compilation, INamedTypeSymbol customMarshallerAttribute)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
567private static SyntaxNode DefaultMethodStatement(SyntaxGenerator generator, Compilation compilation)
Analyzers\NativeMarshallingAttributeAnalyzer.cs (2)
77private readonly Compilation _compilation; 79public PerCompilationAnalyzer(Compilation compilation)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (6)
14/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 35/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 38public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 82/// A thin wrapper over <see cref="GetBestTypeByMetadataName(Compilation, string)"/>, 85/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
Microsoft.Interop.LibraryImportGenerator.Downlevel (6)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (6)
14/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 35/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 38public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 82/// A thin wrapper over <see cref="GetBestTypeByMetadataName(Compilation, string)"/>, 85/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
Microsoft.Interop.SourceGeneration (51)
ArrayMarshallingInfoProvider.cs (3)
19private readonly Compilation _compilation; 21public ArrayMarshallingInfoProvider(Compilation compilation) 41Compilation compilation,
BlittableTypeMarshallingInfoProvider.cs (2)
16private readonly Compilation _compilation; 18public BlittableTypeMarshallingInfoProvider(Compilation compilation)
ComInterfaceMarshallingInfoProvider.cs (3)
17private readonly Compilation _compilation; 19public ComInterfaceMarshallingInfoProvider(Compilation compilation) 32Compilation compilation,
CompilationExtensions.cs (1)
14public static EnvironmentFlags GetEnvironmentFlags(this Compilation compilation)
CustomMarshallingInfoHelper.cs (3)
22Compilation compilation) 137Compilation compilation, 171Compilation compilation,
ManualTypeMarshallingHelper.cs (10)
97Compilation compilation, 106Compilation compilation, 116Compilation compilation, 126Compilation compilation, 137Compilation compilation, 149Compilation compilation, 356public static ITypeSymbol ReplaceGenericPlaceholderInType(ITypeSymbol managedType, INamedTypeSymbol entryType, Compilation compilation) 409Compilation compilation, 453private static CustomTypeMarshallerData? GetStatelessMarshallerDataForType(ITypeSymbol marshallerType, MarshalMode mode, ITypeSymbol managedType, bool isLinearCollectionMarshaller, Compilation compilation, Func<ITypeSymbol, MarshallingInfo>? getMarshallingInfo) 552Compilation compilation,
MarshalAsWithCustomMarshallersParser.cs (2)
18private readonly Compilation _compilation; 28public MarshalAsWithCustomMarshallersParser(Compilation compilation, GeneratorDiagnosticsBag diagnostics, IMarshallingInfoAttributeParser marshalAsAttributeParser)
MarshallerShape.cs (2)
111public static (MarshallerShape, MarshallerMethods) GetShapeForType(ITypeSymbol marshallerType, ITypeSymbol managedType, bool isLinearCollectionMarshaller, Compilation compilation) 446public static (MarshallerShape shape, MarshallerMethods methods) GetShapeForType(ITypeSymbol marshallerType, ITypeSymbol managedType, bool isLinearCollectionMarshaller, Compilation compilation)
MarshalUsingAttributeParser.cs (2)
17private readonly Compilation _compilation; 20public MarshalUsingAttributeParser(Compilation compilation, GeneratorDiagnosticsBag diagnostics)
MethodSignatureElementInfoProvider.cs (2)
14private readonly Compilation _compilation; 19public MethodSignatureElementInfoProvider(Compilation compilation, GeneratorDiagnosticsBag generatorDiagnostics, IMethodSymbol method, ImmutableArray<IUseSiteAttributeParser> useSiteAttributeParsers)
NativeMarshallingAttributeParser.cs (2)
11private readonly Compilation _compilation; 14public NativeMarshallingAttributeParser(Compilation compilation, GeneratorDiagnosticsBag diagnostics)
SafeHandleMarshallingInfoProvider.cs (1)
16public sealed class SafeHandleMarshallingInfoProvider(Compilation compilation) : ITypeBasedMarshallingInfoProvider
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (6)
14/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 35/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 38public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 82/// A thin wrapper over <see cref="GetBestTypeByMetadataName(Compilation, string)"/>, 85/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
StringMarshallingInfoProvider.cs (2)
15private readonly Compilation _compilation; 20public StringMarshallingInfoProvider(Compilation compilation, GeneratorDiagnosticsBag diagnostics, AttributeData stringMarshallingCustomAttribute, DefaultMarshallingInfo defaultMarshallingInfo)
StubEnvironment.cs (1)
18Compilation Compilation,
TypePositionInfo.cs (2)
88public static TypePositionInfo CreateForParameter(IParameterSymbol paramSymbol, MarshallingInfo marshallingInfo, Compilation compilation) 116private static (ByValueContentsMarshalKind, Location? inAttribute, Location? outAttribute) GetByValueContentsMarshalKind(IEnumerable<AttributeData> attributes, Compilation compilation)
TypeSymbolExtensions.cs (7)
37static bool IsConsideredBlittableWorker(ITypeSymbol t, ImmutableHashSet<ITypeSymbol> seenTypes, Compilation compilation) 55public static bool IsStrictlyBlittableInContext(this ITypeSymbol type, Compilation compilation) 62static unsafe bool IsStrictlyBlittableWorker(ITypeSymbol t, ImmutableHashSet<ITypeSymbol> seenTypes, Compilation compilation) 100private static unsafe bool IsBlittableWorker(this ITypeSymbol type, ImmutableHashSet<ITypeSymbol> seenTypes, Compilation compilation, delegate*<ITypeSymbol, ImmutableHashSet<ITypeSymbol>, Compilation, bool> isBlittable) 147private static unsafe bool HasOnlyBlittableFields(this ITypeSymbol type, ImmutableHashSet<ITypeSymbol> seenTypes, Compilation compilation, delegate*<ITypeSymbol, ImmutableHashSet<ITypeSymbol>, Compilation, bool> isBlittable)
Microsoft.ML.InternalCodeAnalyzer (3)
BaseTestClassAnalyzer.cs (2)
51private readonly Compilation _compilation; 57public AnalyzerImpl(Compilation compilation, INamedTypeSymbol factAttribute)
BestFriendAnalyzer.cs (1)
51var comp = model.Compilation;
Microsoft.VisualStudio.LanguageServices (60)
CallHierarchy\Finders\AbstractCallFinder.cs (1)
101var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Interactive\VsResetInteractive.cs (1)
308var compilation = await document.Project.GetCompilationAsync().ConfigureAwait(true);
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (5)
40private Compilation GetCompilation() 147var compilation = GetCompilation(); 167var compilation = GetCompilation(); 196var compilation = GetCompilation(); 286private void BuildXmlDocumentation(ISymbol symbol, Compilation compilation)
Library\ObjectBrowser\AbstractListItemFactory.cs (16)
168Compilation compilation, 182Compilation compilation, 204private ImmutableArray<ObjectListItem> GetBaseTypeListItems(INamedTypeSymbol namedTypeSymbol, Compilation compilation, ProjectId projectId) 228public ImmutableArray<ObjectListItem> GetBaseTypeListItems(ObjectListItem parentListItem, Compilation compilation) 244public ImmutableArray<ObjectListItem> GetFolderListItems(ObjectListItem parentListItem, Compilation compilation) 291Compilation compilation, 315private static ImmutableArray<ISymbol> GetMemberSymbols(INamedTypeSymbol namedTypeSymbol, Compilation compilation) 331private static ImmutableArray<ISymbol> GetInheritedMemberSymbols(INamedTypeSymbol namedTypeSymbol, Compilation compilation) 388public ImmutableArray<ObjectListItem> GetMemberListItems(ObjectListItem parentListItem, Compilation compilation) 437public ImmutableArray<ObjectListItem> GetNamespaceListItems(ObjectListItem parentListItem, Compilation compilation) 640public ImmutableArray<ObjectListItem> GetReferenceListItems(ObjectListItem parentListItem, Compilation compilation) 665private static ImmutableArray<INamedTypeSymbol> GetAccessibleTypes(INamespaceSymbol namespaceSymbol, Compilation compilation) 691Compilation compilation, 720public ImmutableArray<ObjectListItem> GetTypeListItems(ObjectListItem parentListItem, Compilation compilation) 745public void CollectTypeListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 777public void CollectMemberListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (3)
198internal Compilation GetCompilation(ProjectId projectId) 419var compilation = symbolListItem.GetCompilation(this.Workspace); 541var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_ListItems.cs (8)
16internal void CollectMemberListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 22internal void CollectTypeListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString) 31internal ImmutableArray<ObjectListItem> GetBaseTypeListItems(ObjectListItem parentListItem, Compilation compilation) 34internal ImmutableArray<ObjectListItem> GetFolderListItems(ObjectListItem parentListItem, Compilation compilation) 37internal ImmutableArray<ObjectListItem> GetMemberListItems(ObjectListItem parentListItem, Compilation compilation) 40internal ImmutableArray<ObjectListItem> GetNamespaceListItems(ObjectListItem parentListItem, Compilation compilation) 46internal ImmutableArray<ObjectListItem> GetReferenceListItems(ObjectListItem parentListItem, Compilation compilation) 49internal ImmutableArray<ObjectListItem> GetTypeListItems(ObjectListItem parentListItem, Compilation compilation)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_Search.cs (2)
75var compilation = this.GetCompilation(projectId); 96var compilation = this.GetCompilation(projectId);
Library\ObjectBrowser\Lists\ReferenceListItem.cs (1)
40public IAssemblySymbol GetAssembly(Compilation compilation)
Library\ObjectBrowser\Lists\SymbolListItem.cs (1)
63public ISymbol ResolveSymbol(Compilation compilation)
Library\ObjectBrowser\Lists\SymbolListItem`1.cs (1)
19public TSymbol ResolveTypedSymbol(Compilation compilation)
Library\ObjectBrowser\ObjectList.cs (4)
424var compilation = typeListItem.GetCompilation(this.LibraryManager.Workspace); 503var compilation = listItem.GetCompilation(this.LibraryManager.Workspace); 680var compilation = project 752var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Library\ObjectBrowser\ObjectListItem.cs (1)
72public Compilation GetCompilation(Workspace workspace)
Library\VsNavInfo\NavInfoFactory.cs (5)
34public IVsNavInfo CreateForSymbol(ISymbol symbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 63public IVsNavInfo CreateForNamespace(INamespaceSymbol namespaceSymbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 73public IVsNavInfo CreateForType(ITypeSymbol typeSymbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 114public IVsNavInfo CreateForMember(ISymbol memberSymbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 128private IVsNavInfo Create(IAssemblySymbol containingAssembly, Project project, Compilation compilation, bool useExpandedHierarchy = false,
Progression\GraphNodeIdCreation.cs (1)
425var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
ProjectSystem\AbstractEntryPointFinder.cs (1)
11internal abstract class AbstractEntryPointFinder(Compilation compilation) : SymbolVisitor
ProjectSystem\AbstractEntryPointFinderService.cs (1)
12protected abstract IEnumerable<INamedTypeSymbol> FindEntryPoints(Compilation compilation, bool findFormsOnly);
PullMemberUp\SymbolDependentsBuilder.cs (1)
60var compilation = await _project.GetCompilationAsync(_cancellationToken).ConfigureAwait(false);
Venus\ContainedLanguageCodeSupport.cs (5)
90var compilation = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken); 158var thisCompilation = thisDocument.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken); 296var compilation = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken); 361private static bool IncludeMember(ISymbol member, CODEMEMBERTYPE memberType, Compilation compilation) 481var compilation = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken);
Watson\FaultReporter.cs (1)
38FatalError.CopyHandlersTo(typeof(Compilation).Assembly);
Workspace\VisualStudioSymbolNavigationService.cs (1)
106var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Microsoft.VisualStudio.LanguageServices.CSharp (4)
CodeModel\CSharpCodeModelService.cs (1)
3020public override ITypeSymbol? GetTypeSymbolFromFullName(string fullName, Compilation compilation)
ProjectSystemShim\CSharpEntryPointFinder.cs (2)
11internal sealed class CSharpEntryPointFinder(Compilation compilation) 17public static IEnumerable<INamedTypeSymbol> FindEntryPoints(Compilation compilation)
ProjectSystemShim\CSharpEntryPointFinderService.cs (1)
19protected override IEnumerable<INamedTypeSymbol> FindEntryPoints(Compilation compilation, bool findFormsOnly)
Microsoft.VisualStudio.LanguageServices.VisualBasic (6)
CodeModel\VisualBasicCodeModelService.vb (2)
685Dim compilation = CType(fileCodeModel.GetCompilation(), Compilation) 3627Public Overrides Function GetTypeSymbolFromFullName(fullName As String, compilation As Compilation) As ITypeSymbol
ProjectSystemShim\VisualBasicEntryPointFinder.vb (2)
14Public Sub New(compilation As Compilation, findFormsOnly As Boolean) 27Public Shared Function FindEntryPoints(compilation As Compilation, findFormsOnly As Boolean) As IEnumerable(Of INamedTypeSymbol)
ProjectSystemShim\VisualBasicEntryPointFinderService.vb (1)
20Protected Overrides Function FindEntryPoints(compilation As Compilation, findFormsOnly As Boolean) As IEnumerable(Of INamedTypeSymbol)
ProjectSystemShim\VisualBasicProject.vb (1)
207Public Shared Sub GetEntryPointsWorker(compilation As Compilation,
Mvc.Analyzers.Test (36)
CodeAnalysisExtensionsTest.cs (26)
24var compilation = TestCompilation.Create(source); 52var compilation = TestCompilation.Create(source); 89var compilation = TestCompilation.Create(source); 126var compilation = TestCompilation.Create(source); 163var compilation = TestCompilation.Create(source); 208var compilation = TestCompilation.Create(source); 251var compilation = TestCompilation.Create(source); 278var compilation = TestCompilation.Create(source); 305var compilation = TestCompilation.Create(source); 348var compilation = TestCompilation.Create(source); 396var compilation = TestCompilation.Create(source); 434var compilation = TestCompilation.Create(source); 472var compilation = TestCompilation.Create(source); 501var compilation = TestCompilation.Create(source); 527var compilation = TestCompilation.Create(source); 559var compilation = TestCompilation.Create(source); 589var compilation = TestCompilation.Create(source); 623var compilation = TestCompilation.Create(source); 654var compilation = TestCompilation.Create(source); 688var compilation = TestCompilation.Create(source); 714var compilation = TestCompilation.Create(source); 735var compilation = TestCompilation.Create(source); 756var compilation = TestCompilation.Create(source); 781var compilation = TestCompilation.Create(source); 804var compilation = TestCompilation.Create(source); 837var compilation = TestCompilation.Create(source);
src\Shared\AnalyzerTesting\TestCompilation.cs (1)
11public static Compilation Create(string source)
TopLevelParameterNameAnalyzerTest.cs (9)
319var compilation = TestCompilation.Create(source); 409var compilation = TestCompilation.Create(source); 433var compilation = TestCompilation.Create(source); 458var compilation = TestCompilation.Create(source); 482var compilation = TestCompilation.Create(source); 506var compilation = TestCompilation.Create(source); 530var compilation = TestCompilation.Create(source); 553var compilation = TestCompilation.Create(source); 576var compilation = TestCompilation.Create(source);
Mvc.Api.Analyzers.Test (57)
ActualApiResponseMetadataFactoryTest.cs (7)
27var compilation = await GetCompilation("GetDefaultStatusCodeTest"); 41var compilation = await GetCompilation("GetDefaultStatusCodeTest"); 70var compilation = await project.GetCompilationAsync(); 367var compilation = await GetCompilation("TryGetActualResponseMetadataTests"); 387var compilation = await GetCompilation(testClassName); 406var compilation = await project.GetCompilationAsync(); 422private Task<Compilation> GetCompilation(string test)
ApiControllerFactsTest.cs (7)
35var compilation = await project.GetCompilationAsync(); 50var compilation = await GetCompilation(); 66var compilation = await GetCompilation(); 82var compilation = await GetCompilation(); 98var compilation = await GetCompilation(); 114var compilation = await GetCompilation(nameof(IsApiControllerAction_ReturnsTrue_IfAttributeIsDeclaredOnAssembly)); 126private Task<Compilation> GetCompilation(string testFile = "TestFile")
MvcFactsTest.cs (9)
65var compilation = await GetIsControllerCompilation(); 79var compilation = await GetIsControllerCompilation(); 149var compilation = await GetIsControllerActionCompilation(); 181var compilation = await GetIsControllerActionCompilation(); 196var compilation = await GetIsControllerActionCompilation(); 209private IMethodSymbol GetDisposableDispose(Compilation compilation) 216private Task<Compilation> GetIsControllerCompilation() => GetCompilation("IsControllerTests"); 218private Task<Compilation> GetIsControllerActionCompilation() => GetCompilation("IsControllerActionTests"); 220private Task<Compilation> GetCompilation(string test)
SymbolApiConventionMatcherTest.cs (13)
273var compilation = await GetCompilationAsync(); 288var compilation = await GetCompilationAsync(); 304var compilation = await GetCompilationAsync(); 320var compilation = await GetCompilationAsync(); 336var compilation = await GetCompilationAsync(); 427var compilation = await GetCompilationAsync(); 447var compilation = await GetCompilationAsync(); 465var compilation = await GetCompilationAsync(); 483var compilation = await GetCompilationAsync(); 501var compilation = await GetCompilationAsync(); 520var compilation = await GetCompilationAsync(); 539var compilation = await GetCompilationAsync(); 553private Task<Compilation> GetCompilationAsync(string test = "SymbolApiConventionMatcherTestFile")
SymbolApiResponseMetadataProviderTest.cs (21)
17var compilation = await GetResponseMetadataCompilation(); 35var compilation = await GetResponseMetadataCompilation(); 53var compilation = await GetResponseMetadataCompilation(); 71var compilation = await GetResponseMetadataCompilation(); 94var compilation = await GetResponseMetadataCompilation(); 117var compilation = await GetResponseMetadataCompilation(); 140var compilation = await GetResponseMetadataCompilation(); 163var compilation = await GetResponseMetadataCompilation(); 185var compilation = await GetResponseMetadataCompilation(); 216var compilation = await GetResponseMetadataCompilation(); 238var compilation = await GetResponseMetadataCompilation(); 271var compilation = await GetResponseMetadataCompilation(); 294var compilation = await GetResponseMetadataCompilation(); 316var compilation = await GetResponseMetadataCompilation(); 390var compilation = await GetResponseMetadataCompilation(); 404var compilation = await GetCompilation(nameof(GetErrorResponseType_ReturnsProblemDetails_IfNoAttributeIsDiscovered)); 422var compilation = await GetCompilation(nameof(GetErrorResponseType_ReturnsTypeDefinedAtAssembly)); 440var compilation = await GetCompilation(nameof(GetErrorResponseType_ReturnsTypeDefinedAtController)); 458var compilation = await GetCompilation(nameof(GetErrorResponseType_ReturnsTypeDefinedAtAction)); 472private Task<Compilation> GetResponseMetadataCompilation() => GetCompilation("GetResponseMetadataTests"); 474private Task<Compilation> GetCompilation(string test)
Roslyn.Test.PdbUtilities (19)
EditAndContinue\EditAndContinueTest.cs (3)
32protected abstract Compilation CreateCompilation(SyntaxTree tree); 174Compilation oldCompilation, 176Compilation newCompilation,
EditAndContinue\EditAndContinueTest.GenerationInfo.cs (2)
17public readonly Compilation Compilation; 32public GenerationInfo(Compilation compilation, MetadataReader reader, CompilationDifference? diff, CompilationVerifier? compilationVerifier, EmitBaseline baseline, Action<GenerationVerifier> verifier)
EditAndContinue\EditAndContinueTestUtilities.cs (1)
19public static EmitBaseline CreateInitialBaseline(Compilation compilation, ModuleMetadata module, Func<MethodDefinitionHandle, EditAndContinueMethodDebugInformation> debugInformationProvider)
EditAndContinue\SemanticEditDescription.cs (4)
12Func<Compilation, ISymbol> symbolProvider, 13Func<Compilation, ISymbol>? newSymbolProvider = null, 18public readonly Func<Compilation, ISymbol> SymbolProvider = symbolProvider; 19public readonly Func<Compilation, ISymbol> NewSymbolProvider = newSymbolProvider ?? symbolProvider;
Reader\PdbTestUtilities.cs (1)
93public static string GetTokenToLocationMap(Compilation compilation, bool maskToken = false)
Reader\PdbValidation.cs (8)
151this Compilation compilation, 165this Compilation compilation, 190this Compilation compilation, 203this Compilation compilation, 227this Compilation compilation, 509Compilation compilation, 525private static void EmitWithPdb(MemoryStream peStream, MemoryStream pdbStream, Compilation compilation, IMethodSymbol debugEntryPoint, IEnumerable<EmbeddedText> embeddedTexts, bool portable) 648internal static void VerifyPdbLambdasAndClosures(this Compilation compilation, SourceWithMarkedNodes source)
Roslyn.VisualStudio.Next.UnitTests (1)
Services\ServiceHubServicesTests.cs (1)
459var localCompilation = await localProject.GetCompilationAsync();
SemanticSearch.BuildTask (1)
GenerateFilteredReferenceAssembliesTask.cs (1)
197Compilation compilation,
System.Text.Json.SourceGeneration (12)
Helpers\KnownTypeSymbols.cs (2)
17public KnownTypeSymbols(Compilation compilation) 20public Compilation Compilation { get; }
Helpers\RoslynExtensions.cs (4)
18public static LanguageVersion? GetLanguageVersion(this Compilation compilation) 21public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) 40public static bool ContainsLocation(this Compilation compilation, Location location) 46public static ITypeSymbol EraseCompileTimeMetadata(this Compilation compilation, ITypeSymbol type)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (6)
14/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 35/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 38public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 82/// A thin wrapper over <see cref="GetBestTypeByMetadataName(Compilation, string)"/>, 85/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
System.Text.RegularExpressions.Generator (10)
RegexGenerator.Parser.cs (1)
41Compilation compilation = sm.Compilation;
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (6)
14/// Gets a type by its metadata name to use for code analysis within a <see cref="Compilation"/>. This method 35/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 38public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, string fullyQualifiedMetadataName) 82/// A thin wrapper over <see cref="GetBestTypeByMetadataName(Compilation, string)"/>, 85/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param> 88public static INamedTypeSymbol? GetBestTypeByMetadataName(this Compilation compilation, Type type) =>
UpgradeToGeneratedRegexAnalyzer.cs (2)
40Compilation compilation = context.Compilation; 231private static bool ProjectSupportsRegexSourceGenerator(Compilation compilation, [NotNullWhen(true)] out INamedTypeSymbol? regexTypeSymbol)
UpgradeToGeneratedRegexCodeFixer.cs (1)
83Compilation compilation = semanticModel.Compilation;
System.Windows.Forms.PrivateSourceGenerators (2)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (2)
198private static IEnumerable<EnumValidationInfo> GetEnumValidationInfo(Compilation compilation, ImmutableArray<SyntaxNode> argumentsToValidate, CancellationToken cancellationToken) 233SemanticModel GetSemanticModel(Compilation compilation, SyntaxTree syntaxTree)
System.Windows.Forms.PrivateSourceGenerators.Tests (1)
EnumValidationTests.cs (1)
308driver.RunGeneratorsAndUpdateCompilation(compilation, out Compilation outputCompilation, out ImmutableArray<Diagnostic> diagnostics);