2 types derived from Compilation
Microsoft.CodeAnalysis.CSharp (1)
Microsoft.CodeAnalysis.VisualBasic (1)
3731 references to Compilation
AnalyzerRunner (4)
Aspire.Hosting.Analyzers (5)
BuildValidator (4)
ConfigurationSchemaGenerator (9)
IdeCoreBenchmarks (4)
ILLink.RoslynAnalyzer (21)
Microsoft.Analyzers.Extra (12)
Microsoft.Analyzers.Extra.Tests (5)
Microsoft.Analyzers.Local (6)
Microsoft.Analyzers.Local.Tests (5)
Microsoft.AspNetCore.Analyzer.Testing (3)
Microsoft.AspNetCore.Analyzers (2)
Microsoft.AspNetCore.Analyzers.Test (11)
Microsoft.AspNetCore.App.Analyzers (13)
Microsoft.AspNetCore.Components.Analyzers (2)
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
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)
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)
Microsoft.AspNetCore.Mvc.Analyzers (3)
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (6)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
Microsoft.CodeAnalysis (326)
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,
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\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\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\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,
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)
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\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)
Microsoft.CodeAnalysis.CodeStyle (142)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
614Compilation compilation)
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)
Microsoft.CodeAnalysis.CodeStyle.Fixes (92)
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\ImplementInterfaceGenerator.cs (5)
81var compilation = await this.Document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
107Compilation compilation,
180Compilation compilation,
285Compilation compilation,
312private ISymbol GenerateEvent(Compilation compilation, string memberName, bool generateInvisibly, SyntaxGenerator factory, DeclarationModifiers modifiers, bool useExplicitInterfaceSymbol, Accessibility accessibility, IEventSymbol @event)
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)
193Compilation compilation,
232Compilation compilation,
435this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter, SyntaxNode fieldAccess)
444public static SyntaxNode CreateThrowArgumentNullExpression(this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter)
447private static SyntaxNode CreateNewArgumentNullException(SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter)
479public 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\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,
Microsoft.CodeAnalysis.CSharp (80)
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);
Microsoft.CodeAnalysis.CSharp.CodeStyle (40)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (22)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (72)
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");
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (72)
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);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (8)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (27)
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)
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Features (73)
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)
Microsoft.CodeAnalysis.CSharp.Scripting (1)
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (19)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (361)
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\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));
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)
Microsoft.CodeAnalysis.CSharp.Workspaces (20)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (32)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (54)
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)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (3)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (3)
Microsoft.CodeAnalysis.Features (188)
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)
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (4)
392Compilation compilation, SyntaxGenerator generator, IParameterSymbol parameter, string methodName, TSimplifierOptions options)
541Compilation compilation, SyntaxGenerator generator, Type type)
555Compilation compilation, SyntaxGenerator generator, IParameterSymbol parameter)
563Compilation compilation, SyntaxGenerator generator, IParameterSymbol parameter, string methodName)
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)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
614Compilation 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\ImplementInterfaceGenerator.cs (4)
107Compilation compilation,
180Compilation compilation,
285Compilation compilation,
312private ISymbol GenerateEvent(Compilation compilation, string memberName, bool generateInvisibly, SyntaxGenerator factory, DeclarationModifiers modifiers, bool useExplicitInterfaceSymbol, Accessibility accessibility, IEventSymbol @event)
Microsoft.CodeAnalysis.Features.Test.Utilities (12)
Microsoft.CodeAnalysis.Features.UnitTests (29)
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (9)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Microsoft.CodeAnalysis.Rebuild (6)
Microsoft.CodeAnalysis.Rebuild.UnitTests (18)
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Microsoft.CodeAnalysis.Scripting (8)
Microsoft.CodeAnalysis.Scripting.TestUtilities (3)
Microsoft.CodeAnalysis.Scripting.UnitTests (3)
Microsoft.CodeAnalysis.Test.Utilities (91)
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) :
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)
Microsoft.CodeAnalysis.UnitTests (21)
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)
Microsoft.CodeAnalysis.VisualBasic (34)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (11)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (11)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (22)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
Microsoft.CodeAnalysis.VisualBasic.Features (18)
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)
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (2)
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
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)
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,
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 (16)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces (312)
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
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\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)
193Compilation compilation,
232Compilation compilation,
435this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter, SyntaxNode fieldAccess)
444public static SyntaxNode CreateThrowArgumentNullExpression(this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter)
447private static SyntaxNode CreateNewArgumentNullException(SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter)
479public 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\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,
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.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(
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (35)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
Microsoft.CodeAnalysis.Workspaces.UnitTests (161)
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)
Microsoft.Extensions.Logging.Generators (8)
Microsoft.Extensions.Options.SourceGeneration (16)
Microsoft.Gen.ComplianceReports (6)
Microsoft.Gen.ComplianceReports.Unit.Tests (9)
Microsoft.Gen.ContextualOptions (7)
Microsoft.Gen.ContextualOptions.Unit.Tests (9)
Microsoft.Gen.Logging (16)
Microsoft.Gen.Logging.Unit.Tests (23)
Microsoft.Gen.Metrics (14)
Microsoft.Gen.Metrics.Unit.Tests (9)
Microsoft.Gen.MetricsReports (7)
Microsoft.Gen.MetricsReports.Unit.Tests (9)
Microsoft.Interop.ComInterfaceGenerator (9)
Microsoft.Interop.JavaScript.JSImportGenerator (1)
Microsoft.Interop.LibraryImportGenerator (11)
Microsoft.Interop.LibraryImportGenerator.Downlevel (6)
Microsoft.Interop.SourceGeneration (51)
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,
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.Maui.Controls.SourceGen (11)
CodeBehindGenerator.cs (11)
183 static AssemblyCaches GetAssemblyAttributes(Compilation compilation, CancellationToken cancellationToken)
242 static IDictionary<XmlType, string> GetTypeCache(Compilation compilation, CancellationToken cancellationToken)
247 static void GenerateXamlCodeBehind(XamlProjectItem? xamlItem, Compilation compilation, SourceProductionContext context, AssemblyCaches xmlnsCache, IDictionary<XmlType, string> typeCache)
380 static bool TryParseXaml(XamlProjectItem parseResult, string uid, Compilation compilation, AssemblyCaches xmlnsCache, IDictionary<XmlType, string> typeCache, CancellationToken cancellationToken, out string? accessModifier, out string? rootType, out string? rootClrNamespace, out bool generateDefaultCtor, out bool addXamlCompilationAttribute, out bool hideFromIntellisense, out bool xamlResourceIdOnly, out string? baseType, out IEnumerable<(string, string, string)>? namedFields)
460 static IEnumerable<(string name, string type, string accessModifier)> GetNamedFields(XmlNode root, XmlNamespaceManager nsmgr, Compilation compilation, AssemblyCaches xmlnsCache, IDictionary<XmlType, string> typeCache, CancellationToken cancellationToken)
495 static string GetTypeName(XmlType xmlType, Compilation compilation, AssemblyCaches xmlnsCache, IDictionary<XmlType, string> typeCache)
540 static string GetTypeNameFromCustomNamespace(XmlType xmlType, Compilation compilation, AssemblyCaches xmlnsCache)
771 class CompilationReferencesComparer : IEqualityComparer<Compilation>
773 public bool Equals(Compilation x, Compilation y)
788 public int GetHashCode(Compilation obj)
Microsoft.ML.InternalCodeAnalyzer (3)
Microsoft.VisualStudio.LanguageServices (62)
Library\ObjectBrowser\AbstractListItemFactory.cs (18)
169Compilation compilation,
183Compilation compilation,
205private ImmutableArray<ObjectListItem> GetBaseTypeListItems(INamedTypeSymbol namedTypeSymbol, Compilation compilation, ProjectId projectId)
229public ImmutableArray<ObjectListItem> GetBaseTypeListItems(ObjectListItem parentListItem, Compilation compilation)
245public ImmutableArray<ObjectListItem> GetFolderListItems(ObjectListItem parentListItem, Compilation compilation)
292Compilation compilation,
316private static ImmutableArray<ISymbol> GetMemberSymbols(INamedTypeSymbol namedTypeSymbol, Compilation compilation)
332private static ImmutableArray<ISymbol> GetInheritedMemberSymbols(INamedTypeSymbol namedTypeSymbol, Compilation compilation)
389public ImmutableArray<ObjectListItem> GetMemberListItems(ObjectListItem parentListItem, Compilation compilation)
438public ImmutableArray<ObjectListItem> GetNamespaceListItems(ObjectListItem parentListItem, Compilation compilation)
485var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(true);
511var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(true);
638public ImmutableArray<ObjectListItem> GetReferenceListItems(ObjectListItem parentListItem, Compilation compilation)
663private static ImmutableArray<INamedTypeSymbol> GetAccessibleTypes(INamespaceSymbol namespaceSymbol, Compilation compilation)
689Compilation compilation,
718public ImmutableArray<ObjectListItem> GetTypeListItems(ObjectListItem parentListItem, Compilation compilation)
743public void CollectTypeListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString)
775public void CollectMemberListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_ListItems.cs (8)
17internal void CollectMemberListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString)
23internal void CollectTypeListItems(IAssemblySymbol assemblySymbol, Compilation compilation, ProjectId projectId, ImmutableArray<ObjectListItem>.Builder builder, string searchString)
32internal ImmutableArray<ObjectListItem> GetBaseTypeListItems(ObjectListItem parentListItem, Compilation compilation)
35internal ImmutableArray<ObjectListItem> GetFolderListItems(ObjectListItem parentListItem, Compilation compilation)
38internal ImmutableArray<ObjectListItem> GetMemberListItems(ObjectListItem parentListItem, Compilation compilation)
41internal ImmutableArray<ObjectListItem> GetNamespaceListItems(ObjectListItem parentListItem, Compilation compilation)
47internal ImmutableArray<ObjectListItem> GetReferenceListItems(ObjectListItem parentListItem, Compilation compilation)
50internal ImmutableArray<ObjectListItem> GetTypeListItems(ObjectListItem parentListItem, Compilation compilation)
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,
Microsoft.VisualStudio.LanguageServices.CSharp (4)
Microsoft.VisualStudio.LanguageServices.VisualBasic (6)
Mvc.Analyzers.Test (36)
Mvc.Api.Analyzers.Test (57)
Roslyn.Test.PdbUtilities (19)
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)
SemanticSearch.BuildTask (1)
System.Text.Json.SourceGeneration (12)
System.Text.RegularExpressions.Generator (10)
System.Windows.Forms.PrivateSourceGenerators (2)
System.Windows.Forms.PrivateSourceGenerators.Tests (1)