2 types derived from SemanticModel
Microsoft.CodeAnalysis.CSharp (1)
Compilation\CSharpSemanticModel.cs (1)
46internal abstract class CSharpSemanticModel : SemanticModel
Microsoft.CodeAnalysis.VisualBasic (1)
Compilation\SemanticModel.vb (1)
38Inherits SemanticModel
10513 references to SemanticModel
Analyzer.Utilities.UnitTests (5)
FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisTests.cs (3)
68(IOperation? operation, SemanticModel? model, SyntaxNode? syntaxNode) = GetOperationAndSyntaxForTest<BlockSyntax>((CSharpCompilation)compilation); 1275protected static (IOperation? operation, SemanticModel? model, SyntaxNode? node) GetOperationAndSyntaxForTest<TSyntaxNode>(CSharpCompilation compilation) 1279var model = compilation.GetSemanticModel(tree);
Lightup\LightupHelpersTests.cs (2)
153ImmutableArray<SymbolDisplayPart> ISymbol.ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat? format) 156string ISymbol.ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat? format)
Metrics (107)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (4)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 34internal SemanticModel GetSemanticModel(SyntaxNode node)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (3)
74var model = context.GetSemanticModel(declSyntax); 182SemanticModel model = context.GetSemanticModel(declSyntax); 243var model = context.GetSemanticModel(node);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
458var semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
57var model = compilation.GetSemanticModel(receiverSyntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (1)
472public static SyntaxNode FirstUnusedIdentifierName(this SyntaxGenerator generator, SemanticModel semanticModel, int position, string baseName, int maxTries = int.MaxValue)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
22/// <see cref="SemanticModel"/> is needed, use <see cref="SemanticSpanAnalysis"/> or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
23SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (7)
14public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 18SemanticModel semanticModel1, 19SemanticModel semanticModel2, 48SemanticModel semanticModel1, 49SemanticModel semanticModel2, 129SemanticModel semanticModel1, 130SemanticModel semanticModel2,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
33public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 36public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 39public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 42public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 45public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 54public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66public static TSymbol? GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 88public static INamedTypeSymbol? GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 91public static INamespaceSymbol? GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 94public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel) 108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 137public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 168private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 219this SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
66SemanticModel? semanticModel, 68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (3)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 23public ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken) 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
15ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken); 18SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (25)
51bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 58bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 59bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 72bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 77ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken); 79ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 80SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 82IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 84ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 92IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 93IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 100bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 107bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 109string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 120IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (3)
17SemanticModel semanticModel) 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
386bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
44var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
53var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
87TryGetSemanticModel(compilation, syntaxTree, out var semanticModel)) 116[NotNullWhen(true)] out SemanticModel? semanticModel) 185TryGetSemanticModel(reader.Compilation, firstSourceTree, out var semanticModel)) 255SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
50private SemanticModel? _lazySpeculativeSemanticModel; 75SemanticModel semanticModel, 96protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 102protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 103protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType); 104protected abstract bool ConversionsAreCompatible(SemanticModel model1, TExpressionSyntax expression1, SemanticModel model2, TExpressionSyntax expression2); 109protected abstract bool IsForEachTypeInferred(TForEachStatementSyntax forEachStatement, SemanticModel semanticModel); 110protected abstract bool ForEachConversionsAreCompatible(SemanticModel originalModel, TForEachStatementSyntax originalForEach, SemanticModel newModel, TForEachStatementSyntax newForEach); 112SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType, out ImmutableArray<ILocalSymbol> localVariables); 155public SemanticModel OriginalSemanticModel { get; } 190public SemanticModel SpeculativeSemanticModel 224protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 977SemanticModel speculativeSemanticModel) 1031private bool IsReceiverNonUniquePossibleValueTypeParam(TExpressionSyntax invocation, SemanticModel semanticModel) 1049private static bool IsReceiverUniqueInstance(TExpressionSyntax receiver, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
26SemanticModel semanticModel, 47public static void AddAliasSymbols(SemanticModel semanticModel, int namespaceId, IEnumerable<IAliasSymbol> aliasSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (4)
11/// <see cref="SemanticModel.SyntaxTree"/> that <see cref="OriginalSemanticModel"/> points at. 17/// cref="SemanticModel.SyntaxTree"/> that <see cref="SpeculativeSemanticModel"/> points at. 24SemanticModel OriginalSemanticModel { get; } 30SemanticModel SpeculativeSemanticModel { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
Metrics.Legacy (107)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (4)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 34internal SemanticModel GetSemanticModel(SyntaxNode node)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (3)
74var model = context.GetSemanticModel(declSyntax); 182SemanticModel model = context.GetSemanticModel(declSyntax); 243var model = context.GetSemanticModel(node);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
458var semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
57var model = compilation.GetSemanticModel(receiverSyntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (1)
472public static SyntaxNode FirstUnusedIdentifierName(this SyntaxGenerator generator, SemanticModel semanticModel, int position, string baseName, int maxTries = int.MaxValue)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
22/// <see cref="SemanticModel"/> is needed, use <see cref="SemanticSpanAnalysis"/> or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
23SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (7)
14public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 18SemanticModel semanticModel1, 19SemanticModel semanticModel2, 48SemanticModel semanticModel1, 49SemanticModel semanticModel2, 129SemanticModel semanticModel1, 130SemanticModel semanticModel2,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
33public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 36public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 39public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 42public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 45public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 54public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66public static TSymbol? GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 88public static INamedTypeSymbol? GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 91public static INamespaceSymbol? GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 94public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel) 108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 137public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 168private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 219this SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
66SemanticModel? semanticModel, 68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (3)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 23public ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken) 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
15ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken); 18SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (25)
51bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 58bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 59bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 72bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 77ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken); 79ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 80SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 82IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 84ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 92IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 93IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 100bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 107bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 109string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 120IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (3)
17SemanticModel semanticModel) 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
386bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
44var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
53var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
87TryGetSemanticModel(compilation, syntaxTree, out var semanticModel)) 116[NotNullWhen(true)] out SemanticModel? semanticModel) 185TryGetSemanticModel(reader.Compilation, firstSourceTree, out var semanticModel)) 255SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
50private SemanticModel? _lazySpeculativeSemanticModel; 75SemanticModel semanticModel, 96protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 102protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 103protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType); 104protected abstract bool ConversionsAreCompatible(SemanticModel model1, TExpressionSyntax expression1, SemanticModel model2, TExpressionSyntax expression2); 109protected abstract bool IsForEachTypeInferred(TForEachStatementSyntax forEachStatement, SemanticModel semanticModel); 110protected abstract bool ForEachConversionsAreCompatible(SemanticModel originalModel, TForEachStatementSyntax originalForEach, SemanticModel newModel, TForEachStatementSyntax newForEach); 112SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType, out ImmutableArray<ILocalSymbol> localVariables); 155public SemanticModel OriginalSemanticModel { get; } 190public SemanticModel SpeculativeSemanticModel 224protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 977SemanticModel speculativeSemanticModel) 1031private bool IsReceiverNonUniquePossibleValueTypeParam(TExpressionSyntax invocation, SemanticModel semanticModel) 1049private static bool IsReceiverUniqueInstance(TExpressionSyntax receiver, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
26SemanticModel semanticModel, 47public static void AddAliasSymbols(SemanticModel semanticModel, int namespaceId, IEnumerable<IAliasSymbol> aliasSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (4)
11/// <see cref="SemanticModel.SyntaxTree"/> that <see cref="OriginalSemanticModel"/> points at. 17/// cref="SemanticModel.SyntaxTree"/> that <see cref="SpeculativeSemanticModel"/> points at. 24SemanticModel OriginalSemanticModel { get; } 30SemanticModel SpeculativeSemanticModel { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
Microsoft.Analyzers.Extra (12)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (10)
40internal Func<Document, CancellationToken, Task<SemanticModel?>> GetSemanticModelAsync = (d, t) => d.GetSemanticModelAsync(t); 41internal Func<SemanticModel, SyntaxNode, CancellationToken, IOperation?> GetOperation = (sm, sn, t) => sm.GetOperation(sn, t); 45internal Func<SemanticModel, BaseMethodDeclarationSyntax, CancellationToken, IMethodSymbol?> GetDeclaredSymbol = (sm, m, t) => sm.GetDeclaredSymbol(m, t); 80var sm = await GetSemanticModelAsync(invocationDoc, cancellationToken).ConfigureAwait(false); 140var invocationSM = (await invocationDoc.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false))!; 144var sm = docEditor.SemanticModel; 472var sm = docEditor.SemanticModel; 577var invocationSM = (await invocationDoc.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false))!; 582var sm = docEditor.SemanticModel; 628var semanticModel = comp.GetSemanticModel(targetClass.SyntaxTree);
Utilities\SyntaxNodeExtensions.cs (2)
44SemanticModel semanticModel, 104SemanticModel semanticModel,
Microsoft.Analyzers.Extra.Tests (6)
CallAnalysis\LegacyLoggingTests.cs (1)
862GetSemanticModelAsync = (_, _) => Task.FromResult<SemanticModel?>(null)
SyntaxNodeExtensionsTests.cs (5)
24Assert.Null(node.FindNodeInTreeUpToSpecifiedParentByMethodName(new Mock<SemanticModel>().Object, emptyList, new List<Type>())); 53var model = compilation.GetSemanticModel(tree); 85var model = compilation.GetSemanticModel(tree); 148var model = compilation.GetSemanticModel(tree); 178var model = compilation.GetSemanticModel(tree);
Microsoft.AspNetCore.Analyzers (1)
CompilationFeatureDetector.cs (1)
39var semanticModel = compilation.GetSemanticModel(syntaxReferences[j].SyntaxTree);
Microsoft.AspNetCore.App.Analyzers (27)
Infrastructure\RouteUsageCache.cs (1)
49var semanticModel = _compilation.GetSemanticModel(syntaxToken.SyntaxTree);
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (4)
124var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 293private static SyntaxToken? TryGetMvcActionRouteToken(CompletionContext context, SemanticModel semanticModel, MethodDeclarationSyntax method) 356private static bool HasNonRouteAttribute(SyntaxToken token, SemanticModel semanticModel, WellKnownTypes wellKnownTypes, CancellationToken cancellationToken) 386private static bool IsCurrentParameterBindable(SyntaxToken token, SemanticModel semanticModel, WellKnownTypes wellKnownTypes, CancellationToken cancellationToken)
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (10)
19public static bool IsRouteStringSyntaxToken(SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken, out RouteOptions options) 58SemanticModel semanticModel, 240SemanticModel semanticModel, 272SemanticModel semanticModel, 282SemanticModel semanticModel, 367private static ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 372private static IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, CancellationToken cancellationToken) 375private static IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, CancellationToken cancellationToken) 385SemanticModel semanticModel, 462SemanticModel semanticModel,
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (4)
57public static RouteUsageContext BuildContext(RouteOptions routeOptions, SyntaxToken token, SemanticModel semanticModel, WellKnownTypes wellKnownTypes, CancellationToken cancellationToken) 232public static MapMethodParts? FindMapMethodParts(SemanticModel semanticModel, WellKnownTypes wellKnownTypes, SyntaxNode container, CancellationToken cancellationToken) 260private static MapMethodParts? FindValidMapMethodParts(SemanticModel semanticModel, WellKnownTypes wellKnownTypes, BaseArgumentListSyntax argumentList, IMethodSymbol method) 333private static IMethodSymbol? GetMethodInfo(SemanticModel semanticModel, SyntaxNode syntaxNode, CancellationToken cancellationToken)
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (1)
29var semanticModel = context.SemanticModel;
RouteEmbeddedLanguage\RoutePatternBraceMatcher.cs (1)
19public AspNetCoreBraceMatchingResult? FindBraces(SemanticModel semanticModel, SyntaxToken token, int position, CancellationToken cancellationToken)
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
108var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
RouteEmbeddedLanguage\RoutePatternHighlighter.cs (3)
22SemanticModel semanticModel, SyntaxToken token, int position, CancellationToken cancellationToken) 35RouteUsageModel routeUsage, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 72private static void HighlightSymbol(SemanticModel semanticModel, IMethodSymbol methodSymbol, IList<AspNetCoreHighlightSpan> highlightSpans, ISymbol matchingParameter, CancellationToken cancellationToken)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
202SemanticModel? model,
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
198public static bool IsType(this INamedTypeSymbol type, string typeName, SemanticModel semanticModel)
Microsoft.AspNetCore.App.Analyzers.Test (3)
Infrastructure\WellKnownTypesTests.cs (1)
113var semanticModel = context.SemanticModel;
TestDiagnosticAnalyzer.cs (2)
68private async Task<(SyntaxToken token, SemanticModel model)> TryGetStringSyntaxTokenAtPositionAsync(int caretPosition, params string[] sources) 73var semanticModel = await document.GetSemanticModelAsync(CancellationToken.None).ConfigureAwait(false);
Microsoft.AspNetCore.App.CodeFixes (5)
Authorization\AddAuthorizationBuilderFixer.cs (1)
35var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
Dependencies\AddPackageFixer.cs (1)
37var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
Dependencies\ExtensionMethodsCompletionProvider.cs (1)
47var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
Http\HeaderDictionaryAddFixer.cs (1)
36var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
RouteParameterUnusedParameterFixer.cs (1)
37var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (7)
RequestDelegateGeneratorSuppressor.cs (1)
70var semanticModel = context.GetSemanticModel(sourceTree);
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
198public static bool IsType(this INamedTypeSymbol type, string typeName, SemanticModel semanticModel)
StaticRouteHandlerModel\Endpoint.cs (1)
19public Endpoint(IInvocationOperation operation, WellKnownTypes wellKnownTypes, SemanticModel semanticModel)
StaticRouteHandlerModel\InvocationOperationExtensions.cs (4)
42public static bool TryGetRouteHandlerMethod(this IInvocationOperation invocation, SemanticModel semanticModel, [NotNullWhen(true)] out IMethodSymbol? method) 83private static IMethodSymbol? ResolveMethodFromOperation(IOperation operation, SemanticModel semanticModel) => operation switch 97private static IOperation? ResolveDeclarationOperation(ISymbol symbol, SemanticModel? semanticModel) 112var targetSemanticModel = semanticModel?.Compilation.GetSemanticModel(expr.SyntaxTree);
Microsoft.AspNetCore.Mvc.Analyzers (1)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
202SemanticModel? model,
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
AddResponseTypeAttributeCodeFixAction.cs (3)
130var semanticModel = await _document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 255public CodeActionContext(SemanticModel semanticModel, 276public SemanticModel SemanticModel { get; }
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
202SemanticModel? model,
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (5)
HubClientProxyGenerator.Parser.cs (3)
208var registerCallbackProviderSemanticModel = _compilation.GetSemanticModel(methodDeclarationSyntax.SyntaxTree); 251var argModel = _compilation.GetSemanticModel(argType.SyntaxTree); 260var argModel = _compilation.GetSemanticModel(als.Arguments[0].Expression.SyntaxTree);
HubServerProxyGenerator.Parser.cs (2)
197var getProxySemanticModel = _compilation.GetSemanticModel(methodDeclarationSyntax.SyntaxTree); 236var argumentModel = _compilation.GetSemanticModel(proxyType.SyntaxTree);
Microsoft.CodeAnalysis (278)
Compilation\Compilation.cs (7)
308/// Gets a new <see cref="SemanticModel"/> for the specified syntax tree. 315public SemanticModel GetSemanticModel(SyntaxTree syntaxTree, bool ignoreAccessibility = false) 322public SemanticModel GetSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options) 326/// Gets a <see cref="SemanticModel"/> for the given <paramref name="syntaxTree"/>. 331protected abstract SemanticModel CommonGetSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options); 334/// Creates a new <see cref="SemanticModel"/> for the given <paramref name="syntaxTree"/>. 339internal abstract SemanticModel CreateSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options);
Compilation\ControlFlowAnalysis.cs (1)
11/// information is returned from a call to <see cref="SemanticModel.AnalyzeControlFlow(SyntaxNode)" />.
Compilation\DataFlowAnalysis.cs (1)
12/// <see cref="SemanticModel.AnalyzeDataFlow(SyntaxNode, SyntaxNode)" />, or one of its language-specific overloads,
Compilation\Extensions.cs (12)
19public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 43public static SymbolInfo GetSpeculativeSymbolInfo(this SemanticModel semanticModel, int position, SyntaxNode expression, SpeculativeBindingOption bindingOption) 55public static TypeInfo GetTypeInfo(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 68public static IAliasSymbol? GetAliasInfo(this SemanticModel semanticModel, SyntaxNode nameSyntax, CancellationToken cancellationToken = default(CancellationToken)) 90public static IAliasSymbol? GetSpeculativeAliasInfo(this SemanticModel semanticModel, int position, SyntaxNode nameSyntax, SpeculativeBindingOption bindingOption) 114public static TypeInfo GetSpeculativeTypeInfo(this SemanticModel semanticModel, int position, SyntaxNode expression, SpeculativeBindingOption bindingOption) 129public static ISymbol? GetDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 140public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 148public static ControlFlowAnalysis AnalyzeControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 156public static ControlFlowAnalysis AnalyzeControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 164public static DataFlowAnalysis AnalyzeDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 173public static DataFlowAnalysis AnalyzeDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression)
Compilation\IImportScope.cs (1)
39/// cref="SemanticModel.GetImportScopes"/>.</item>
Compilation\SemanticModel.cs (3)
261public SemanticModel? ParentModel 270protected abstract SemanticModel? ParentModelCore 279internal abstract SemanticModel ContainingPublicModelOrSelf
Compilation\SemanticModelProvider.cs (2)
16/// Gets a <see cref="SemanticModel"/> for the given <paramref name="tree"/> that belongs to the given <paramref name="compilation"/>. 18public abstract SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation, SemanticModelOptions options = default);
DiagnosticAnalyzer\AnalysisContextInfo.cs (1)
27public AnalysisContextInfo(SemanticModel model) :
DiagnosticAnalyzer\AnalyzerDriver.cs (11)
1012private SemanticModel GetOrCreateSemanticModel(SyntaxTree tree) 1015protected SemanticModel GetOrCreateSemanticModel(SyntaxTree tree, Compilation compilation) 1276var model = compilation.GetSemanticModel(location.SourceTree); 1336var model = compilation.GetSemanticModel(tree); 1902var model = compilation.GetSemanticModel(syntaxReference.SyntaxTree); 1919var semanticModel = GetOrCreateSemanticModel(completedEvent.CompilationUnit, completedEvent.Compilation); 2553SemanticModel semanticModel, 2571private static void ComputeDeclarationsInNode(SemanticModel semanticModel, ISymbol declaredSymbol, SyntaxNode declaringReferenceSyntax, SyntaxNode topmostNodeForAnalysis, ArrayBuilder<DeclarationInfo> builder, CancellationToken cancellationToken) 2600var semanticModel = symbolEvent.SemanticModelWithCachedBoundNodes ?? 2876SemanticModel semanticModel, 2950SemanticModel semanticModel,
DiagnosticAnalyzer\AnalyzerExecutor.cs (10)
42private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 128Func<SyntaxTree, SemanticModel> getSemanticModel, 162Func<SyntaxTree, SemanticModel> getSemanticModel, 627SemanticModel semanticModel, 819SemanticModel semanticModel, 826public readonly SemanticModel SemanticModel = semanticModel; 842SemanticModel semanticModel, 947SemanticModel semanticModel, 1105SemanticModel model, 1208SemanticModel model,
DiagnosticAnalyzer\CachingSemanticModelProvider.cs (5)
40public override SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation, SemanticModelOptions options = default) 59private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelsMap; 63private readonly Func<SyntaxTree, SemanticModel> _createSemanticModel; 68_semanticModelsMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 72public SemanticModel GetSemanticModel(SyntaxTree tree, SemanticModelOptions options)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (8)
186private void VerifyModel(SemanticModel model) 598public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsAsync(SemanticModel model, TextSpan? filterSpan, CancellationToken cancellationToken) 613public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 628public Task<AnalysisResult> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, CancellationToken cancellationToken) 643public Task<AnalysisResult> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 651private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 658private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 1034var mappedModel = compilation.GetSemanticModel(analysisScope.FilterFileOpt!.Value.SourceTree!);
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
34var semanticModel = _compilation.GetSemanticModel(context.Tree);
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (32)
64/// which will operate on the <see cref="SemanticModel"/> of the document. A semantic model action 67/// <param name="action">Action to be executed for a document's <see cref="SemanticModel"/>.</param> 359/// which will operate on the <see cref="SemanticModel"/> of the document. A semantic model action 362/// <param name="action">Action to be executed for a document's <see cref="SemanticModel"/>.</param> 679/// A semantic model action operates on the <see cref="CodeAnalysis.SemanticModel"/> of a code document, and can use a <see cref="SemanticModelAnalysisContext"/> to report <see cref="Diagnostic"/>s about the model. 683private readonly SemanticModel _semanticModel; 690/// <see cref="CodeAnalysis.SemanticModel"/> that is the subject of the analysis. 692public SemanticModel SemanticModel { get { return _semanticModel; } } 717/// Indicates if the underlying <see cref="SemanticModel.SyntaxTree"/> is generated code. 722public SemanticModelAnalysisContext(SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 728SemanticModel semanticModel, 747/// Report a <see cref="Diagnostic"/> about a <see cref="CodeAnalysis.SemanticModel"/>. 1022private readonly SemanticModel _semanticModel; 1037/// <see cref="CodeAnalysis.SemanticModel"/> that can provide semantic information about the <see cref="SyntaxNode"/>s in the code block. 1039public SemanticModel SemanticModel { get { return _semanticModel; } } 1069protected CodeBlockStartAnalysisContext(SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, CancellationToken cancellationToken) 1077SemanticModel semanticModel, 1130private readonly SemanticModel _semanticModel; 1147/// <see cref="CodeAnalysis.SemanticModel"/> that can provide semantic information about the <see cref="SyntaxNode"/>s in the code block. 1149public SemanticModel SemanticModel { get { return _semanticModel; } } 1179public CodeBlockAnalysisContext(SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1187SemanticModel semanticModel, 1662private readonly SemanticModel _semanticModel; 1679/// <see cref="CodeAnalysis.SemanticModel"/> that can provide semantic information about the <see cref="SyntaxNode"/>. 1681public SemanticModel SemanticModel => _semanticModel; 1716public SyntaxNodeAnalysisContext(SyntaxNode node, ISymbol? containingSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1722public SyntaxNodeAnalysisContext(SyntaxNode node, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1730SemanticModel semanticModel, 1885private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 1920Func<SyntaxTree, SemanticModel> getSemanticModel, 1961/// Gets a <see cref="SemanticModel"/> for the given <see cref="SyntaxTree"/>, which is shared across all analyzers. 1963public SemanticModel GetSemanticModel(SyntaxTree syntaxTree) => _getSemanticModel(syntaxTree);
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (1)
305SemanticModel semanticModel,
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (1)
163var model = _compilation.GetSemanticModel(location.SourceTree);
DiagnosticAnalyzer\SymbolDeclaredCompilationEvent.cs (2)
23SemanticModel? semanticModelWithCachedBoundNodes = null) 35public SemanticModel? SemanticModelWithCachedBoundNodes { get; }
Generated\Operations.Generated.cs (134)
4001internal BlockOperation(ImmutableArray<IOperation> operations, ImmutableArray<ILocalSymbol> locals, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4058internal VariableDeclarationGroupOperation(ImmutableArray<IVariableDeclarationOperation> declarations, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4113internal SwitchOperation(ImmutableArray<ILocalSymbol> locals, IOperation value, ImmutableArray<ISwitchCaseOperation> cases, ILabelSymbol exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4183protected BaseLoopOperation(IOperation body, ImmutableArray<ILocalSymbol> locals, ILabelSymbol continueLabel, ILabelSymbol exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4199internal ForEachLoopOperation(IOperation loopControlVariable, IOperation collection, ImmutableArray<IOperation> nextVariables, ForEachLoopOperationInfo? info, bool isAsynchronous, IOperation body, ImmutableArray<ILocalSymbol> locals, ILabelSymbol continueLabel, ILabelSymbol exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4289internal ForLoopOperation(ImmutableArray<IOperation> before, ImmutableArray<ILocalSymbol> conditionLocals, IOperation? condition, ImmutableArray<IOperation> atLoopBottom, IOperation body, ImmutableArray<ILocalSymbol> locals, ILabelSymbol continueLabel, ILabelSymbol exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4381internal ForToLoopOperation(IOperation loopControlVariable, IOperation initialValue, IOperation limitValue, IOperation stepValue, bool isChecked, ImmutableArray<IOperation> nextVariables, (ILocalSymbol LoopObject, ForToLoopOperationUserDefinedInfo UserDefinedInfo) info, IOperation body, ImmutableArray<ILocalSymbol> locals, ILabelSymbol continueLabel, ILabelSymbol exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4493internal WhileLoopOperation(IOperation? condition, bool conditionIsTop, bool conditionIsUntil, IOperation? ignoredCondition, IOperation body, ImmutableArray<ILocalSymbol> locals, ILabelSymbol continueLabel, ILabelSymbol exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4517internal LabeledOperation(ILabelSymbol label, IOperation? operation, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4570internal BranchOperation(ILabelSymbol target, BranchKind branchKind, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4590internal EmptyOperation(SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4604internal ReturnOperation(IOperation? returnedValue, OperationKind kind, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4656internal LockOperation(IOperation lockedValue, IOperation body, ILocalSymbol? lockTakenSymbol, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4720internal TryOperation(IBlockOperation body, ImmutableArray<ICatchClauseOperation> catches, IBlockOperation? @finally, ILabelSymbol? exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4799internal UsingOperation(IOperation resources, IOperation body, ImmutableArray<ILocalSymbol> locals, bool isAsynchronous, DisposeOperationInfo disposeInfo, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4867internal ExpressionStatementOperation(IOperation operation, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4918internal LocalFunctionOperation(IMethodSymbol symbol, IBlockOperation? body, IBlockOperation? ignoredBody, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4982internal StopOperation(SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4996internal EndOperation(SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 5010internal RaiseEventOperation(IEventReferenceOperation eventReference, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 5076internal LiteralOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5094internal ConversionOperation(IOperation operand, IConvertibleConversion conversion, bool isTryCast, bool isChecked, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5154internal InvocationOperation(IMethodSymbol targetMethod, ITypeSymbol? constrainedToType, IOperation? instance, bool isVirtual, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5227internal ArrayElementReferenceOperation(IOperation arrayReference, ImmutableArray<IOperation> indices, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5294internal LocalReferenceOperation(ILocalSymbol local, bool isDeclaration, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5316internal ParameterReferenceOperation(IParameterSymbol parameter, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5335protected BaseMemberReferenceOperation(IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 5345internal FieldReferenceOperation(IFieldSymbol field, bool isDeclaration, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5400internal MethodReferenceOperation(IMethodSymbol method, ITypeSymbol? constrainedToType, bool isVirtual, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5456internal PropertyReferenceOperation(IPropertySymbol property, ITypeSymbol? constrainedToType, ImmutableArray<IArgumentOperation> arguments, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5525internal EventReferenceOperation(IEventSymbol @event, ITypeSymbol? constrainedToType, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5579internal UnaryOperation(UnaryOperatorKind operatorKind, IOperation operand, bool isLifted, bool isChecked, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5642internal BinaryOperation(BinaryOperatorKind operatorKind, IOperation leftOperand, IOperation rightOperand, bool isLifted, bool isChecked, bool isCompareText, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, IMethodSymbol? unaryOperatorMethod, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5720internal ConditionalOperation(IOperation condition, IOperation whenTrue, IOperation? whenFalse, bool isRef, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5797internal CoalesceOperation(IOperation value, IOperation whenNull, IConvertibleConversion valueConversion, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5864internal AnonymousFunctionOperation(IMethodSymbol symbol, IBlockOperation body, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 5917internal ObjectCreationOperation(IMethodSymbol? constructor, IObjectOrCollectionInitializerOperation? initializer, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5987internal TypeParameterObjectCreationOperation(IObjectOrCollectionInitializerOperation? initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6039internal ArrayCreationOperation(ImmutableArray<IOperation> dimensionSizes, IArrayInitializerOperation? initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6106internal InstanceReferenceOperation(InstanceReferenceKind referenceKind, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6125internal IsTypeOperation(IOperation valueOperand, ITypeSymbol typeOperand, bool isNegated, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6181internal AwaitOperation(IOperation operation, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6233protected BaseAssignmentOperation(IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 6244internal SimpleAssignmentOperation(bool isRef, IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6306internal CompoundAssignmentOperation(IConvertibleConversion inConversion, IConvertibleConversion outConversion, BinaryOperatorKind operatorKind, bool isLifted, bool isChecked, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6381internal ParenthesizedOperation(IOperation operand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6434internal EventAssignmentOperation(IOperation eventReference, IOperation handlerValue, bool adds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6499internal ConditionalAccessOperation(IOperation operation, IOperation whenNotNull, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6562internal ConditionalAccessInstanceOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6579internal InterpolatedStringOperation(ImmutableArray<IInterpolatedStringContentOperation> parts, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6636internal AnonymousObjectCreationOperation(ImmutableArray<IOperation> initializers, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6692internal ObjectOrCollectionInitializerOperation(ImmutableArray<IOperation> initializers, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6748internal MemberInitializerOperation(IOperation initializedMember, IObjectOrCollectionInitializerOperation initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6811internal NameOfOperation(IOperation argument, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6864internal TupleOperation(ImmutableArray<IOperation> elements, ITypeSymbol? naturalType, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6922internal DynamicMemberReferenceOperation(IOperation? instance, string memberName, ImmutableArray<ITypeSymbol> typeArguments, ITypeSymbol? containingType, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6980internal TranslatedQueryOperation(IOperation operation, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7032internal DelegateCreationOperation(IOperation target, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7084internal DefaultValueOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 7102internal TypeOfOperation(ITypeSymbol typeOperand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7121internal SizeOfOperation(ITypeSymbol typeOperand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 7141internal AddressOfOperation(IOperation reference, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7193internal IsPatternOperation(IOperation value, IPatternOperation pattern, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7256internal IncrementOrDecrementOperation(bool isPostfix, bool isLifted, bool isChecked, IOperation target, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, OperationKind kind, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7319internal ThrowOperation(IOperation? exception, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7371internal DeconstructionAssignmentOperation(IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7430internal DeclarationExpressionOperation(IOperation expression, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7482internal OmittedArgumentOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7499protected BaseSymbolInitializerOperation(ImmutableArray<ILocalSymbol> locals, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7510internal FieldInitializerOperation(ImmutableArray<IFieldSymbol> initializedFields, ImmutableArray<ILocalSymbol> locals, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7561internal VariableInitializerOperation(ImmutableArray<ILocalSymbol> locals, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7608internal PropertyInitializerOperation(ImmutableArray<IPropertySymbol> initializedProperties, ImmutableArray<ILocalSymbol> locals, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7659internal ParameterInitializerOperation(IParameterSymbol parameter, ImmutableArray<ILocalSymbol> locals, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7710internal ArrayInitializerOperation(ImmutableArray<IOperation> elementValues, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7765internal VariableDeclaratorOperation(ILocalSymbol symbol, IVariableInitializerOperation? initializer, ImmutableArray<IOperation> ignoredArguments, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7833internal VariableDeclarationOperation(ImmutableArray<IVariableDeclaratorOperation> declarators, IVariableInitializerOperation? initializer, ImmutableArray<IOperation> ignoredDimensions, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7914internal ArgumentOperation(ArgumentKind argumentKind, IParameterSymbol? parameter, IOperation value, IConvertibleConversion inConversion, IConvertibleConversion outConversion, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7975internal CatchClauseOperation(IOperation? exceptionDeclarationOrExpression, ITypeSymbol exceptionType, ImmutableArray<ILocalSymbol> locals, IOperation? filter, IBlockOperation handler, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8052internal SwitchCaseOperation(ImmutableArray<ICaseClauseOperation> clauses, ImmutableArray<IOperation> body, ImmutableArray<ILocalSymbol> locals, IOperation? condition, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8126protected BaseCaseClauseOperation(ILabelSymbol? label, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8136internal DefaultCaseClauseOperation(ILabelSymbol? label, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8150internal PatternCaseClauseOperation(ILabelSymbol label, IPatternOperation pattern, IOperation? guard, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8213internal RangeCaseClauseOperation(IOperation minimumValue, IOperation maximumValue, ILabelSymbol? label, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8275internal RelationalCaseClauseOperation(IOperation value, BinaryOperatorKind relation, ILabelSymbol? label, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8328internal SingleValueCaseClauseOperation(IOperation value, ILabelSymbol? label, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8379protected BaseInterpolatedStringContentOperation(SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8384internal InterpolatedStringTextOperation(IOperation text, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8435internal InterpolationOperation(IOperation expression, IOperation? alignment, IOperation? formatString, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8508protected BasePatternOperation(ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8519internal ConstantPatternOperation(IOperation value, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8570internal DeclarationPatternOperation(ITypeSymbol? matchedType, bool matchesNull, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8592internal TupleBinaryOperation(BinaryOperatorKind operatorKind, IOperation leftOperand, IOperation rightOperand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8657protected BaseMethodBodyBaseOperation(IBlockOperation? blockBody, IBlockOperation? expressionBody, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8668internal MethodBodyOperation(IBlockOperation? blockBody, IBlockOperation? expressionBody, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8724internal ConstructorBodyOperation(ImmutableArray<ILocalSymbol> locals, IOperation? initializer, IBlockOperation? blockBody, IBlockOperation? expressionBody, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8795internal DiscardOperation(IDiscardSymbol discardSymbol, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8814internal FlowCaptureOperation(CaptureId id, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8867internal FlowCaptureReferenceOperation(CaptureId id, bool isInitialization, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 8889internal IsNullOperation(IOperation operand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 8942internal CaughtExceptionOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8959internal StaticLocalInitializationSemaphoreOperation(ILocalSymbol local, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8978internal CoalesceAssignmentOperation(IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9037internal RangeOperation(IOperation? leftOperand, IOperation? rightOperand, bool isLifted, IMethodSymbol? method, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9104internal ReDimOperation(ImmutableArray<IReDimClauseOperation> clauses, bool preserve, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9161internal ReDimClauseOperation(IOperation operand, ImmutableArray<IOperation> dimensionSizes, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9227internal RecursivePatternOperation(ITypeSymbol matchedType, ISymbol? deconstructSymbol, ImmutableArray<IPatternOperation> deconstructionSubpatterns, ImmutableArray<IPropertySubpatternOperation> propertySubpatterns, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9303internal DiscardPatternOperation(ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9317internal SwitchExpressionOperation(IOperation value, ImmutableArray<ISwitchExpressionArmOperation> arms, bool isExhaustive, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9386internal SwitchExpressionArmOperation(IPatternOperation pattern, IOperation? guard, IOperation value, ImmutableArray<ILocalSymbol> locals, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9461internal PropertySubpatternOperation(IOperation member, IPatternOperation pattern, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9523internal AggregateQueryOperation(IOperation group, IOperation aggregation, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9586internal FixedOperation(ImmutableArray<ILocalSymbol> locals, IVariableDeclarationGroupOperation variables, IOperation body, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9650internal NoPiaObjectCreationOperation(IObjectOrCollectionInitializerOperation? initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9702internal PlaceholderOperation(PlaceholderKind placeholderKind, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9721internal WithStatementOperation(IOperation body, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9783internal UsingDeclarationOperation(IVariableDeclarationGroupOperation declarationGroup, bool isAsynchronous, DisposeOperationInfo disposeInfo, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9838internal NegatedPatternOperation(IPatternOperation pattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9889internal BinaryPatternOperation(BinaryOperatorKind operatorKind, IPatternOperation leftPattern, IPatternOperation rightPattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9953internal TypePatternOperation(ITypeSymbol matchedType, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9971internal RelationalPatternOperation(BinaryOperatorKind operatorKind, IOperation value, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10024internal WithOperation(IOperation operand, IMethodSymbol? cloneMethod, IObjectOrCollectionInitializerOperation initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10089internal InterpolatedStringHandlerCreationOperation(IOperation handlerCreation, bool handlerCreationHasSuccessParameter, bool handlerAppendCallsReturnBool, IOperation content, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10156internal InterpolatedStringAdditionOperation(IOperation left, IOperation right, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10218internal InterpolatedStringAppendOperation(IOperation appendCall, OperationKind kind, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10270internal InterpolatedStringHandlerArgumentPlaceholderOperation(int argumentIndex, InterpolatedStringArgumentPlaceholderKind placeholderKind, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10290internal FunctionPointerInvocationOperation(IOperation target, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10357internal ListPatternOperation(ISymbol? lengthSymbol, ISymbol? indexerSymbol, ImmutableArray<IPatternOperation> patterns, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10418internal SlicePatternOperation(ISymbol? sliceSymbol, IPatternOperation? pattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10471internal ImplicitIndexerReferenceOperation(IOperation instance, IOperation argument, ISymbol lengthSymbol, ISymbol indexerSymbol, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10538internal Utf8StringOperation(string value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10557internal AttributeOperation(IOperation operation, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10608internal InlineArrayAccessOperation(IOperation instance, IOperation argument, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10671internal CollectionExpressionOperation(IMethodSymbol? constructMethod, ImmutableArray<IOperation> elements, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10729internal SpreadOperation(IOperation operand, ITypeSymbol? elementType, IConvertibleConversion elementConversion, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit)
Operations\ControlFlowGraph.cs (2)
80/// Returns null if <see cref="SemanticModel.GetOperation(SyntaxNode, CancellationToken)"/> returns null for the given <paramref name="node"/> and <paramref name="semanticModel"/>. 83public static ControlFlowGraph? Create(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken = default)
Operations\IOperation.cs (2)
74/// Non-null for operations generated from source with <see cref="SemanticModel.GetOperation(SyntaxNode, System.Threading.CancellationToken)"/> API 78SemanticModel? SemanticModel { get; }
Operations\Operation.cs (5)
21private readonly SemanticModel? _owningSemanticModelOpt; 27protected Operation(SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 123SemanticModel? IOperation.SemanticModel => _owningSemanticModelOpt?.ContainingPublicModelOrSelf; 128/// is the semantic model on which <see cref="SemanticModel.GetOperation(SyntaxNode, CancellationToken)"/> was invoked 131internal SemanticModel? OwningSemanticModel => _owningSemanticModelOpt;
Operations\OperationExtensions.cs (1)
47var model = operation.SemanticModel;
Operations\OperationFactory.cs (1)
11public static IInvalidOperation CreateInvalidOperation(SemanticModel semanticModel, SyntaxNode syntax, ImmutableArray<IOperation> children, bool isImplicit)
Operations\OperationNodes.cs (8)
18public NoneOperation(ImmutableArray<IOperation> children, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) : 87public InvalidOperation(ImmutableArray<IOperation> children, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) : 235protected HasDynamicArgumentsExpression(ImmutableArray<IOperation> arguments, ImmutableArray<string?> argumentNames, ImmutableArray<RefKind> argumentRefKinds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) : 252public DynamicObjectCreationOperation(IObjectOrCollectionInitializerOperation? initializer, ImmutableArray<IOperation> arguments, ImmutableArray<string?> argumentNames, ImmutableArray<RefKind> argumentRefKinds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) : 334public DynamicInvocationOperation(IOperation operation, ImmutableArray<IOperation> arguments, ImmutableArray<string?> argumentNames, ImmutableArray<RefKind> argumentRefKinds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) : 416public DynamicIndexerAccessOperation(IOperation operation, ImmutableArray<IOperation> arguments, ImmutableArray<string?> argumentNames, ImmutableArray<RefKind> argumentRefKinds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) : 688public static BlockOperation CreateTemporaryBlock(ImmutableArray<IOperation> statements, SemanticModel semanticModel, SyntaxNode syntax) 691private BlockOperation(ImmutableArray<IOperation> statements, SemanticModel semanticModel, SyntaxNode syntax)
SourceGeneration\GeneratorContexts.cs (4)
231private readonly Lazy<SemanticModel>? _semanticModel; 233internal GeneratorSyntaxContext(SyntaxNode node, Lazy<SemanticModel>? semanticModel, ISyntaxHelper syntaxHelper) 246/// The <see cref="CodeAnalysis.SemanticModel" /> that can be queried to obtain information about <see cref="Node"/>. 248public SemanticModel SemanticModel => _semanticModel!.Value;
SourceGeneration\GeneratorSyntaxWalker.cs (1)
23public void VisitWithModel(Lazy<SemanticModel>? model, SyntaxNode node)
SourceGeneration\ISyntaxReceiver.cs (1)
46/// <see cref="SemanticModel"/> that can be queried to obtain more information, before generation
SourceGeneration\Nodes\ISyntaxStrategy.cs (1)
20void VisitTree(Lazy<SyntaxNode> root, EntryState state, Lazy<SemanticModel>? model, CancellationToken cancellationToken);
SourceGeneration\Nodes\PredicateSyntaxStrategy.cs (1)
64Lazy<SemanticModel>? model,
SourceGeneration\Nodes\SyntaxReceiverStrategy.cs (1)
70Lazy<SemanticModel>? model,
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (3)
32public SemanticModel SemanticModel { get; } 47SemanticModel semanticModel, 109var semanticModel = compilation.GetSemanticModel(syntaxTree);
SourceGeneration\SyntaxStore.cs (1)
90var model = state != EntryState.Removed ? new Lazy<SemanticModel>(() => _compilation.GetSemanticModel(tree)) : null;
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (5)
17internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, ArrayBuilder<SyntaxNode>? executableCodeBlocks, CancellationToken cancellationToken) 36internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken) 41internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, SyntaxNode executableCodeBlock, CancellationToken cancellationToken) 52internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken, params SyntaxNode[] executableCodeBlocks) 63private static ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken)
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (3)
21private SemanticModel? _semanticModelOpt; 39protected SemanticModel? SemanticModelOpt => _semanticModelOpt; 73SemanticModel? semanticModelOpt,
Symbols\IFieldSymbol.cs (1)
85/// The inferred nullability is only exposed indirectly via APIs that give information about expressions, such as <see cref="SemanticModel.GetTypeInfo"/> when called with a <see langword="field"/> expression.
Symbols\ISymbol.cs (2)
267SemanticModel semanticModel, 282SemanticModel semanticModel,
Symbols\ITypeSymbol.cs (2)
171SemanticModel semanticModel, 187SemanticModel semanticModel,
Microsoft.CodeAnalysis.Analyzers (291)
FixAnalyzers\FixerWithFixAllAnalyzer.Fixer.cs (1)
62var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
MetaAnalyzers\DiagnosticAnalyzerAPIUsageAnalyzer.cs (1)
201var semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree);
MetaAnalyzers\DiagnosticAnalyzerCorrectnessAnalyzer.SyntaxNodeWithinAnalyzerTypeCompilationAnalyzer.cs (2)
51SemanticModel semanticModel = symbolContext.Compilation.GetSemanticModel(classDecl.SyntaxTree); 60protected abstract void AnalyzeNode(SymbolAnalysisContext symbolContext, TSyntaxNodeOfInterest syntaxNode, SemanticModel semanticModel);
MetaAnalyzers\DiagnosticAnalyzerFieldsAnalyzer.cs (2)
121protected override void AnalyzeNode(SymbolAnalysisContext symbolContext, TFieldDeclarationSyntax syntaxNode, SemanticModel semanticModel) 172private static bool IsContainedInFuncOrAction(TTypeSyntax typeSyntax, SemanticModel model)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (1)
921static IFieldInitializerOperation? GetFieldInitializer(SyntaxNode fieldDeclaration, SemanticModel model)
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (4)
67var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 82var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 187private async Task<Document> EnsureEqualsCorrectAsync(Document document, SemanticModel semanticModel, IInvocationOperation invocationOperation, CancellationToken cancellationToken) 257private static async Task<Document> ConvertToEqualsAsync(Document document, SemanticModel semanticModel, IBinaryOperation binaryOperation, CancellationToken cancellationToken)
MetaAnalyzers\Fixers\ConfigureGeneratedCodeAnalysisFix.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (2)
49var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 107SemanticModel model,
MetaAnalyzers\RegisterActionAnalyzer.cs (2)
311SemanticModel semanticModel = context.SemanticModel; 456private void NoteRegisterActionInvocation(IMethodSymbol method, TInvocationExpressionSyntax invocation, SemanticModel model, CancellationToken cancellationToken)
MetaAnalyzers\ReportDiagnosticAnalyzer.cs (3)
169SemanticModel semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree); 179private ImmutableArray<IFieldSymbol> GetReferencedDescriptorFields(SyntaxNode syntax, SemanticModel semanticModel, CancellationToken cancellationToken) 198protected override void AnalyzeNode(SymbolAnalysisContext symbolContext, TInvocationExpressionSyntax syntaxNode, SemanticModel semanticModel)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (4)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 34internal SemanticModel GetSemanticModel(SyntaxNode node)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (3)
74var model = context.GetSemanticModel(declSyntax); 182SemanticModel model = context.GetSemanticModel(declSyntax); 243var model = context.GetSemanticModel(node);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
458var semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
57var model = compilation.GetSemanticModel(receiverSyntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (1)
472public static SyntaxNode FirstUnusedIdentifierName(this SyntaxGenerator generator, SemanticModel semanticModel, int position, string baseName, int maxTries = int.MaxValue)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
22/// <see cref="SemanticModel"/> is needed, use <see cref="SemanticSpanAnalysis"/> or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
23SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (7)
14public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 18SemanticModel semanticModel1, 19SemanticModel semanticModel2, 48SemanticModel semanticModel1, 49SemanticModel semanticModel2, 129SemanticModel semanticModel1, 130SemanticModel semanticModel2,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
33public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 36public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 39public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 42public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 45public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 54public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66public static TSymbol? GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 88public static INamedTypeSymbol? GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 91public static INamespaceSymbol? GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 94public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel) 108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 137public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 168private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 219this SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
66SemanticModel? semanticModel, 68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (3)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 23public ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken) 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
15ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken); 18SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (25)
51bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 58bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 59bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 72bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 77ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken); 79ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 80SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 82IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 84ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 92IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 93IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 100bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 107bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 109string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 120IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (3)
17SemanticModel semanticModel) 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
386bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
44var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
53var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
87TryGetSemanticModel(compilation, syntaxTree, out var semanticModel)) 116[NotNullWhen(true)] out SemanticModel? semanticModel) 185TryGetSemanticModel(reader.Compilation, firstSourceTree, out var semanticModel)) 255SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
50private SemanticModel? _lazySpeculativeSemanticModel; 75SemanticModel semanticModel, 96protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 102protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 103protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType); 104protected abstract bool ConversionsAreCompatible(SemanticModel model1, TExpressionSyntax expression1, SemanticModel model2, TExpressionSyntax expression2); 109protected abstract bool IsForEachTypeInferred(TForEachStatementSyntax forEachStatement, SemanticModel semanticModel); 110protected abstract bool ForEachConversionsAreCompatible(SemanticModel originalModel, TForEachStatementSyntax originalForEach, SemanticModel newModel, TForEachStatementSyntax newForEach); 112SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType, out ImmutableArray<ILocalSymbol> localVariables); 155public SemanticModel OriginalSemanticModel { get; } 190public SemanticModel SpeculativeSemanticModel 224protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 977SemanticModel speculativeSemanticModel) 1031private bool IsReceiverNonUniquePossibleValueTypeParam(TExpressionSyntax invocation, SemanticModel semanticModel) 1049private static bool IsReceiverUniqueInstance(TExpressionSyntax receiver, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
26SemanticModel semanticModel, 47public static void AddAliasSymbols(SemanticModel semanticModel, int namespaceId, IEnumerable<IAliasSymbol> aliasSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (4)
11/// <see cref="SemanticModel.SyntaxTree"/> that <see cref="OriginalSemanticModel"/> points at. 17/// cref="SemanticModel.SyntaxTree"/> that <see cref="SpeculativeSemanticModel"/> points at. 24SemanticModel OriginalSemanticModel { get; } 30SemanticModel SpeculativeSemanticModel { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
199public string ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null) 202public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (2)
65public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 68public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
73protected abstract INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model); 78SemanticModel model, 94SemanticModel model, 121var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 183var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 259private static bool IsInsideNamespace(SyntaxNode node, INamespaceSymbol symbol, SemanticModel model, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
12SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14SemanticModel semanticModel, 48public SemanticModel SemanticModel { get; } = semanticModel;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (6)
33public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 35if (document.TryGetSemanticModel(out var semanticModel)) 111public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 128public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 153public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 178var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeInferenceServiceExtensions.cs (11)
15public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 18public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 21public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 24public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 29SemanticModel semanticModel, 39SemanticModel semanticModel, 47private static INamedTypeSymbol? GetFirstDelegateType(SemanticModel semanticModel, ImmutableArray<ITypeSymbol> types) 55SemanticModel semanticModel, 67SemanticModel semanticModel, 85SemanticModel semanticModel, 97SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (13)
30Func<SemanticModel, TType, TNode, bool> canReplace, 31Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 53Func<SemanticModel, TType, TNode, bool> canReplace, 54Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 75Func<SemanticModel, TNode, bool> canReplace, 76Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 97Func<SemanticModel, TType, TNode, bool> canReplace, 98Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 119Func<SemanticModel, TNode, bool> canReplace, 120Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 155Func<SemanticModel, TType, TNode, bool> canReplace, 156Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 172var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (4)
338SemanticModel semanticModel, 389SemanticModel semanticModel, 451SemanticModel semanticModel, 461this SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, string identifierName)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
62SemanticModel semanticModel, 454SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (7)
37SemanticModel semanticModel, 47SemanticModel semanticModel, 58SemanticModel semanticModel, 140SemanticModel semanticModel, 232SemanticModel semanticModel, 258private static SyntaxNode GetNegationOfIsPatternExpression(SyntaxNode isExpression, SyntaxGenerator generator, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, CancellationToken cancellationToken) 471SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
38SemanticModel semanticModel, 119var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 208var semanticModel = compilation.GetSemanticModel(group.Key);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
82var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
27var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 34var currentModel = await current.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (31)
39SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 47SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 55SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 63SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 71SemanticModel semanticModel, 95protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, CancellationToken cancellationToken) 179public bool IsWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 182public bool IsOnlyWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 185public bool IsInOutContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 188public bool IsInRefContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 191public bool IsInInContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 194public bool CanReplaceWithRValue(SemanticModel semanticModel, SyntaxNode? expression, CancellationToken cancellationToken) 197public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 203public bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel) 206public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken) 209public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement) 212public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 215public IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 218public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 221public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 227public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 230public IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 233public IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 236public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 239public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 242public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 245public bool IsInsideNameOfExpression(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 251public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, INamedTypeSymbol? expressionTypeOpt, CancellationToken cancellationToken) 254public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 257public IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (17)
15bool IsExpressionContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 16bool IsStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 17bool IsTypeContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 18bool IsNamespaceContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 19bool IsNamespaceDeclarationNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 20bool IsTypeDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 21bool IsMemberDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 22bool IsGlobalStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 23bool IsLabelContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 24bool IsAttributeNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 27SemanticModel semanticModel, SyntaxNode location, 31SemanticModel semanticModel, SyntaxNode location, 34SyntaxToken GenerateUniqueName(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, string baseName, 38SemanticModel semanticModel, SyntaxNode location, 42SemanticModel semanticModel, SyntaxNode location, 47CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination); 49IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
18protected readonly SemanticModel SemanticModel; 26protected AbstractTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (8)
13protected abstract AbstractTypeInferrer CreateTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken); 16SemanticModel semanticModel, ImmutableArray<ITypeSymbol> result, string? nameOpt) 27SemanticModel semanticModel, ImmutableArray<TypeInferenceInfo> result, string? nameOpt) 42SemanticModel semanticModel, string name) 80SemanticModel semanticModel, int position, 91SemanticModel semanticModel, SyntaxNode expression, 102SemanticModel semanticModel, int position, 110SemanticModel semanticModel, SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\ITypeInferenceService.cs (4)
27ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken); 28ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 30ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 31ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (4)
34protected abstract SemanticModel? TryGetSpeculativeSemanticModelWorker(SemanticModel previousSemanticModel, SyntaxNode previousBodyNode, SyntaxNode currentBodyNode); 49public async Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseLanguageService.cs (2)
36Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseWorkspaceService.cs (1)
21ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (10)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 20public readonly SemanticModel PreviousNonSpeculativeSemanticModel = previousNonSpeculativeSemanticModel; 23/// The current semantic model we retrieved <see cref="SemanticModel"/> for the <see cref="BodyNode"/>. Could 26public readonly SemanticModel CurrentSemanticModel = currentSemanticModel; 34/// The top level version of the project when we retrieved <see cref="SemanticModel"/>. As long as this is the 94public async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 131var semanticModel = info.CurrentSemanticModel; 157var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 202var semanticModel = await reuseService.TryGetSpeculativeSemanticModelAsync(reuseInfo.PreviousNonSpeculativeSemanticModel, bodyNode, cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractReducer.IExpressionRewriter.cs (1)
16SyntaxNodeOrToken VisitNodeOrToken(SyntaxNodeOrToken nodeOrTokenToReduce, SemanticModel semanticModel, bool simplifyAllDescendants);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (9)
41protected abstract SemanticModel GetSpeculativeSemanticModel(ref SyntaxNode nodeToSpeculate, SemanticModel originalSemanticModel, SyntaxNode originalNode); 51public abstract SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken); 52public abstract SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken); 69var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 165var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 191var semanticModelForReduce = semanticModel; 291var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
18SemanticModel semanticModel, 26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (2)
63public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 99public static bool IsNamespaceOrTypeOrThisParameter(SyntaxNode expression, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (2)
24SemanticModel semanticModel, TMemberAccessExpressionSyntax memberAccessExpression, CancellationToken cancellationToken); 34SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractSimplifier.cs (1)
18SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (2)
25SemanticModel semanticModel, 53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 16public readonly SemanticModel SemanticModel = semanticModel; 22var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.AnalyzerUtilities (106)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (4)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 34internal SemanticModel GetSemanticModel(SyntaxNode node)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (3)
74var model = context.GetSemanticModel(declSyntax); 182SemanticModel model = context.GetSemanticModel(declSyntax); 243var model = context.GetSemanticModel(node);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
458var semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
57var model = compilation.GetSemanticModel(receiverSyntax.SyntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
22/// <see cref="SemanticModel"/> is needed, use <see cref="SemanticSpanAnalysis"/> or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
23SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (7)
14public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 18SemanticModel semanticModel1, 19SemanticModel semanticModel2, 48SemanticModel semanticModel1, 49SemanticModel semanticModel2, 129SemanticModel semanticModel1, 130SemanticModel semanticModel2,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
33public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 36public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 39public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 42public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 45public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 54public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66public static TSymbol? GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 88public static INamedTypeSymbol? GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 91public static INamespaceSymbol? GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 94public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel) 108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 137public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 168private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 219this SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
66SemanticModel? semanticModel, 68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (3)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 23public ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken) 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
15ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken); 18SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (25)
51bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 58bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 59bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 72bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 77ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken); 79ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 80SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 82IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 84ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 92IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 93IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 100bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 107bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 109string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 120IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (3)
17SemanticModel semanticModel) 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
386bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
44var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
53var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
87TryGetSemanticModel(compilation, syntaxTree, out var semanticModel)) 116[NotNullWhen(true)] out SemanticModel? semanticModel) 185TryGetSemanticModel(reader.Compilation, firstSourceTree, out var semanticModel)) 255SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
50private SemanticModel? _lazySpeculativeSemanticModel; 75SemanticModel semanticModel, 96protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 102protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 103protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType); 104protected abstract bool ConversionsAreCompatible(SemanticModel model1, TExpressionSyntax expression1, SemanticModel model2, TExpressionSyntax expression2); 109protected abstract bool IsForEachTypeInferred(TForEachStatementSyntax forEachStatement, SemanticModel semanticModel); 110protected abstract bool ForEachConversionsAreCompatible(SemanticModel originalModel, TForEachStatementSyntax originalForEach, SemanticModel newModel, TForEachStatementSyntax newForEach); 112SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType, out ImmutableArray<ILocalSymbol> localVariables); 155public SemanticModel OriginalSemanticModel { get; } 190public SemanticModel SpeculativeSemanticModel 224protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 977SemanticModel speculativeSemanticModel) 1031private bool IsReceiverNonUniquePossibleValueTypeParam(TExpressionSyntax invocation, SemanticModel semanticModel) 1049private static bool IsReceiverUniqueInstance(TExpressionSyntax receiver, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
26SemanticModel semanticModel, 47public static void AddAliasSymbols(SemanticModel semanticModel, int namespaceId, IEnumerable<IAliasSymbol> aliasSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (4)
11/// <see cref="SemanticModel.SyntaxTree"/> that <see cref="OriginalSemanticModel"/> points at. 17/// cref="SemanticModel.SyntaxTree"/> that <see cref="SpeculativeSemanticModel"/> points at. 24SemanticModel OriginalSemanticModel { get; } 30SemanticModel SpeculativeSemanticModel { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
Microsoft.CodeAnalysis.BannedApiAnalyzers (271)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (4)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 34internal SemanticModel GetSemanticModel(SyntaxNode node)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (3)
74var model = context.GetSemanticModel(declSyntax); 182SemanticModel model = context.GetSemanticModel(declSyntax); 243var model = context.GetSemanticModel(node);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
458var semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
57var model = compilation.GetSemanticModel(receiverSyntax.SyntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
22/// <see cref="SemanticModel"/> is needed, use <see cref="SemanticSpanAnalysis"/> or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
23SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (7)
14public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 18SemanticModel semanticModel1, 19SemanticModel semanticModel2, 48SemanticModel semanticModel1, 49SemanticModel semanticModel2, 129SemanticModel semanticModel1, 130SemanticModel semanticModel2,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
33public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 36public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 39public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 42public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 45public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 54public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66public static TSymbol? GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 88public static INamedTypeSymbol? GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 91public static INamespaceSymbol? GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 94public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel) 108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 137public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 168private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 219this SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
66SemanticModel? semanticModel, 68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (3)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 23public ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken) 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
15ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken); 18SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (25)
51bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 58bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 59bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 72bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 77ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken); 79ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 80SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 82IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 84ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 92IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 93IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 100bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 107bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 109string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 120IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (3)
17SemanticModel semanticModel) 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
386bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
44var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
53var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
87TryGetSemanticModel(compilation, syntaxTree, out var semanticModel)) 116[NotNullWhen(true)] out SemanticModel? semanticModel) 185TryGetSemanticModel(reader.Compilation, firstSourceTree, out var semanticModel)) 255SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
50private SemanticModel? _lazySpeculativeSemanticModel; 75SemanticModel semanticModel, 96protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 102protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 103protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType); 104protected abstract bool ConversionsAreCompatible(SemanticModel model1, TExpressionSyntax expression1, SemanticModel model2, TExpressionSyntax expression2); 109protected abstract bool IsForEachTypeInferred(TForEachStatementSyntax forEachStatement, SemanticModel semanticModel); 110protected abstract bool ForEachConversionsAreCompatible(SemanticModel originalModel, TForEachStatementSyntax originalForEach, SemanticModel newModel, TForEachStatementSyntax newForEach); 112SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType, out ImmutableArray<ILocalSymbol> localVariables); 155public SemanticModel OriginalSemanticModel { get; } 190public SemanticModel SpeculativeSemanticModel 224protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 977SemanticModel speculativeSemanticModel) 1031private bool IsReceiverNonUniquePossibleValueTypeParam(TExpressionSyntax invocation, SemanticModel semanticModel) 1049private static bool IsReceiverUniqueInstance(TExpressionSyntax receiver, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
26SemanticModel semanticModel, 47public static void AddAliasSymbols(SemanticModel semanticModel, int namespaceId, IEnumerable<IAliasSymbol> aliasSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (4)
11/// <see cref="SemanticModel.SyntaxTree"/> that <see cref="OriginalSemanticModel"/> points at. 17/// cref="SemanticModel.SyntaxTree"/> that <see cref="SpeculativeSemanticModel"/> points at. 24SemanticModel OriginalSemanticModel { get; } 30SemanticModel SpeculativeSemanticModel { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
199public string ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null) 202public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (2)
65public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 68public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
73protected abstract INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model); 78SemanticModel model, 94SemanticModel model, 121var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 183var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 259private static bool IsInsideNamespace(SyntaxNode node, INamespaceSymbol symbol, SemanticModel model, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
12SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14SemanticModel semanticModel, 48public SemanticModel SemanticModel { get; } = semanticModel;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (6)
33public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 35if (document.TryGetSemanticModel(out var semanticModel)) 111public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 128public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 153public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 178var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeInferenceServiceExtensions.cs (11)
15public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 18public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 21public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 24public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 29SemanticModel semanticModel, 39SemanticModel semanticModel, 47private static INamedTypeSymbol? GetFirstDelegateType(SemanticModel semanticModel, ImmutableArray<ITypeSymbol> types) 55SemanticModel semanticModel, 67SemanticModel semanticModel, 85SemanticModel semanticModel, 97SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (13)
30Func<SemanticModel, TType, TNode, bool> canReplace, 31Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 53Func<SemanticModel, TType, TNode, bool> canReplace, 54Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 75Func<SemanticModel, TNode, bool> canReplace, 76Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 97Func<SemanticModel, TType, TNode, bool> canReplace, 98Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 119Func<SemanticModel, TNode, bool> canReplace, 120Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 155Func<SemanticModel, TType, TNode, bool> canReplace, 156Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 172var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (4)
338SemanticModel semanticModel, 389SemanticModel semanticModel, 451SemanticModel semanticModel, 461this SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, string identifierName)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
62SemanticModel semanticModel, 454SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (7)
37SemanticModel semanticModel, 47SemanticModel semanticModel, 58SemanticModel semanticModel, 140SemanticModel semanticModel, 232SemanticModel semanticModel, 258private static SyntaxNode GetNegationOfIsPatternExpression(SyntaxNode isExpression, SyntaxGenerator generator, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, CancellationToken cancellationToken) 471SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
38SemanticModel semanticModel, 119var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 208var semanticModel = compilation.GetSemanticModel(group.Key);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
82var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
27var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 34var currentModel = await current.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (31)
39SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 47SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 55SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 63SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 71SemanticModel semanticModel, 95protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, CancellationToken cancellationToken) 179public bool IsWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 182public bool IsOnlyWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 185public bool IsInOutContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 188public bool IsInRefContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 191public bool IsInInContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 194public bool CanReplaceWithRValue(SemanticModel semanticModel, SyntaxNode? expression, CancellationToken cancellationToken) 197public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 203public bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel) 206public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken) 209public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement) 212public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 215public IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 218public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 221public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 227public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 230public IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 233public IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 236public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 239public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 242public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 245public bool IsInsideNameOfExpression(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 251public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, INamedTypeSymbol? expressionTypeOpt, CancellationToken cancellationToken) 254public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 257public IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (17)
15bool IsExpressionContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 16bool IsStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 17bool IsTypeContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 18bool IsNamespaceContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 19bool IsNamespaceDeclarationNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 20bool IsTypeDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 21bool IsMemberDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 22bool IsGlobalStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 23bool IsLabelContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 24bool IsAttributeNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 27SemanticModel semanticModel, SyntaxNode location, 31SemanticModel semanticModel, SyntaxNode location, 34SyntaxToken GenerateUniqueName(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, string baseName, 38SemanticModel semanticModel, SyntaxNode location, 42SemanticModel semanticModel, SyntaxNode location, 47CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination); 49IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
18protected readonly SemanticModel SemanticModel; 26protected AbstractTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (8)
13protected abstract AbstractTypeInferrer CreateTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken); 16SemanticModel semanticModel, ImmutableArray<ITypeSymbol> result, string? nameOpt) 27SemanticModel semanticModel, ImmutableArray<TypeInferenceInfo> result, string? nameOpt) 42SemanticModel semanticModel, string name) 80SemanticModel semanticModel, int position, 91SemanticModel semanticModel, SyntaxNode expression, 102SemanticModel semanticModel, int position, 110SemanticModel semanticModel, SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\ITypeInferenceService.cs (4)
27ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken); 28ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 30ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 31ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (4)
34protected abstract SemanticModel? TryGetSpeculativeSemanticModelWorker(SemanticModel previousSemanticModel, SyntaxNode previousBodyNode, SyntaxNode currentBodyNode); 49public async Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseLanguageService.cs (2)
36Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseWorkspaceService.cs (1)
21ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (10)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 20public readonly SemanticModel PreviousNonSpeculativeSemanticModel = previousNonSpeculativeSemanticModel; 23/// The current semantic model we retrieved <see cref="SemanticModel"/> for the <see cref="BodyNode"/>. Could 26public readonly SemanticModel CurrentSemanticModel = currentSemanticModel; 34/// The top level version of the project when we retrieved <see cref="SemanticModel"/>. As long as this is the 94public async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 131var semanticModel = info.CurrentSemanticModel; 157var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 202var semanticModel = await reuseService.TryGetSpeculativeSemanticModelAsync(reuseInfo.PreviousNonSpeculativeSemanticModel, bodyNode, cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractReducer.IExpressionRewriter.cs (1)
16SyntaxNodeOrToken VisitNodeOrToken(SyntaxNodeOrToken nodeOrTokenToReduce, SemanticModel semanticModel, bool simplifyAllDescendants);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (9)
41protected abstract SemanticModel GetSpeculativeSemanticModel(ref SyntaxNode nodeToSpeculate, SemanticModel originalSemanticModel, SyntaxNode originalNode); 51public abstract SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken); 52public abstract SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken); 69var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 165var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 191var semanticModelForReduce = semanticModel; 291var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
18SemanticModel semanticModel, 26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (2)
63public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 99public static bool IsNamespaceOrTypeOrThisParameter(SyntaxNode expression, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (2)
24SemanticModel semanticModel, TMemberAccessExpressionSyntax memberAccessExpression, CancellationToken cancellationToken); 34SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractSimplifier.cs (1)
18SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (2)
25SemanticModel semanticModel, 53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 16public readonly SemanticModel SemanticModel = semanticModel; 22var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CodeStyle (163)
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (2)
40protected abstract (CommonConversion conversion, ITypeSymbol? collectionElementType) GetForEachInfo(SemanticModel semanticModel, TForEachStatementSyntax node); 52var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
93private bool IsFixSupported(SemanticModel semanticModel, TNamespaceSyntax namespaceDeclaration, CancellationToken cancellationToken) 170protected bool ContainsPartialTypeWithMultipleDeclarations(TNamespaceSyntax namespaceDeclaration, SemanticModel semanticModel)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (2)
32protected abstract bool IsUnnecessaryCast(SemanticModel model, TCastExpression node, CancellationToken cancellationToken); 56private Diagnostic? TryRemoveCastExpression(SemanticModel model, TCastExpression node, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
44TParenthesizedExpressionSyntax parenthesizedExpression, SemanticModel semanticModel, CancellationToken cancellationToken,
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (1)
73public void AnalyzeAssemblyOrModuleAttribute(SyntaxNode attributeSyntax, SemanticModel model, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (3)
85SemanticModel semanticModel, 392SemanticModel semanticModel, 734SemanticModel semanticModel,
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
44SemanticModel model,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
686SemanticModel? lazyModel = null;
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (2)
51protected abstract CommonConversion GetConversion(SemanticModel semanticModel, TExpressionSyntax node, CancellationToken cancellationToken); 72var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (2)
244private static bool IsType<T>(INamedTypeSymbol type, SemanticModel semanticModel) 247private static INamedTypeSymbol? FindType<T>(SemanticModel semanticModel)
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (3)
67SemanticModel model, SyntaxNode node, TSimplifierOptions options, 101public bool TrySimplify(SemanticModel model, SyntaxNode node, [NotNullWhen(true)] out Diagnostic? diagnostic, TSimplifierOptions options, AnalyzerOptions analyzerOptions, CancellationToken cancellationToken) 122internal static Diagnostic CreateDiagnostic(SemanticModel model, TSimplifierOptions options, AnalyzerOptions analyzerOptions, TextSpan issueSpan, string diagnosticId, bool inDeclaration)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (9)
88protected abstract TExpression? GetSetterExpression(SemanticModel semanticModel, IMethodSymbol setMethod, CancellationToken cancellationToken); 91SemanticModel semanticModel, IMethodSymbol accessor, HashSet<string> fieldNames, HashSet<IFieldSymbol> result, CancellationToken cancellationToken); 94HashSet<string> fieldNames, ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty, SemanticModel semanticModel, SyntaxNode codeBlock, CancellationToken cancellationToken); 224SemanticModel semanticModel, 256SemanticModel semanticModel, 275SemanticModel semanticModel, IMethodSymbol setMethod, HashSet<string> fieldNames, CancellationToken cancellationToken) 291SemanticModel semanticModel, 333var semanticModel = context.SemanticModel; 499SemanticModel semanticModel,
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
53var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (2)
43protected abstract bool IsTargetTyped(SemanticModel semanticModel, TConditionalExpressionSyntax conditional, System.Threading.CancellationToken cancellationToken); 102var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (2)
38protected abstract bool IsTargetTyped(SemanticModel semanticModel, TConditionalExpressionSyntax conditional, System.Threading.CancellationToken cancellationToken); 100var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs (4)
47protected SemanticModel SemanticModel => this.State.SemanticModel; 93SemanticModel semanticModel, 113SemanticModel semanticModel, 142SemanticModel semanticModel,
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
70SemanticModel semanticModel,
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (2)
80SemanticModel semanticModel, 129var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\IUpdateExpressionSyntaxHelper.cs (1)
15void GetPartsOfForeachStatement(SemanticModel semanticModel, TStatementSyntax statement, out SyntaxToken awaitKeyword, out SyntaxToken identifier, out TExpressionSyntax expression, out IEnumerable<TStatementSyntax> statements, out bool needsCast);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (3)
24SemanticModel semanticModel, 39public readonly SemanticModel SemanticModel = semanticModel; 363SemanticModel semanticModel, TStatementSyntax foreachStatement)
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
138var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (3)
41ISyntaxFacts syntaxFacts, SyntaxNode expr, SemanticModel semanticModel, CancellationToken cancellationToken) 47ISyntaxFacts syntaxFacts, SyntaxNode expr, SemanticModel semanticModel, 99SyntaxNode expr, SemanticModel semanticModel, bool isTopLevel, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
55var semanticModel = ifOperation.SemanticModel;
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (2)
60var semanticModel = context.SemanticModel; 148private static ITypeParameterSymbol? GetGenericParameterSymbol(ISyntaxFacts syntaxFacts, SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (6)
114SemanticModel semanticModel, 154SemanticModel semanticModel, 255SemanticModel semanticModel, 310SemanticModel semanticModel, 388SemanticModel semanticModel, 413ISyntaxFacts syntaxFacts, SemanticModel semanticModel, TExpressionSyntax node, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
58SemanticModel semanticModel,
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
95var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (1)
50SemanticModel semanticModel,
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (3)
79var semanticModel = context.Operation.SemanticModel; 138private static bool ValueIsAccessed(SemanticModel semanticModel, IConditionalOperation ifOperation, IBlockOperation containingBlock, ISymbol localOrParameter, IExpressionStatementOperation expressionStatement, IAssignmentOperation assignmentExpression) 269SemanticModel semanticModel, IThrowOperation throwOperation,
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
181SemanticModel semanticModel, 191SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
22/// <see cref="SemanticModel"/> is needed, use <see cref="SemanticSpanAnalysis"/> or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
23SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (7)
14public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 18SemanticModel semanticModel1, 19SemanticModel semanticModel2, 48SemanticModel semanticModel1, 49SemanticModel semanticModel2, 129SemanticModel semanticModel1, 130SemanticModel semanticModel2,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
33public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 36public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 39public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 42public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 45public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 54public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66public static TSymbol? GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 88public static INamedTypeSymbol? GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 91public static INamespaceSymbol? GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 94public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel) 108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 137public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 168private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 219this SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
66SemanticModel? semanticModel, 68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (3)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 23public ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken) 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
15ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken); 18SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (25)
51bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 58bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 59bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 72bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 77ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken); 79ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 80SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 82IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 84ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 92IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 93IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 100bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 107bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 109string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 120IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (3)
17SemanticModel semanticModel) 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
386bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
44var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
53var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
87TryGetSemanticModel(compilation, syntaxTree, out var semanticModel)) 116[NotNullWhen(true)] out SemanticModel? semanticModel) 185TryGetSemanticModel(reader.Compilation, firstSourceTree, out var semanticModel)) 255SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
50private SemanticModel? _lazySpeculativeSemanticModel; 75SemanticModel semanticModel, 96protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 102protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 103protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType); 104protected abstract bool ConversionsAreCompatible(SemanticModel model1, TExpressionSyntax expression1, SemanticModel model2, TExpressionSyntax expression2); 109protected abstract bool IsForEachTypeInferred(TForEachStatementSyntax forEachStatement, SemanticModel semanticModel); 110protected abstract bool ForEachConversionsAreCompatible(SemanticModel originalModel, TForEachStatementSyntax originalForEach, SemanticModel newModel, TForEachStatementSyntax newForEach); 112SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType, out ImmutableArray<ILocalSymbol> localVariables); 155public SemanticModel OriginalSemanticModel { get; } 190public SemanticModel SpeculativeSemanticModel 224protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 977SemanticModel speculativeSemanticModel) 1031private bool IsReceiverNonUniquePossibleValueTypeParam(TExpressionSyntax invocation, SemanticModel semanticModel) 1049private static bool IsReceiverUniqueInstance(TExpressionSyntax receiver, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
26SemanticModel semanticModel, 47public static void AddAliasSymbols(SemanticModel semanticModel, int namespaceId, IEnumerable<IAliasSymbol> aliasSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (4)
11/// <see cref="SemanticModel.SyntaxTree"/> that <see cref="OriginalSemanticModel"/> points at. 17/// cref="SemanticModel.SyntaxTree"/> that <see cref="SpeculativeSemanticModel"/> points at. 24SemanticModel OriginalSemanticModel { get; } 30SemanticModel SpeculativeSemanticModel { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
Microsoft.CodeAnalysis.CodeStyle.Fixes (286)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (2)
90var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 100Document document, SemanticModel semanticModel, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (7)
48Document document, SemanticModel semanticModel, SyntaxNode root, 60Document document, SemanticModel semanticModel, SyntaxNode root, 72var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 116SemanticModel semanticModel, 159protected virtual (SyntaxNode finalTarget, SyntaxNode finalReplacement) Cast(SemanticModel semanticModel, TExpressionSyntax targetNode, ITypeSymbol conversionType) 162private static string GetSubItemName(SemanticModel semanticModel, int position, ITypeSymbol conversionType) 171SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (4)
27protected abstract SymbolInfo GetSpeculativeSymbolInfo(SemanticModel semanticModel, TArgumentListSyntax newArgumentList); 40SemanticModel semanticModel, 110SemanticModel semanticModel, 204private bool IsInvocationExpressionWithNewArgumentsApplicable(SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\AddExplicitCast\InheritanceDistanceComparer.cs (2)
33internal sealed class InheritanceDistanceComparer<TExpressionSyntax>(SemanticModel semanticModel) 37private readonly SemanticModel _semanticModel = semanticModel;
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (9)
47protected abstract ITypeSymbol GetArgumentType(SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken); 57SemanticModel semanticModel, 71var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 126SemanticModel semanticModel, 147SemanticModel semanticModel, 195SemanticModel semanticModel, 405var semanticModel = await invocationDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 423var semanticModel = await invocationDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 433SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
41var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (3)
18protected abstract Task<string> GetDescriptionAsync(Diagnostic diagnostic, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken); 19protected abstract Task<(SyntaxTree syntaxTree, SyntaxNode root)?> GetRootInOtherSyntaxTreeAsync(SyntaxNode node, SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken); 54var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ConvertTypeOfToNameOf\AbstractConvertTypeOfToNameOfCodeFixProvider.cs (3)
22protected abstract SyntaxNode GetSymbolTypeExpression(SemanticModel model, TMemberAccessExpressionSyntax node, CancellationToken cancellationToken); 38var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 52SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (3)
22protected abstract ITypeSymbol GetForEachElementType(SemanticModel semanticModel, TForEachStatementSyntax forEachStatement); 45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 56SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (5)
39protected abstract ITypeSymbol GetArgumentType(SemanticModel semanticModel, Argument<TExpressionSyntax> argument, CancellationToken cancellationToken); 40protected abstract string GenerateNameForExpression(SemanticModel semanticModel, TExpressionSyntax expression, CancellationToken cancellationToken); 44protected abstract IMethodSymbol? GetCurrentConstructor(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 45protected abstract IMethodSymbol? GetDelegatedConstructor(SemanticModel semanticModel, IMethodSymbol constructor, CancellationToken cancellationToken); 157protected string GenerateNameForArgument(SemanticModel semanticModel, Argument<TExpressionSyntax> argument, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (4)
279var semanticModel = _document.SemanticModel; 285private static ITypeSymbol FixType(ITypeSymbol typeSymbol, SemanticModel semanticModel, IEnumerable<ITypeParameterSymbol> allTypeParameters) 464var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 482var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (2)
41var semanticModel = document.SemanticModel; 82SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.State.cs (1)
91var semanticModel = semanticDocument.SemanticModel;
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (2)
91var semanticModel = semanticDocument.SemanticModel; 172SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.cs (1)
21public abstract ImmutableArray<IParameterSymbol> TryMakeParameters(SemanticModel semanticModel, SyntaxNode target, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.State.cs (1)
58var semanticModel = document.SemanticModel;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.cs (1)
26protected abstract ITypeSymbol? DetermineReturnTypeForSimpleNameOrMemberAccessExpression(ITypeInferenceService typeInferenceService, SemanticModel semanticModel, TExpressionSyntax expression, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (2)
102var semanticModel = document.SemanticModel; 151var semanticModel = semanticDocument.SemanticModel;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (2)
25protected abstract bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel); 26protected abstract bool AreSpecialOptionsActive(SemanticModel semanticModel);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
30protected abstract bool TryConvertToLocalDeclaration(ITypeSymbol type, SyntaxToken identifierToken, SemanticModel semanticModel, CancellationToken cancellationToken, out SyntaxNode newRoot);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
46var semanticModel = await _document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (3)
206var semanticModel = _document.SemanticModel; 262var semanticModel = _document.SemanticModel; 391private static IMethodSymbol FindContainingMethodSymbol(int position, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
43var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.cs (3)
37protected abstract bool TryInitializeState(Document document, SemanticModel model, SyntaxNode interfaceNode, CancellationToken cancellationToken, 63var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 80var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.State.cs (3)
19SemanticModel model) 31public SemanticModel Model { get; } = model; 45SemanticModel model,
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
75var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (4)
50var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 91private static IMethodSymbol? GetMethodSymbol(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 119var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 180var semanticModel = await newDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (3)
57var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 88var semanticModel = await newDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 126var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
28var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
73var model = await document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (3)
45Document document, SyntaxEditor editor, SemanticModel semanticModel, 143var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 153SyntaxEditor editor, SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
24Document document, SyntaxEditor editor, SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
31Document document, SyntaxEditor editor, SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (4)
40var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 58var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 93private static IMethodSymbol? GetMethodSymbol(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 155private static ControlFlowAnalysis? GetControlFlowAnalysis(SyntaxGenerator generator, SemanticModel semanticModel, SyntaxNode node)
src\Analyzers\Core\CodeFixes\RemoveRedundantEquality\RemoveRedundantEqualityCodeFixProvider.cs (1)
41var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs (1)
24TParenthesizedExpressionSyntax current, SemanticModel semanticModel, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
48var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (8)
121protected virtual SyntaxNode? TryUpdateParentOfUpdatedNode(SyntaxNode parent, SyntaxNode newNameNode, SyntaxEditor editor, ISyntaxFacts syntaxFacts, SemanticModel semanticModel) => null; 301var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 348SemanticModel semanticModel, 385SemanticModel semanticModel, 444SemanticModel semanticModel, 918var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 930SemanticModel semanticModel, 935private readonly SemanticModel _semanticModel = semanticModel;
src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (1)
59SyntaxNode SimplifyConditional(SemanticModel semanticModel, Diagnostic diagnostic, SyntaxNode expr)
src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (1)
50var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
35var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (5)
301var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 374var fieldSemanticModel = await fieldDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 379var propertySemanticModel = await propertyDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 480AsyncLazy<SemanticModel> lazySemanticModel, 526var semanticModel = await lazySemanticModel.GetValueAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (2)
28SemanticModel semanticModel, SyntaxNode expressionToCoalesce, 36var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (1)
40var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (2)
41var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 57SyntaxEditor editor, SemanticModel semanticModel, INamedTypeSymbol? expressionTypeOpt,
src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (1)
75var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (1)
92var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
67var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
54var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (4)
106var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 164var semanticModel = await document.GetRequiredSemanticModelAsync(CancellationToken.None).ConfigureAwait(false); 296SemanticModel semanticModel, TIfStatementSyntax ifStatement, CancellationToken cancellationToken) 308SemanticModel semanticModel, TConditionalExpressionSyntax conditionalExpression, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
71var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (1)
46var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
199public string ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null) 202public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (2)
65public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 68public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
73protected abstract INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model); 78SemanticModel model, 94SemanticModel model, 121var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 183var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 259private static bool IsInsideNamespace(SyntaxNode node, INamespaceSymbol symbol, SemanticModel model, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
12SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14SemanticModel semanticModel, 48public SemanticModel SemanticModel { get; } = semanticModel;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (6)
33public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 35if (document.TryGetSemanticModel(out var semanticModel)) 111public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 128public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 153public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 178var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeInferenceServiceExtensions.cs (11)
15public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 18public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 21public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 24public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 29SemanticModel semanticModel, 39SemanticModel semanticModel, 47private static INamedTypeSymbol? GetFirstDelegateType(SemanticModel semanticModel, ImmutableArray<ITypeSymbol> types) 55SemanticModel semanticModel, 67SemanticModel semanticModel, 85SemanticModel semanticModel, 97SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (13)
30Func<SemanticModel, TType, TNode, bool> canReplace, 31Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 53Func<SemanticModel, TType, TNode, bool> canReplace, 54Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 75Func<SemanticModel, TNode, bool> canReplace, 76Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 97Func<SemanticModel, TType, TNode, bool> canReplace, 98Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 119Func<SemanticModel, TNode, bool> canReplace, 120Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 155Func<SemanticModel, TType, TNode, bool> canReplace, 156Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 172var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (4)
338SemanticModel semanticModel, 389SemanticModel semanticModel, 451SemanticModel semanticModel, 461this SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, string identifierName)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
62SemanticModel semanticModel, 454SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (7)
37SemanticModel semanticModel, 47SemanticModel semanticModel, 58SemanticModel semanticModel, 140SemanticModel semanticModel, 232SemanticModel semanticModel, 258private static SyntaxNode GetNegationOfIsPatternExpression(SyntaxNode isExpression, SyntaxGenerator generator, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, CancellationToken cancellationToken) 471SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
38SemanticModel semanticModel, 119var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 208var semanticModel = compilation.GetSemanticModel(group.Key);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
82var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
27var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 34var currentModel = await current.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (31)
39SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 47SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 55SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 63SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 71SemanticModel semanticModel, 95protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, CancellationToken cancellationToken) 179public bool IsWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 182public bool IsOnlyWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 185public bool IsInOutContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 188public bool IsInRefContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 191public bool IsInInContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 194public bool CanReplaceWithRValue(SemanticModel semanticModel, SyntaxNode? expression, CancellationToken cancellationToken) 197public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 203public bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel) 206public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken) 209public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement) 212public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 215public IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 218public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 221public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 227public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 230public IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 233public IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 236public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 239public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 242public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 245public bool IsInsideNameOfExpression(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 251public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, INamedTypeSymbol? expressionTypeOpt, CancellationToken cancellationToken) 254public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 257public IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (17)
15bool IsExpressionContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 16bool IsStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 17bool IsTypeContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 18bool IsNamespaceContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 19bool IsNamespaceDeclarationNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 20bool IsTypeDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 21bool IsMemberDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 22bool IsGlobalStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 23bool IsLabelContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 24bool IsAttributeNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 27SemanticModel semanticModel, SyntaxNode location, 31SemanticModel semanticModel, SyntaxNode location, 34SyntaxToken GenerateUniqueName(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, string baseName, 38SemanticModel semanticModel, SyntaxNode location, 42SemanticModel semanticModel, SyntaxNode location, 47CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination); 49IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
18protected readonly SemanticModel SemanticModel; 26protected AbstractTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (8)
13protected abstract AbstractTypeInferrer CreateTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken); 16SemanticModel semanticModel, ImmutableArray<ITypeSymbol> result, string? nameOpt) 27SemanticModel semanticModel, ImmutableArray<TypeInferenceInfo> result, string? nameOpt) 42SemanticModel semanticModel, string name) 80SemanticModel semanticModel, int position, 91SemanticModel semanticModel, SyntaxNode expression, 102SemanticModel semanticModel, int position, 110SemanticModel semanticModel, SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\ITypeInferenceService.cs (4)
27ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken); 28ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 30ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 31ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (4)
34protected abstract SemanticModel? TryGetSpeculativeSemanticModelWorker(SemanticModel previousSemanticModel, SyntaxNode previousBodyNode, SyntaxNode currentBodyNode); 49public async Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseLanguageService.cs (2)
36Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseWorkspaceService.cs (1)
21ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (10)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 20public readonly SemanticModel PreviousNonSpeculativeSemanticModel = previousNonSpeculativeSemanticModel; 23/// The current semantic model we retrieved <see cref="SemanticModel"/> for the <see cref="BodyNode"/>. Could 26public readonly SemanticModel CurrentSemanticModel = currentSemanticModel; 34/// The top level version of the project when we retrieved <see cref="SemanticModel"/>. As long as this is the 94public async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 131var semanticModel = info.CurrentSemanticModel; 157var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 202var semanticModel = await reuseService.TryGetSpeculativeSemanticModelAsync(reuseInfo.PreviousNonSpeculativeSemanticModel, bodyNode, cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractReducer.IExpressionRewriter.cs (1)
16SyntaxNodeOrToken VisitNodeOrToken(SyntaxNodeOrToken nodeOrTokenToReduce, SemanticModel semanticModel, bool simplifyAllDescendants);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (9)
41protected abstract SemanticModel GetSpeculativeSemanticModel(ref SyntaxNode nodeToSpeculate, SemanticModel originalSemanticModel, SyntaxNode originalNode); 51public abstract SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken); 52public abstract SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken); 69var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 165var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 191var semanticModelForReduce = semanticModel; 291var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
18SemanticModel semanticModel, 26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (2)
63public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 99public static bool IsNamespaceOrTypeOrThisParameter(SyntaxNode expression, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (2)
24SemanticModel semanticModel, TMemberAccessExpressionSyntax memberAccessExpression, CancellationToken cancellationToken); 34SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractSimplifier.cs (1)
18SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (2)
25SemanticModel semanticModel, 53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 16public readonly SemanticModel SemanticModel = semanticModel; 22var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp (160)
Compilation\CSharpCompilation.cs (6)
864var model = GetSemanticModel(tree); 2587public new SemanticModel GetSemanticModel(SyntaxTree syntaxTree, bool ignoreAccessibility) 2596public new SemanticModel GetSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options) 2608SemanticModel? model = null; 2619internal override SemanticModel CreateSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options) 4063protected override SemanticModel CommonGetSemanticModel(SyntaxTree syntaxTree, SemanticModelOptions options)
Compilation\CSharpSemanticModel.cs (21)
2508/// <exception cref="InvalidOperationException">Throws this exception if this model is a speculative semantic model, i.e. <see cref="SemanticModel.IsSpeculativeSemanticModel"/> is true. 2510public bool TryGetSpeculativeSemanticModelForMethodBody(int position, BaseMethodDeclarationSyntax method, out SemanticModel speculativeModel) 2535/// <exception cref="InvalidOperationException">Throws this exception if this model is a speculative semantic model, i.e. <see cref="SemanticModel.IsSpeculativeSemanticModel"/> is true. 2537public bool TryGetSpeculativeSemanticModelForMethodBody(int position, AccessorDeclarationSyntax accessor, out SemanticModel speculativeModel) 2564/// <exception cref="InvalidOperationException">Throws this exception if this model is a speculative semantic model, i.e. <see cref="SemanticModel.IsSpeculativeSemanticModel"/> is true. 2566public bool TryGetSpeculativeSemanticModel(int position, TypeSyntax type, out SemanticModel speculativeModel, SpeculativeBindingOption bindingOption = SpeculativeBindingOption.BindAsExpression) 2590/// <exception cref="InvalidOperationException">Throws this exception if this model is a speculative semantic model, i.e. <see cref="SemanticModel.IsSpeculativeSemanticModel"/> is true. 2592public bool TryGetSpeculativeSemanticModel(int position, StatementSyntax statement, out SemanticModel speculativeModel) 2617/// <exception cref="InvalidOperationException">Throws this exception if this model is a speculative semantic model, i.e. <see cref="SemanticModel.IsSpeculativeSemanticModel"/> is true. 2619public bool TryGetSpeculativeSemanticModel(int position, EqualsValueClauseSyntax initializer, out SemanticModel speculativeModel) 2644/// <exception cref="InvalidOperationException">Throws this exception if this model is a speculative semantic model, i.e. <see cref="SemanticModel.IsSpeculativeSemanticModel"/> is true. 2646public bool TryGetSpeculativeSemanticModel(int position, ArrowExpressionClauseSyntax expressionBody, out SemanticModel speculativeModel) 2674/// <exception cref="InvalidOperationException">Throws this exception if this model is a speculative semantic model, i.e. <see cref="SemanticModel.IsSpeculativeSemanticModel"/> is true. 2676public bool TryGetSpeculativeSemanticModel(int position, ConstructorInitializerSyntax constructorInitializer, out SemanticModel speculativeModel) 2703/// <exception cref="InvalidOperationException">Throws this exception if this model is a speculative semantic model, i.e. <see cref="SemanticModel.IsSpeculativeSemanticModel"/> is true. 2705public bool TryGetSpeculativeSemanticModel(int position, PrimaryConstructorBaseTypeSyntax constructorInitializer, out SemanticModel speculativeModel) 2733/// <exception cref="InvalidOperationException">Throws this exception if this model is a speculative semantic model, i.e. <see cref="SemanticModel.IsSpeculativeSemanticModel"/> is true. 2735public bool TryGetSpeculativeSemanticModel(int position, CrefSyntax crefSyntax, out SemanticModel speculativeModel) 2759/// <exception cref="InvalidOperationException">Throws this exception if this model is a speculative semantic model, i.e. <see cref="SemanticModel.IsSpeculativeSemanticModel"/> is true. 2761public bool TryGetSpeculativeSemanticModel(int position, AttributeSyntax attribute, out SemanticModel speculativeModel) 4943protected sealed override SemanticModel ParentModelCore
Compilation\MemberSemanticModel.cs (1)
138internal sealed override SemanticModel ContainingPublicModelOrSelf
Compilation\PublicSemanticModel.cs (2)
11/// Instances of this <see cref="SemanticModel"/> can be exposed to external consumers. 51internal sealed override SemanticModel ContainingPublicModelOrSelf => this;
CSharpExtensions.cs (98)
456public static SymbolInfo GetSymbolInfo(this SemanticModel? semanticModel, OrderingSyntax node, CancellationToken cancellationToken = default(CancellationToken)) 472public static SymbolInfo GetSymbolInfo(this SemanticModel? semanticModel, SelectOrGroupClauseSyntax node, CancellationToken cancellationToken = default(CancellationToken)) 496public static SymbolInfo GetSymbolInfo(this SemanticModel? semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken = default(CancellationToken)) 513public static SymbolInfo GetCollectionInitializerSymbolInfo(this SemanticModel? semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken = default(CancellationToken)) 529public static SymbolInfo GetSymbolInfo(this SemanticModel? semanticModel, ConstructorInitializerSyntax constructorInitializer, CancellationToken cancellationToken = default(CancellationToken)) 545public static SymbolInfo GetSymbolInfo(this SemanticModel? semanticModel, PrimaryConstructorBaseTypeSyntax constructorInitializer, CancellationToken cancellationToken = default(CancellationToken)) 561public static SymbolInfo GetSymbolInfo(this SemanticModel? semanticModel, AttributeSyntax attributeSyntax, CancellationToken cancellationToken = default(CancellationToken)) 577public static SymbolInfo GetSymbolInfo(this SemanticModel? semanticModel, CrefSyntax crefSyntax, CancellationToken cancellationToken = default(CancellationToken)) 595public static SymbolInfo GetSpeculativeSymbolInfo(this SemanticModel? semanticModel, int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption) 613public static SymbolInfo GetSpeculativeSymbolInfo(this SemanticModel? semanticModel, int position, CrefSyntax expression, SpeculativeBindingOption bindingOption) 631public static SymbolInfo GetSpeculativeSymbolInfo(this SemanticModel? semanticModel, int position, AttributeSyntax attribute) 651public static SymbolInfo GetSpeculativeSymbolInfo(this SemanticModel? semanticModel, int position, ConstructorInitializerSyntax constructorInitializer) 672public static SymbolInfo GetSpeculativeSymbolInfo(this SemanticModel? semanticModel, int position, PrimaryConstructorBaseTypeSyntax constructorInitializer) 688public static TypeInfo GetTypeInfo(this SemanticModel? semanticModel, ConstructorInitializerSyntax constructorInitializer, CancellationToken cancellationToken = default(CancellationToken)) 701public static TypeInfo GetTypeInfo(this SemanticModel? semanticModel, SelectOrGroupClauseSyntax node, CancellationToken cancellationToken = default(CancellationToken)) 717public static TypeInfo GetTypeInfo(this SemanticModel? semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken = default(CancellationToken)) 733public static TypeInfo GetTypeInfo(this SemanticModel? semanticModel, AttributeSyntax attributeSyntax, CancellationToken cancellationToken = default(CancellationToken)) 751public static TypeInfo GetSpeculativeTypeInfo(this SemanticModel? semanticModel, int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption) 764public static Conversion GetConversion(this SemanticModel? semanticModel, SyntaxNode expression, CancellationToken cancellationToken = default(CancellationToken)) 878public static Conversion GetSpeculativeConversion(this SemanticModel? semanticModel, int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption) 891public static ForEachStatementInfo GetForEachStatementInfo(this SemanticModel? semanticModel, ForEachStatementSyntax forEachStatement) 904public static ForEachStatementInfo GetForEachStatementInfo(this SemanticModel? semanticModel, CommonForEachStatementSyntax forEachStatement) 917public static DeconstructionInfo GetDeconstructionInfo(this SemanticModel? semanticModel, AssignmentExpressionSyntax assignment) 922public static DeconstructionInfo GetDeconstructionInfo(this SemanticModel? semanticModel, ForEachVariableStatementSyntax @foreach) 927public static AwaitExpressionInfo GetAwaitExpressionInfo(this SemanticModel? semanticModel, AwaitExpressionSyntax awaitExpression) 940public static AwaitExpressionInfo GetAwaitExpressionInfo(this SemanticModel? semanticModel, LocalDeclarationStatementSyntax awaitUsingDeclaration) 952public static AwaitExpressionInfo GetAwaitExpressionInfo(this SemanticModel? semanticModel, UsingStatementSyntax awaitUsingStatement) 964public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel? semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken = default(CancellationToken)) 977public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel? semanticModel, AttributeSyntax attribute, CancellationToken cancellationToken = default(CancellationToken)) 990public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel? semanticModel, ConstructorInitializerSyntax initializer, CancellationToken cancellationToken = default(CancellationToken)) 1006public static ImmutableArray<IPropertySymbol> GetIndexerGroup(this SemanticModel? semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken = default(CancellationToken)) 1019public static Optional<object> GetConstantValue(this SemanticModel? semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken = default(CancellationToken)) 1035public static QueryClauseInfo GetQueryClauseInfo(this SemanticModel? semanticModel, QueryClauseSyntax node, CancellationToken cancellationToken = default(CancellationToken)) 1052public static IAliasSymbol? GetAliasInfo(this SemanticModel? semanticModel, IdentifierNameSyntax nameSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1062public static IAliasSymbol? GetSpeculativeAliasInfo(this SemanticModel? semanticModel, int position, IdentifierNameSyntax nameSyntax, SpeculativeBindingOption bindingOption) 1071public static ControlFlowAnalysis? AnalyzeControlFlow(this SemanticModel? semanticModel, StatementSyntax firstStatement, StatementSyntax lastStatement) 1080public static ControlFlowAnalysis? AnalyzeControlFlow(this SemanticModel? semanticModel, StatementSyntax statement) 1089public static DataFlowAnalysis? AnalyzeDataFlow(this SemanticModel? semanticModel, ConstructorInitializerSyntax constructorInitializer) 1098public static DataFlowAnalysis? AnalyzeDataFlow(this SemanticModel? semanticModel, PrimaryConstructorBaseTypeSyntax primaryConstructorBaseType) 1107public static DataFlowAnalysis? AnalyzeDataFlow(this SemanticModel? semanticModel, ExpressionSyntax expression) 1116public static DataFlowAnalysis? AnalyzeDataFlow(this SemanticModel? semanticModel, StatementSyntax firstStatement, StatementSyntax lastStatement) 1125public static DataFlowAnalysis? AnalyzeDataFlow(this SemanticModel? semanticModel, StatementSyntax statement) 1136public static bool TryGetSpeculativeSemanticModelForMethodBody([NotNullWhen(true)] this SemanticModel? semanticModel, int position, BaseMethodDeclarationSyntax method, [NotNullWhen(true)] out SemanticModel? speculativeModel) 1155public static bool TryGetSpeculativeSemanticModelForMethodBody([NotNullWhen(true)] this SemanticModel? semanticModel, int position, AccessorDeclarationSyntax accessor, [NotNullWhen(true)] out SemanticModel? speculativeModel) 1174public static bool TryGetSpeculativeSemanticModel([NotNullWhen(true)] this SemanticModel? semanticModel, int position, TypeSyntax type, [NotNullWhen(true)] out SemanticModel? speculativeModel, SpeculativeBindingOption bindingOption = SpeculativeBindingOption.BindAsExpression) 1193public static bool TryGetSpeculativeSemanticModel([NotNullWhen(true)] this SemanticModel? semanticModel, int position, CrefSyntax crefSyntax, [NotNullWhen(true)] out SemanticModel? speculativeModel) 1212public static bool TryGetSpeculativeSemanticModel([NotNullWhen(true)] this SemanticModel? semanticModel, int position, StatementSyntax statement, [NotNullWhen(true)] out SemanticModel? speculativeModel) 1231public static bool TryGetSpeculativeSemanticModel([NotNullWhen(true)] this SemanticModel? semanticModel, int position, EqualsValueClauseSyntax initializer, [NotNullWhen(true)] out SemanticModel? speculativeModel) 1250public static bool TryGetSpeculativeSemanticModel([NotNullWhen(true)] this SemanticModel? semanticModel, int position, ArrowExpressionClauseSyntax expressionBody, [NotNullWhen(true)] out SemanticModel? speculativeModel) 1271public static bool TryGetSpeculativeSemanticModel([NotNullWhen(true)] this SemanticModel? semanticModel, int position, ConstructorInitializerSyntax constructorInitializer, [NotNullWhen(true)] out SemanticModel? speculativeModel) 1292public static bool TryGetSpeculativeSemanticModel([NotNullWhen(true)] this SemanticModel? semanticModel, int position, PrimaryConstructorBaseTypeSyntax constructorInitializer, [NotNullWhen(true)] out SemanticModel? speculativeModel) 1311public static bool TryGetSpeculativeSemanticModel([NotNullWhen(true)] this SemanticModel? semanticModel, int position, AttributeSyntax attribute, [NotNullWhen(true)] out SemanticModel? speculativeModel) 1330public static Conversion ClassifyConversion(this SemanticModel? semanticModel, ExpressionSyntax expression, ITypeSymbol destination, bool isExplicitInSource = false) 1350public static Conversion ClassifyConversion(this SemanticModel? semanticModel, int position, ExpressionSyntax expression, ITypeSymbol destination, bool isExplicitInSource = false) 1366public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1375public static IMethodSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, CompilationUnitSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1385public static INamespaceSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, NamespaceDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1396public static INamespaceSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, FileScopedNamespaceDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1406public static INamedTypeSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, BaseTypeDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1415public static INamedTypeSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, DelegateDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1424public static IFieldSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, EnumMemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1433public static IMethodSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, BaseMethodDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1442public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1451public static IPropertySymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, PropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1460public static IPropertySymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, IndexerDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1469public static IEventSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, EventDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1478public static IPropertySymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, AnonymousObjectMemberDeclaratorSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1487public static INamedTypeSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, AnonymousObjectCreationExpressionSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1496public static INamedTypeSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, TupleExpressionSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1505public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, ArgumentSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1514public static IMethodSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, AccessorDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1523public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, SingleVariableDesignationSyntax designationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1532public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1541public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, TupleElementSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1550public static ILabelSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, LabeledStatementSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1559public static ILabelSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, SwitchLabelSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1568public static IAliasSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, UsingDirectiveSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1577public static IAliasSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, ExternAliasDirectiveSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1586public static IParameterSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, ParameterSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1595public static ITypeParameterSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, TypeParameterSyntax typeParameter, CancellationToken cancellationToken = default(CancellationToken)) 1605public static ILocalSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, ForEachStatementSyntax forEachStatement, CancellationToken cancellationToken = default(CancellationToken)) 1616public static ILocalSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, CatchDeclarationSyntax catchDeclaration, CancellationToken cancellationToken = default(CancellationToken)) 1623public static IRangeVariableSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, QueryClauseSyntax queryClause, CancellationToken cancellationToken = default(CancellationToken)) 1632public static IRangeVariableSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, JoinIntoClauseSyntax node, CancellationToken cancellationToken = default(CancellationToken)) 1641public static IRangeVariableSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, QueryContinuationSyntax node, CancellationToken cancellationToken = default(CancellationToken)) 1651public static IMethodSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, LocalFunctionStatementSyntax node, CancellationToken cancellationToken = default(CancellationToken)) 1661public static IMethodSymbol? GetInterceptorMethod(this SemanticModel? semanticModel, InvocationExpressionSyntax node, CancellationToken cancellationToken = default) 1673public static InterceptableLocation? GetInterceptableLocation(this SemanticModel? semanticModel, InvocationExpressionSyntax node, CancellationToken cancellationToken = default)
Errors\ErrorFacts.cs (1)
583/// <see cref="SemanticModel.GetDiagnostics(Text.TextSpan?, System.Threading.CancellationToken)"/> API.
Operations\CSharpOperationFactory.cs (2)
20private readonly SemanticModel _semanticModel; 22public CSharpOperationFactory(SemanticModel semanticModel)
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (4)
20SemanticModel model, 32SemanticModel model, 54SemanticModel model, 414SemanticModel model,
SymbolDisplay\SymbolDisplay.cs (10)
61SemanticModel? semanticModelOpt, 93SemanticModel semanticModel, 105SemanticModel semanticModel, 115SemanticModel semanticModel, 184SemanticModel semanticModel, 197SemanticModel semanticModel, 208SemanticModel semanticModel, 220SemanticModel? semanticModelOpt, 230SemanticModel? semanticModelOpt, 245SemanticModel? semanticModelOpt,
SymbolDisplay\SymbolDisplayVisitor.cs (3)
33SemanticModel? semanticModelOpt, 44SemanticModel? semanticModelOpt, 58protected new void Initialize(ArrayBuilder<SymbolDisplayPart> builder, SymbolDisplayFormat format, bool isFirstSymbolVisited, SemanticModel? semanticModelOpt, int positionOpt, bool inNamespaceOrType)
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (1)
181SemanticModel semanticModel;
Symbols\PublicModel\PreprocessingSymbol.cs (2)
88string ISymbol.ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat? format) 93ImmutableArray<SymbolDisplayPart> ISymbol.ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat? format)
Symbols\PublicModel\Symbol.cs (3)
174string ISymbol.ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format) 179ImmutableArray<SymbolDisplayPart> ISymbol.ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat format) 184internal static CSharpSemanticModel GetCSharpSemanticModel(SemanticModel semanticModel)
Symbols\PublicModel\TypeSymbol.cs (2)
183string ITypeSymbol.ToMinimalDisplayString(SemanticModel semanticModel, CodeAnalysis.NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format) 188ImmutableArray<SymbolDisplayPart> ITypeSymbol.ToMinimalDisplayParts(SemanticModel semanticModel, CodeAnalysis.NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format)
Symbols\Symbol.cs (2)
1479SemanticModel semanticModel, 1487SemanticModel semanticModel,
Symbols\TypeSymbol.cs (2)
674SemanticModel semanticModel, 683SemanticModel semanticModel,
Microsoft.CodeAnalysis.CSharp.CodeStyle (286)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
45SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
59var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (2)
33SemanticModel semanticModel, 82private (VariableDeclaratorSyntax, ISymbol)? TryGetVariableDeclaratorAndSymbol(SemanticModel semanticModel)
src\Analyzers\CSharp\Analyzers\ForEachCast\CSharpForEachCastDiagnosticAnalyzer.cs (1)
27SemanticModel semanticModel, CommonForEachStatementSyntax node)
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (3)
126var semanticModel = context.SemanticModel; 250SemanticModel semanticModel, 328SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
274var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
49var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticHelper.cs (3)
17private static bool TryGetDataFlowAnalysis(LocalFunctionStatementSyntax localFunction, SemanticModel semanticModel, [NotNullWhen(returnValue: true)] out DataFlowAnalysis? dataFlow) 38public static bool CanMakeLocalFunctionStaticBecauseNoCaptures(LocalFunctionStatementSyntax localFunction, SemanticModel semanticModel) 43public static bool CanMakeLocalFunctionStaticByRefactoringCaptures(LocalFunctionStatementSyntax localFunction, SemanticModel semanticModel, out ImmutableArray<ISymbol> captures)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
218var semanticModel = blockOperation.SemanticModel; 261SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
47var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
25protected override bool IsUnnecessaryCast(SemanticModel model, ExpressionSyntax cast, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
50var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (4)
59var semanticModel = context.SemanticModel; 210var rewrittenSemanticModel = analyzer.SpeculativeSemanticModel; 243SemanticModel semanticModel1, 245SemanticModel semanticModel2,
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (1)
317private SyntaxTreeState GetOrCreateSyntaxTreeState(SyntaxTree tree, bool defaultCompleted, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (2)
18SemanticModel semanticModel, 23private readonly SemanticModel _semanticModel = semanticModel;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryParentheses\CSharpRemoveUnnecessaryExpressionParenthesesDiagnosticAnalyzer.cs (2)
29SemanticModel semanticModel, CancellationToken cancellationToken, 38ParenthesizedExpressionSyntax parenthesizedExpression, SemanticModel semanticModel, CancellationToken cancellationToken,
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryParentheses\CSharpRemoveUnnecessaryPatternParenthesesDiagnosticAnalyzer.cs (1)
29SemanticModel semanticModel, CancellationToken cancellationToken,
src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\UnnecessaryNullableWarningSuppressionsUtilities.cs (4)
22private static bool ShouldAnalyzeNode(SemanticModel semanticModel, PostfixUnaryExpressionSyntax node, CancellationToken cancellationToken) 44SemanticModel semanticModel, 73SemanticModel semanticModel, 91var updatedSemanticModel = updatedCompilation.GetSemanticModel(updatedTree);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryUnsafeModifier\UnnecessaryUnsafeModifierUtilities.cs (5)
25private static bool ShouldAnalyzeNode(SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 38SemanticModel semanticModel, 77SemanticModel semanticModel, 90SemanticModel semanticModel, 108var updatedSemanticModel = updatedCompilation.GetSemanticModel(updatedTree);
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
44var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\SimplifyBooleanExpression\CSharpSimplifyConditionalDiagnosticAnalyzer.cs (1)
25protected override CommonConversion GetConversion(SemanticModel semanticModel, ExpressionSyntax node, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (2)
59SemanticModel semanticModel, 181var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (3)
50SemanticModel semanticModel, 205SemanticModel semanticModel, IMethodSymbol setMethod, CancellationToken cancellationToken) 239SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
27protected override bool IsTargetTyped(SemanticModel semanticModel, ConditionalExpressionSyntax conditional, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
25protected override bool IsTargetTyped(SemanticModel semanticModel, ConditionalExpressionSyntax conditional, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\UseCoalesceExpressionHelpers.cs (1)
12public static bool IsTargetTyped(SemanticModel semanticModel, ConditionalExpressionSyntax conditional, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (4)
37var semanticModel = context.SemanticModel; 62SemanticModel semanticModel, 119SemanticModel semanticModel, 140var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (2)
39var semanticModel = context.SemanticModel; 102SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
27var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyDiagnosticAnalyzer.cs (1)
28var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (2)
70var semanticModel = context.SemanticModel; 156var semanticModel = state.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
41var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (3)
43var semanticModel = context.SemanticModel; 85var semanticModel = context.SemanticModel; 124SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (8)
62SemanticModel semanticModel, 80SemanticModel semanticModel, 385SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 735SemanticModel semanticModel, 856SemanticModel semanticModel, 1007SemanticModel semanticModel, ArgumentSyntax argument, out bool unwrapArgument, out bool useSpread, CancellationToken cancellationToken) 1046public static bool IsIterable(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 1079SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
16SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerDiagnosticAnalyzer.cs (1)
50SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (3)
52var semanticModel = context.SemanticModel; 118var semanticModel = context.SemanticModel; 173SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (6)
90SemanticModel semanticModel, 120SemanticModel semanticModel, 135SemanticModel semanticModel, 199SemanticModel semanticModel, INamedTypeSymbol tupleType, 244SemanticModel semanticModel, SyntaxNode searchScope, ILocalSymbol local, 285SemanticModel semanticModel, SyntaxNode container, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForAccessorsHelper.cs (1)
68protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, AccessorDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForConstructorsHelper.cs (1)
50protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, ConstructorDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForConversionOperatorsHelper.cs (1)
50protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, ConversionOperatorDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForIndexersHelper.cs (2)
63protected override IndexerDeclarationSyntax WithGenerateBody(SemanticModel semanticModel, IndexerDeclarationSyntax declaration, CancellationToken cancellationToken) 66protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, IndexerDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs (1)
54SemanticModel semanticModel, LocalFunctionStatementSyntax statement, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForMethodsHelper.cs (1)
52SemanticModel semanticModel, MethodDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForOperatorsHelper.cs (1)
52protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, OperatorDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (2)
67SemanticModel semanticModel, PropertyDeclarationSyntax declaration, CancellationToken cancellation) 70protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, PropertyDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper.cs (1)
31public abstract SyntaxNode Update(SemanticModel semanticModel, SyntaxNode declaration, bool useExpressionBody, CancellationToken cancellationToken);
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (5)
68public sealed override SyntaxNode Update(SemanticModel semanticModel, SyntaxNode declaration, bool useExpressionBody, CancellationToken cancellationToken) 225SemanticModel semanticModel, TDeclaration declaration, bool useExpressionBody, CancellationToken cancellationToken) 283SemanticModel semanticModel, TDeclaration declaration, CancellationToken cancellationToken); 292SemanticModel semanticModel, TDeclaration declaration, CancellationToken cancellationToken) 308SemanticModel semanticModel, TDeclaration declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (1)
71SemanticModel semanticModel, CodeStyleOption2<ExpressionBodyPreference> option,
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaHelpers.cs (3)
22SemanticModel semanticModel, ExpressionBodyPreference preference, 68SemanticModel semanticModel, ExpressionBodyPreference preference, LambdaExpressionSyntax declaration, LanguageVersion languageVersion, CancellationToken cancellationToken) 109SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseImplicitlyTypedLambdaExpression\CSharpUseImplicitlyTypedLambdaExpressionDiagnosticAnalyzer.cs (2)
40var semanticModel = context.SemanticModel; 59SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
37var semanticModel = context.SemanticModel; 68SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
50var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
197var semanticModel = instance.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
78var semanticModel = operation.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (2)
53var semanticModel = context.SemanticModel; 70SemanticModel semanticModel, ExpressionSyntax left, ExpressionSyntax right)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (1)
87var semanticModel = operation.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (3)
86var semanticModel = syntaxContext.SemanticModel; 237SemanticModel semanticModel, INamedTypeSymbol? expressionTypeOpt, ISymbol local, BlockSyntax block, 388SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
53var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseNullPropagation\CSharpUseNullPropagationDiagnosticAnalyzer.cs (1)
108SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (1)
62if (operation.SemanticModel.TryGetSpeculativeSemanticModel(typeSyntax.SpanStart, dummyStatement, out var speculativeModel))
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
67var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (1)
62var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (4)
19private readonly SemanticModel _semanticModel; 29SemanticModel semanticModel, 56SemanticModel semanticModel, 252var semanticModel = _semanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
83var semanticModel = syntaxContext.SemanticModel; 269SemanticModel semanticModel, 317SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
110var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
71var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (4)
389var semanticModel = compilation.GetSemanticModel(primaryConstructorDeclaration.SyntaxTree); 407SemanticModel semanticModel, 464SemanticModel semanticModel, 546var semanticModel = operation.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (4)
86var semanticModel = context.SemanticModel; 133SemanticModel semanticModel, 176SemanticModel semanticModel, 226SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
108var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
85var semanticModel = context.Operation.SemanticModel;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (2)
32SemanticModel semanticModel, 119SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ArgumentSyntaxExtensions.cs (1)
40SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\AttributeArgumentSyntaxExtensions.cs (1)
24SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (3)
22SemanticModel semanticModel, 38DefaultExpressionSyntax defaultExpression, SemanticModel semanticModel, CancellationToken cancellationToken) 83DefaultExpressionSyntax defaultExpression, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (5)
321SemanticModel semanticModel, 424[NotNullWhen(true)] this ExpressionSyntax? expression, SemanticModel semanticModel, CancellationToken cancellationToken) 454[NotNullWhen(true)] this ExpressionSyntax? expression, SemanticModel semanticModel, CancellationToken cancellationToken) 465this ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken) 908SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (3)
20this ParenthesizedExpressionSyntax node, SemanticModel semanticModel, CancellationToken cancellationToken) 342SemanticModel semanticModel, CancellationToken cancellationToken) 409ParenthesizedExpressionSyntax node, ExpressionSyntax parentExpression, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (18)
23this SemanticModel semanticModel, 40this SemanticModel semanticModel, 103this SemanticModel semanticModel, 128public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token) 161public static ISet<INamespaceSymbol> GetUsingNamespacesInScope(this SemanticModel semanticModel, SyntaxNode location) 184this SemanticModel semanticModel, 318this SemanticModel semanticModel, 352this SemanticModel semanticModel, ExpressionSyntax expression, 429SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 459public static INamedTypeSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, BaseTypeDeclarationSyntax syntax, CancellationToken cancellationToken) 465public static IMethodSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, ConstructorDeclarationSyntax syntax, CancellationToken cancellationToken) 471public static IMethodSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, LocalFunctionStatementSyntax syntax, CancellationToken cancellationToken) 477public static IParameterSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, ParameterSyntax syntax, CancellationToken cancellationToken) 483public static IPropertySymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, PropertyDeclarationSyntax syntax, CancellationToken cancellationToken) 489public static IMethodSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, BaseMethodDeclarationSyntax syntax, CancellationToken cancellationToken) 495public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, VariableDeclaratorSyntax syntax, CancellationToken cancellationToken) 501public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SingleVariableDesignationSyntax syntax, CancellationToken cancellationToken) 511public static bool UnifiesNativeIntegers(this SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
788SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
26public static bool IsTypeInferred(this TypeSyntax typeSyntax, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\VariableDeclaratorExtensions.cs (1)
23public static bool IsTypeInferred(this VariableDeclaratorSyntax variable, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
24SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (32)
41public bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 44public bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 47public bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 50public bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 53public bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 56public bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken) 59public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 118SemanticModel oldSemanticModel, 121[NotNullWhen(true)] out SemanticModel? speculativeModel) 125var model = oldSemanticModel; 135public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken) 137var original = model.GetOriginalSemanticModel(); 176public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode node) 190public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 193public IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 204public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 216public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 252public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 262public IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 265public IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 269public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 272public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 277public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 290static ImmutableArray<ISymbol> GetCallingConventionSymbols(SemanticModel model, FunctionPointerUnmanagedCallingConventionSyntax syntax) 299/// cref="ModelExtensions.GetSymbolInfo(SemanticModel, SyntaxNode, CancellationToken)"/>, but sometimes employs 303private ImmutableArray<ISymbol> GetSymbolInfo(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 390public bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 398var semanticModel = compilation.GetSemanticModel(syntaxReference.SyntaxTree); 414public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken) 417public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 420public IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node) 429private static IPreprocessingSymbol? CreatePreprocessingSymbol(SemanticModel model, SyntaxToken identifier)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
501public bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (39)
46public static bool IsUnnecessaryCast(ExpressionSyntax cast, SemanticModel semanticModel, CancellationToken cancellationToken) 54public static bool IsUnnecessaryAsCast(BinaryExpressionSyntax cast, SemanticModel semanticModel, CancellationToken cancellationToken) 61public static bool IsUnnecessaryCast(CastExpressionSyntax cast, SemanticModel semanticModel, CancellationToken cancellationToken) 122SemanticModel semanticModel, 154SemanticModel semanticModel, 179SemanticModel originalSemanticModel, CancellationToken cancellationToken) 250SemanticModel originalSemanticModel, IDelegateCreationOperation originalDelegateCreationOperation, 290SemanticModel originalSemanticModel, IConversionOperation originalConversionOperation, 618SemanticModel originalSemanticModel, 682ExpressionSyntax castNode, ExpressionSyntax castedExpressionNode, SemanticModel semanticModel, CancellationToken cancellationToken) 769ExpressionSyntax rewrittenExpression, SemanticModel rewrittenSemanticModel, 836ExpressionSyntax castNode, SemanticModel originalSemanticModel, 837ExpressionSyntax rewrittenExpression, SemanticModel rewrittenSemanticModel, CancellationToken cancellationToken) 861ExpressionSyntax castNode, SemanticModel originalSemanticModel, 862ExpressionSyntax rewrittenExpression, SemanticModel rewrittenSemanticModel, CancellationToken cancellationToken) 891SemanticModel originalSemanticModel, 893SemanticModel rewrittenSemanticModel, 1041SemanticModel semanticModel, 1117SemanticModel semanticModel, 1176SemanticModel semanticModel, CancellationToken cancellationToken) 1243private static bool IsFieldOrArrayElement(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 1250ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken) 1264SemanticModel originalSemanticModel, SemanticModel rewrittenSemanticModel, 1317SemanticModel originalSemanticModel, SemanticModel rewrittenSemanticModel, 1350SemanticModel originalSemanticModel, SemanticModel rewrittenSemanticModel) 1381SemanticModel originalSemanticModel, 1382SemanticModel rewrittenSemanticModel, 1490SemanticModel originalSemanticModel, 1491SemanticModel rewrittenSemanticModel, 1530SemanticModel semanticModel, 1568MemberAccessExpressionSyntax memberAccessExpression, SemanticModel semanticModel, 1624SemanticModel originalSemanticModel, SemanticModel rewrittenSemanticModel, 1646private static (SemanticModel? rewrittenSemanticModel, ExpressionSyntax? rewrittenExpression) GetSemanticModelWithCastRemoved( 1649SemanticModel originalSemanticModel, 1655var rewrittenSemanticModel = analyzer.SpeculativeSemanticModel;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (17)
58SemanticModel semanticModel, 104protected override void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate) 113protected override SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel) 116public static SemanticModel CreateSpeculativeSemanticModelForNode(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel) 123public static SemanticModel CreateSpeculativeSemanticModelForNode(SyntaxNode nodeToSpeculate, SemanticModel semanticModel, int position, bool isInNamespaceOrTypeContext) 134SemanticModel speculativeModel; 654protected override bool IsForEachTypeInferred(CommonForEachStatementSyntax forEachStatement, SemanticModel semanticModel) 813protected override bool ConversionsAreCompatible(SemanticModel originalModel, ExpressionSyntax originalExpression, SemanticModel newModel, ExpressionSyntax newExpression) 877protected override bool ForEachConversionsAreCompatible(SemanticModel originalModel, CommonForEachStatementSyntax originalForEach, SemanticModel newModel, CommonForEachStatementSyntax newForEach) 886SemanticModel model, 934protected override Conversion ClassifyConversion(SemanticModel model, ExpressionSyntax expression, ITypeSymbol targetType) 937protected override Conversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (6)
35TypeSyntax typeName, SemanticModel semanticModel, 54TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 57SyntaxToken identifier, TypeSyntax typeName, ExpressionSyntax initializer, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 59internal TypeSyntax? FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 92protected virtual bool ShouldAnalyzeForEachStatement(ForEachStatementSyntax forEachStatement, SemanticModel semanticModel, CancellationToken cancellationToken) 95protected virtual bool ShouldAnalyzeDeclarationExpression(DeclarationExpressionSyntax declaration, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (4)
36SyntaxNode declaration, SemanticModel semanticModel, 80private static bool IsTypeApparentInDeclaration(VariableDeclarationSyntax variableDeclaration, SemanticModel semanticModel, UseVarPreference stylePreferences, CancellationToken cancellationToken) 107private static bool IsPredefinedTypeInDeclaration(SyntaxNode declarationStatement, SemanticModel semanticModel) 146private static bool IsInferredPredefinedType(SyntaxNode declarationStatement, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (5)
47protected override bool ShouldAnalyzeForEachStatement(ForEachStatementSyntax forEachStatement, SemanticModel semanticModel, CancellationToken cancellationToken) 60TypeSyntax typeName, SemanticModel semanticModel, 114protected override bool ShouldAnalyzeDeclarationExpression(DeclarationExpressionSyntax declaration, SemanticModel semanticModel, CancellationToken cancellationToken) 137SemanticModel semanticModel, 149private static bool ContainsAnonymousType(TypeSyntax typeName, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (8)
30TypeSyntax typeName, SemanticModel semanticModel, 58protected override bool ShouldAnalyzeForEachStatement(ForEachStatementSyntax forEachStatement, SemanticModel semanticModel, CancellationToken cancellationToken) 69protected override bool ShouldAnalyzeDeclarationExpression(DeclarationExpressionSyntax declaration, SemanticModel semanticModel, CancellationToken cancellationToken) 92TypeSyntax typeName, SemanticModel semanticModel, 152SemanticModel semanticModel, 182var newSemanticModel = semanticModel.Compilation.ReplaceSyntaxTree(tree, newTree).GetSemanticModel(newTree); 191private static bool IsSafeToSwitchToVarWithoutNeedingSpeculation(DeclarationExpressionSyntax declarationExpression, SemanticModel semanticModel, CancellationToken cancellationToken) 243SemanticModel semanticModel,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (165)
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\ArgumentFixer.cs (1)
29protected override SymbolInfo GetSpeculativeSymbolInfo(SemanticModel semanticModel, ArgumentListSyntax newArgumentList)
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\AttributeArgumentFixer.cs (1)
29protected override SymbolInfo GetSpeculativeSymbolInfo(SemanticModel semanticModel, AttributeArgumentListSyntax newArgumentList)
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (2)
52SemanticModel semanticModel, 90SemanticModel semanticModel, ExpressionSyntax targetNode, ITypeSymbol conversionType)
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (1)
42var semanticModel = await context.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\AddParameter\CSharpAddParameterCodeFixProvider.cs (2)
49protected override ITypeSymbol GetArgumentType(SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken) 56SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (2)
37var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 98var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
64var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (3)
24private readonly SemanticModel _semanticModel; 30private Rewriter(SemanticModel semanticModel, bool isAllThrowStatements, CancellationToken cancellationToken) 39SemanticModel model,
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (3)
35SemanticModel semanticModel, 47SemanticModel semanticModel, 62SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (2)
40var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 86var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
38SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\ConvertTypeOfToNameOf\CSharpConvertTypeOfToNameOfCodeFixProvider.cs (1)
32protected override SyntaxNode GetSymbolTypeExpression(SemanticModel model, MemberAccessExpressionSyntax node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (3)
43var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 51SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken, 137var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (2)
76var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 153private static ITypeSymbol? InferTupleType(TupleExpressionSyntax tuple, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\ForEachCast\CSharpForEachCastCodeFixProvider.cs (1)
20SemanticModel semanticModel, CommonForEachStatementSyntax forEachStatement)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (5)
55var semanticModel = document.SemanticModel; 173protected override string GenerateNameForExpression(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 176protected override ITypeSymbol GetArgumentType(SemanticModel semanticModel, Argument<ExpressionSyntax> argument, CancellationToken cancellationToken) 182protected override IMethodSymbol? GetCurrentConstructor(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 185protected override IMethodSymbol? GetDelegatedConstructor(SemanticModel semanticModel, IMethodSymbol constructor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
54var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (2)
47protected override bool AreSpecialOptionsActive(SemanticModel semanticModel) 50protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (3)
32protected override bool AreSpecialOptionsActive(SemanticModel semanticModel) 35protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel) 38public override ImmutableArray<IParameterSymbol> TryMakeParameters(SemanticModel semanticModel, SyntaxNode target, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (4)
40protected override bool AreSpecialOptionsActive(SemanticModel semanticModel) 43protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel) 61var semanticModel = document.SemanticModel; 146SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (2)
51var semanticModel = Document.SemanticModel; 70var semanticModel = Document.SemanticModel;
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
49Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken,
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (5)
97CSharpSimplifierOptions options, SemanticModel semanticModel, 324SemanticModel semanticModel, 355topmostContainer.SpanStart, updatedTopmostContainer, out var speculativeModel)) 384SemanticModel semanticModel, 386out SemanticModel speculativeModel)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (6)
53var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 89SemanticModel model, ExpressionSyntax? expression, [NotNullWhen(true)] out ITypeSymbol? returnExpressionType) 103SyntaxNode node, SemanticModel model, CancellationToken cancellationToken, 117private static bool IsCorrectTypeForYieldReturn(ITypeSymbol typeArgument, ITypeSymbol returnExpressionType, ITypeSymbol methodReturnType, SemanticModel model) 151private static bool CanConvertTypes(ITypeSymbol typeArgument, ITypeSymbol returnExpressionType, SemanticModel model) 190private static bool IsCorrectTypeForYieldReturn(ITypeSymbol methodReturnType, SemanticModel model)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
38var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 111SemanticModel model,
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
46var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
85var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
52var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
48var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (3)
82var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 99Document document, SemanticModel model, SyntaxEditor editor, SyntaxNode node, HashSet<TypeSyntax> alreadyHandled, CancellationToken cancellationToken) 111Document document, SemanticModel? model, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
60var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryParentheses\CSharpRemoveUnnecessaryParenthesesCodeFixProvider.cs (1)
20protected override bool CanRemoveParentheses(SyntaxNode current, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryNullableWarningSuppressionsCodeFixProvider.cs (1)
54var linkedSemanticModel = await linkedDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
91protected override SyntaxNode? TryUpdateParentOfUpdatedNode(SyntaxNode parent, SyntaxNode newNameNode, SyntaxEditor editor, ISyntaxFacts syntaxFacts, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (2)
47var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 78SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (1)
22SemanticModel semanticModel, SyntaxNode expressionToCoalesce,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (2)
64var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 100SemanticModel semanticModel, ExpressionSyntax expression, INamedTypeSymbol? expressionType)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
44var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (1)
52var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocCodeFixProvider.cs (1)
40var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
44var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
58SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (3)
33SemanticModel semanticModel, InvocationExpressionSyntax invocationExpression, CancellationToken cancellationToken) 102var semanticModel = await context.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 117var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
44var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (2)
57var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 76SemanticModel semanticModel, SyntaxEditor editor, Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (5)
22internal static LambdaExpressionSyntax Update(SemanticModel semanticModel, LambdaExpressionSyntax lambdaExpression, CancellationToken cancellationToken) 26SemanticModel semanticModel, LambdaExpressionSyntax lambdaExpression, CancellationToken cancellationToken) 35SemanticModel semanticModel, LambdaExpressionSyntax declaration, CancellationToken cancellationToken) 57SemanticModel semanticModel, LambdaExpressionSyntax lambdaExpression, ExpressionSyntax expressionBody) 80SemanticModel semanticModel, LambdaExpressionSyntax declaration)
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
40var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (5)
96var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 148var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 163SemanticModel semanticModel, 184SemanticModel semanticModel, 247private static ITypeSymbol GetConvertedType(SemanticModel semanticModel, SyntaxNode typeSyntax, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
64SemanticModel semanticModel, SyntaxNode currentRoot,
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
56var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 125SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
76var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 125var semanticModel = p.Target.SemanticModel;
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
47var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 84SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (2)
38var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 47SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
120var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (2)
63SemanticModel? semanticModel, 78SemanticModel? semanticModel,
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (2)
46var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 91private static IArrayCreationOperation GetArrayCreationOperation(SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (5)
28protected override INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model) 42SemanticModel model, 52private static INamespaceSymbol? GetExplicitNamespaceSymbol(ExpressionSyntax fullName, ExpressionSyntax namespacePart, SemanticModel model) 79private readonly SemanticModel _model; 100SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (3)
51SemanticModel semanticModel, 180public static CSharpSyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 184Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContextService.cs (1)
18public SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
685public static bool IsNumericTypeContext(this SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (9)
618SemanticModel? semanticModel = null) 719this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, SemanticModel? semanticModel = null) 964SemanticModel? semanticModelOpt = null) 1714SemanticModel? semanticModelOpt = null) 2000public static bool IsInstanceContext(this SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken) 2169SemanticModel? semanticModel = null) 2742public static bool IsNameOfContext(this SyntaxTree syntaxTree, int position, SemanticModel? semanticModelOpt = null, CancellationToken cancellationToken = default) 2810SemanticModel semanticModel, 3016public static bool IsEnumTypeMemberAccessContext(this SyntaxTree syntaxTree, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
101SemanticModel semanticModel, 130var speculativeSemanticModel = specAnalyzer.SpeculativeSemanticModel; 164SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\InternalExtensions.cs (2)
15SemanticModel semanticModel, 21public static ITypeSymbol DetermineParameterType(ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
110public static async Task<ISymbol?> FindApplicableAliasAsync(this ITypeSymbol type, int position, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (7)
22public static INamespaceSymbol GetDeclaredSymbol(this SemanticModel semanticModel, BaseNamespaceDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default) 36this SemanticModel semanticModel, 45this SemanticModel semanticModel, 54this SemanticModel semanticModel, 77this SemanticModel semanticModel, 99this SemanticModel semanticModel, ArgumentSyntax argument, CancellationToken cancellationToken) 112this SemanticModel semanticModel, AttributeArgumentSyntax argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
70public static IEnumerable<BaseTypeSyntax> GetAllBaseListTypes(this TypeDeclarationSyntax typeNode, SemanticModel model, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
16public static bool IsPotentialTypeName([NotNullWhen(true)] this TypeSyntax? typeSyntax, SemanticModel? semanticModelOpt, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
61var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
41var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (13)
36protected override IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, CancellationToken cancellationToken) 67public bool IsExpressionContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 75public bool IsStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 81public bool IsTypeContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 84public bool IsNamespaceContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 87public bool IsNamespaceDeclarationNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 90public bool IsTypeDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 96public bool IsMemberDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 102public bool IsGlobalStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 105public bool IsLabelContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 108public bool IsAttributeNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 111public CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination) 116public IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.cs (1)
21protected override AbstractTypeInferrer CreateTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
30SemanticModel semanticModel, 2053var currentSemanticModel = SemanticModel; 2054var originalSemanticModel = currentSemanticModel.GetOriginalSemanticModel();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\SemanticModelReuse\CSharpSemanticModelReuseLanguageService.cs (3)
54protected override SemanticModel? TryGetSpeculativeSemanticModelWorker(SemanticModel previousSemanticModel, SyntaxNode previousBodyNode, SyntaxNode currentBodyNode) 59previousSemanticModel.TryGetSpeculativeSemanticModelForMethodBody(previousBaseMethod.Body.SpanStart, currentBaseMethod, out var speculativeModel))
Microsoft.CodeAnalysis.CSharp.EditorFeatures (7)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
316var semanticModel = semanticDocument.SemanticModel;
EventHookup\EventHookupSessionManager_EventHookupSession.cs (4)
145var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 184private IEventSymbol? GetEventSymbol(SemanticModel semanticModel, SyntaxToken plusEqualsToken, CancellationToken cancellationToken) 196IEventSymbol eventSymbol, SyntaxToken plusEqualsToken, SemanticModel semanticModel, 219private string? GetNameObjectPart(IEventSymbol eventSymbol, SyntaxToken plusEqualsToken, SemanticModel semanticModel, ISyntaxFactsService syntaxFactsService)
GoToBase\CSharpGoToBaseService.cs (1)
40var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
InlineRename\CSharpEditorInlineRenameService.cs (1)
57var semanticModel = await renameDefinition.Document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (20)
CodeGeneration\SyntaxGeneratorTests.cs (3)
48var semanticModel = await newDocument.GetSemanticModelAsync(); 78var semanticModel = await document.GetSemanticModelAsync(); 86out var speculativeModel));
OnTheFlyDocs\OnTheFlyDocsUtilitiesTests.cs (3)
36var semanticModel = await document.GetSemanticModelAsync(); 72var semanticModel = await document.GetSemanticModelAsync(); 118var semanticModel = await document.GetSemanticModelAsync();
Semantics\SpeculationAnalyzerTests.cs (1)
495protected override bool ReplacementChangesSemantics(SyntaxNode initialNode, SyntaxNode replacementNode, SemanticModel initialModel)
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (4)
159var model = bindingtuples.Item2; 257var model = comp40.GetSemanticModel(comp40.SyntaxTrees.First()); 347var model = bindingtuples.Item2; 431var model = bindingtuples.Item2;
SymbolKey\SymbolKeyTestBase.cs (8)
54internal static void ResolveAndVerifyTypeSymbol(ExpressionSyntax node, ITypeSymbol sourceSymbol, SemanticModel model, CSharpCompilation sourceComp) 60internal static void ResolveAndVerifySymbol(ExpressionSyntax node, ISymbol sourceSymbol, SemanticModel model, CSharpCompilation sourceComp, SymbolKeyComparison comparison = SymbolKeyComparison.None) 253var model = comp.GetSemanticModel(tree); 283var model = _compilation.GetSemanticModel(declarator.SyntaxTree); 308var model = _compilation.GetSemanticModel(node.SyntaxTree); 348private static void GetLabelSymbols(BlockSyntax body, SemanticModel model, List<ISymbol> list) 370private static void GetAnonymousTypeOrFuncSymbols(BlockSyntax body, SemanticModel model, List<ISymbol> list) 387private static void GetAnonymousExprSymbols(ExpressionSyntax expr, SemanticModel model, List<ISymbol> list)
SymbolKey\SymbolKeyTests.cs (1)
293var semanticModel = bodyCompilation.GetSemanticModel(tree);
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
77var semanticModel = compilation.GetSemanticModel(tree);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (293)
CodeGen\CodeGenAsyncIteratorTests.cs (2)
8889var model = comp.GetSemanticModel(tree); 8954var model = comp.GetSemanticModel(tree);
CodeGen\CodeGenAsyncMethodBuilderOverrideTests.cs (2)
895var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 947var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false);
CodeGen\CodeGenAwaitForeachTests.cs (8)
1178var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 6539var model = comp.GetSemanticModel(tree); 7566var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 14401var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 14538var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 14680var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 14741var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 14873var model = comp.GetSemanticModel(tree, ignoreAccessibility: false);
CodeGen\CodeGenCheckedTests.cs (2)
2914var model = comp.GetSemanticModel(tree); 2946var model = comp.GetSemanticModel(tree);
CodeGen\CodeGenDeconstructTests.cs (86)
94var model = compilation.GetSemanticModel(tree); 254var model = comp.Compilation.GetSemanticModel(tree); 310var model = comp.GetSemanticModel(tree); 1110var model = comp.Compilation.GetSemanticModel(tree); 1365var model = compilation.GetSemanticModel(tree); 1422var model = compilation.GetSemanticModel(tree); 1466var model = comp.GetSemanticModel(tree); 1507var model = comp.GetSemanticModel(tree); 1560var model = comp.GetSemanticModel(tree); 1667var model = compilation.GetSemanticModel(tree); 2286var model = comp.Compilation.GetSemanticModel(tree); 2686var model = compilation.GetSemanticModel(tree); 3128var model = compilation.GetSemanticModel(tree); 3176var model = compilation.GetSemanticModel(tree); 3240var model = compilation.GetSemanticModel(tree); 3278var model = compilation.GetSemanticModel(tree); 3328var model = compilation.GetSemanticModel(tree); 3366var model = compilation.GetSemanticModel(tree); 3441var model = compilation.GetSemanticModel(tree); 3477var model = compilation.GetSemanticModel(tree); 3542var model = compilation.GetSemanticModel(tree); 3562private static void VerifyModelForDeconstructionLocal(SemanticModel model, SingleVariableDesignationSyntax decl, params IdentifierNameSyntax[] references) 3567private static void VerifyModelForLocal(SemanticModel model, SingleVariableDesignationSyntax decl, LocalDeclarationKind kind, params IdentifierNameSyntax[] references) 3572private static void VerifyModelForDeconstructionForeach(SemanticModel model, SingleVariableDesignationSyntax decl, params IdentifierNameSyntax[] references) 3577private static void VerifyModelForDeconstruction(SemanticModel model, SingleVariableDesignationSyntax decl, LocalDeclarationKind kind, params IdentifierNameSyntax[] references) 3609private static void VerifyModelForDeconstructionField(SemanticModel model, SingleVariableDesignationSyntax decl, params IdentifierNameSyntax[] references) 3688var model = compilation.GetSemanticModel(tree); 3733var model = compilation.GetSemanticModel(tree); 3790var model = compilation.GetSemanticModel(tree); 3840var model = compilation.GetSemanticModel(tree); 3886var model = compilation.GetSemanticModel(tree); 3930var model = compilation.GetSemanticModel(tree); 3976var model = compilation.GetSemanticModel(tree); 4025var model = compilation.GetSemanticModel(tree); 4131var model = compilation.GetSemanticModel(tree); 4216var model = compilation.GetSemanticModel(tree); 4327var model = compilation.GetSemanticModel(tree); 4403var model = compilation.GetSemanticModel(tree); 4436var model = compilation.GetSemanticModel(tree); 4590var model = compilation.GetSemanticModel(tree); 5019var model = compilation.GetSemanticModel(tree); 5171var model = compilation.GetSemanticModel(tree); 5308var model = compilation.GetSemanticModel(tree); 5344var model = compilation.GetSemanticModel(tree); 5399var model = comp.GetSemanticModel(tree); 5432var model = comp.GetSemanticModel(tree); 5470var model = comp.GetSemanticModel(tree); 5502var model = comp.GetSemanticModel(tree); 5533var model = comp.GetSemanticModel(tree); 5562var model = comp.GetSemanticModel(tree); 5602var model = comp.GetSemanticModel(tree); 5641var model = comp.GetSemanticModel(tree); 5685var model = comp.GetSemanticModel(tree); 5724var model = comp.GetSemanticModel(tree); 5766var model = comp.GetSemanticModel(tree); 5802var model = comp.GetSemanticModel(tree); 5852var model = comp.GetSemanticModel(tree); 5906var model = comp.GetSemanticModel(tree); 5997var model = comp.GetSemanticModel(tree); 6029var model = comp.GetSemanticModel(tree); 6082var model = comp.GetSemanticModel(tree); 6131var model = comp.GetSemanticModel(tree); 6180var model = comp.GetSemanticModel(tree); 6210var model = comp.GetSemanticModel(tree); 6252var model = comp.GetSemanticModel(tree); 6303var model = comp.GetSemanticModel(tree); 6335var model = comp.GetSemanticModel(tree); 6365var model = comp.GetSemanticModel(tree); 6392var model = comp.GetSemanticModel(tree); 6437var model = compilation.GetSemanticModel(tree); 6560var model = comp.GetSemanticModel(tree); 6858var model = compilation.GetSemanticModel(tree); 6930var model = compilation.GetSemanticModel(tree); 6973var model = comp.GetSemanticModel(tree); 7066var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 7121var model = compilation.GetSemanticModel(tree); 7174var model = compilation.GetSemanticModel(tree); 7229var model = compilation.GetSemanticModel(tree); 7267var model = compilation.GetSemanticModel(tree); 7304var model = compilation.GetSemanticModel(tree); 7352var model = compilation.GetSemanticModel(tree); 7391var model = compilation.GetSemanticModel(tree); 7427var model = compilation.GetSemanticModel(tree); 7504var model = compilation.GetSemanticModel(tree); 7561var model = compilation.GetSemanticModel(tree); 9009var model = comp.GetSemanticModel(tree);
CodeGen\CodeGenExprLambdaTests.cs (2)
1492var model = comp.GetSemanticModel(tree); 1529var model = comp.GetSemanticModel(tree);
CodeGen\CodeGenForEachTests.cs (1)
1757var model = comp.GetSemanticModel(tree, ignoreAccessibility: false);
CodeGen\CodeGenFunctionPointersTests.cs (17)
3060var model = comp.GetSemanticModel(syntaxTree); 3112var model = comp.GetSemanticModel(syntaxTree); 3337var model = comp.GetSemanticModel(syntaxTree); 3408var model = comp.GetSemanticModel(syntaxTree); 3455var model = comp.GetSemanticModel(syntaxTree); 3566var model = comp.GetSemanticModel(tree); 3618var model = comp.GetSemanticModel(tree); 3669var model = comp.GetSemanticModel(tree); 3708var model = comp.GetSemanticModel(tree); 4113var model = comp.GetSemanticModel(syntaxTree); 4915var model = comp.GetSemanticModel(syntaxTree); 7411var model = comp.GetSemanticModel(tree); 7513var model = comp.GetSemanticModel(tree); 7569var model = allInCoreLib.GetSemanticModel(tree); 7638var model = allInCoreLib.GetSemanticModel(tree); 7725var model = comp1.GetSemanticModel(tree); 10791var model = comp.GetSemanticModel(tree);
CodeGen\CodeGenLocalFunctionTests.cs (4)
145var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 5746var semanticModel = comp.GetSemanticModel(syntaxTree); 5821var semanticModel = comp.GetSemanticModel(syntaxTree); 5896var semanticModel = comp.GetSemanticModel(syntaxTree);
CodeGen\CodeGenOperators.cs (3)
5410var model = result.Compilation.GetSemanticModel(tree); 5698var model = compilation.GetSemanticModel(tree); 5736var model = compilation.GetSemanticModel(tree);
CodeGen\CodeGenRefLocalTests.cs (3)
4040var model = comp.GetSemanticModel(tree); 4077var model = comp.GetSemanticModel(tree); 4111var model = comp.GetSemanticModel(tree);
CodeGen\CodeGenTupleEqualityTests.cs (36)
359var model = comp.Compilation.GetSemanticModel(tree); 680var model = comp.Compilation.GetSemanticModel(tree); 711var model = comp.Compilation.GetSemanticModel(tree); 768var model = comp.GetSemanticModel(tree); 790var model = comp.GetSemanticModel(tree); 852var model = comp.GetSemanticModel(tree); 900var model = comp.GetSemanticModel(tree); 949var model = comp.GetSemanticModel(tree); 999var model = comp.GetSemanticModel(tree); 1053var model = comp.GetSemanticModel(tree); 1087var model = comp.GetSemanticModel(tree); 1119var model = comp.GetSemanticModel(tree); 1150var model = comp.GetSemanticModel(tree); 1210var model = comp.GetSemanticModel(tree); 1310var model = comp.GetSemanticModel(tree); 1396var model = comp.GetSemanticModel(tree); 1461var model = comp.GetSemanticModel(tree); 1494var model = comp.GetSemanticModel(tree); 1555var model = comp.GetSemanticModel(tree); 1592var model = comp.GetSemanticModel(tree); 1617var model = comp.GetSemanticModel(tree); 1672var model = comp.GetSemanticModel(tree); 1774var model = comp.GetSemanticModel(tree); 1916var model = comp.GetSemanticModel(tree); 2571var model = comp.GetSemanticModel(tree); 2639var model = comp.GetSemanticModel(tree); 3276var model = comp.GetSemanticModel(tree); 3682var model = comp.GetSemanticModel(tree); 3806var model = comp.GetSemanticModel(tree); 3909var model = comp.GetSemanticModel(tree); 4034var model = comp.GetSemanticModel(tree); 4081var model = comp.GetSemanticModel(tree); 4182var model = comp.GetSemanticModel(tree); 4275var model = comp.GetSemanticModel(tree); 5120var model = comp.GetSemanticModel(tree); 5156var model = comp.GetSemanticModel(tree);
CodeGen\CodeGenTupleTest.cs (100)
1608var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 3217var model = compilation.GetSemanticModel(tree); 3250var model = compilation.GetSemanticModel(tree); 3463var model = compilation.GetSemanticModel(tree); 3634var model = compilation.GetSemanticModel(tree); 3685var model = compilation.GetSemanticModel(tree); 3931var model = compilation.GetSemanticModel(tree); 3988var model = compilation.GetSemanticModel(tree); 4021var model = compilation.GetSemanticModel(tree); 4153var model = compilation.GetSemanticModel(tree); 4838var model = comp.GetSemanticModel(tree); 5074var model = comp.GetSemanticModel(tree); 5118var model = comp.GetSemanticModel(tree); 5159var model = comp.GetSemanticModel(tree); 5203var model = comp.GetSemanticModel(tree); 5472var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 7496var model = comp.GetSemanticModel(tree); 7529var model = comp.GetSemanticModel(tree); 7566var model = comp.GetSemanticModel(tree); 7629var model = comp.GetSemanticModel(tree); 8290var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8321var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8376var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8405var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8434var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8482var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8516var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8549var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8578var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8625var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8660var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8689var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8718var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8748var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8803var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8833var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8892var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8939var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 9012var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 9069var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 9141var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 9222var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 9305var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 9853var model = comp.GetSemanticModel(tree); 9904var model = comp.GetSemanticModel(tree); 9946var model = comp.GetSemanticModel(tree); 9992var model = comp.GetSemanticModel(tree); 10058var model = comp.GetSemanticModel(tree); 10097var model = comp.GetSemanticModel(tree); 10131var model = comp.GetSemanticModel(tree); 12691var model = c.GetSemanticModel(tree); 13972var model = c.GetSemanticModel(tree); 14243var model = c.GetSemanticModel(tree); 14431var model = comp.GetSemanticModel(tree); 16538var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 16565var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 16602var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 17209var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 17270var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 17329var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 17367var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 17400var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 17433var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 19061var model = comp.GetSemanticModel(tree); 19100var model = comp.GetSemanticModel(tree); 19139var model = comp.GetSemanticModel(tree); 19178var model = comp.GetSemanticModel(tree); 19228var model = comp.GetSemanticModel(tree); 19290var model = comp.GetSemanticModel(tree); 19393var model = comp.GetSemanticModel(tree); 19424var model = comp.GetSemanticModel(tree); 19478var model = comp.GetSemanticModel(tree); 19536var model = comp.GetSemanticModel(tree); 19659var model = comp.GetSemanticModel(tree); 19703var model = comp.GetSemanticModel(tree); 19734var model = comp.GetSemanticModel(tree); 20356var model = comp.GetSemanticModel(tree); 21349var model = comp.GetSemanticModel(tree); 22854var model = compilation.GetSemanticModel(tree); 24179var model = compilation.GetSemanticModel(tree); 24258var model = comp.GetSemanticModel(tree); 24321var model = comp.GetSemanticModel(tree); 24385var model = comp.GetSemanticModel(tree); 24458var model = comp.GetSemanticModel(tree); 24531var model = comp.GetSemanticModel(tree); 24605var model = comp.GetSemanticModel(tree); 25023var model = comp.GetSemanticModel(tree); 25051var model = comp.GetSemanticModel(tree); 25082var model = comp.GetSemanticModel(tree); 25702var model = comp.GetSemanticModel(tree); 25773var model = comp.GetSemanticModel(tree); 25838var model = comp.GetSemanticModel(tree); 25880var model = comp.GetSemanticModel(tree); 25910var model = comp.GetSemanticModel(tree); 26222var model = comp.GetSemanticModel(tree); 26294var model = comp.GetSemanticModel(tree); 26327var model = comp.GetSemanticModel(tree); 26360var model = comp.GetSemanticModel(tree); 26393var model = comp.GetSemanticModel(tree); 27566var model = comp.GetSemanticModel(tree, ignoreAccessibility: false);
CodeGen\ForeachTest.cs (1)
1686var model = comp.GetSemanticModel(tree);
CodeGen\GotoTest.cs (2)
1148var model = CreateCompilationWithMscorlib461(new[] { tree }).GetSemanticModel(tree, ignoreAccessibility: false); 1161var model = CreateCompilationWithMscorlib461(new[] { tree }).GetSemanticModel(tree, ignoreAccessibility: false);
CodeGen\IndexAndRangeTests.cs (3)
28private static (SemanticModel model, List<ElementAccessExpressionSyntax> accesses) GetModelAndAccesses(CSharpCompilation comp) 32var model = comp.GetSemanticModel(syntaxTree); 3859var model = comp.GetSemanticModel(tree, ignoreAccessibility: false);
CodeGen\ObjectAndCollectionInitializerTests.cs (2)
1106var model = comp.GetSemanticModel(tree); 3588var model = comp.GetSemanticModel(tree);
CodeGen\PatternTests.cs (3)
4997var model = compilation.GetSemanticModel(tree); 5123var model = compilation.GetSemanticModel(tree); 5272var model = compilation.GetSemanticModel(tree);
Emit\EntryPointTests.cs (1)
1597var model = compilation.GetSemanticModel(compilation.SyntaxTrees[0]);
Emit\InAttributeModifierTests.cs (15)
1854var model = comp.GetSemanticModel(tree); 1899var model = comp.GetSemanticModel(tree); 1957var model = comp.GetSemanticModel(tree); 1998var model = comp.GetSemanticModel(tree); 2051var model = comp.GetSemanticModel(tree); 2092var model = comp.GetSemanticModel(tree); 2142var model = comp.GetSemanticModel(tree); 2184var model = comp.GetSemanticModel(tree); 2234var model = comp.GetSemanticModel(tree); 2293var model = comp.GetSemanticModel(tree); 2334var model = comp.GetSemanticModel(tree); 2367var model = comp.GetSemanticModel(tree); 2415var model = comp.GetSemanticModel(tree); 2472var model = comp.GetSemanticModel(tree); 2522var model = comp.GetSemanticModel(tree);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (33)
CodeGen\IndexAndRangeTests.cs (18)
90var model = comp.GetSemanticModel(tree); 331var model = comp.GetSemanticModel(tree); 418var model = comp.GetSemanticModel(tree); 505var model = comp.GetSemanticModel(tree); 623var model = comp.GetSemanticModel(tree); 1572var model = comp.GetSemanticModel(tree); 1807var model = comp.GetSemanticModel(tree); 2262var model = comp.GetSemanticModel(tree); 2677var model = comp.GetSemanticModel(tree); 2840var model = comp.GetSemanticModel(tree); 3018var model = comp.GetSemanticModel(tree); 3132var model = comp.GetSemanticModel(tree); 3303var model = comp.GetSemanticModel(tree); 3454var model = comp.GetSemanticModel(tree); 3640var model = comp.GetSemanticModel(tree); 3730var model = comp.GetSemanticModel(tree); 3816var model = comp.GetSemanticModel(tree); 3889var model = comp.GetSemanticModel(tree);
Emit\NumericIntPtrTests.cs (15)
704var model = comp.GetSemanticModel(tree); 1922var model = comp.GetSemanticModel(tree); 1974var model = comp.GetSemanticModel(tree); 6014var model = comp.GetSemanticModel(tree); 6250var model = comp.GetSemanticModel(tree); 6623var model = comp.GetSemanticModel(tree); 6857var model = comp.GetSemanticModel(tree); 8131var model = comp.GetSemanticModel(tree); 10552var model = comp.GetSemanticModel(tree); 10691var model = comp.GetSemanticModel(tree); 11182var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 11205var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 11233var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 11258var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 11303var model = comp.GetSemanticModel(tree, ignoreAccessibility: false);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1834)
Attributes\AttributeTests.cs (15)
709var semanticModel = comp.GetSemanticModel(tree); 750var semanticModel = comp.GetSemanticModel(tree); 754Assert.True(semanticModel.TryGetSpeculativeSemanticModel(attrSyntax.ArgumentList.Position, newAttrSyntax, out var speculativeModel)); 815var semanticModel = comp.GetSemanticModel(tree); 819Assert.True(semanticModel.TryGetSpeculativeSemanticModel(interpolationSyntax.Position, newAttrSyntax, out var speculativeModel)); 856var semanticModel = comp.GetSemanticModel(tree); 860Assert.True(semanticModel.TryGetSpeculativeSemanticModel(attrSyntax.ArgumentList.Position, newAttrSyntax, out var speculativeModel)); 897var semanticModel = comp.GetSemanticModel(tree); 901Assert.True(semanticModel.TryGetSpeculativeSemanticModel(attrSyntax.ArgumentList.Position, newAttrSyntax, out var speculativeModel)); 936var semanticModel = comp.GetSemanticModel(tree); 940Assert.True(semanticModel.TryGetSpeculativeSemanticModel(attrSyntax.Position, newAttrSyntax, out var speculativeModel)); 5717var model = cm.GetSemanticModel(cm.SyntaxTrees[0]); 7537var semanticModel = compilation.GetSemanticModel(tree); 7578var semanticModel = compilation.GetSemanticModel(tree); 11637var model = comp.GetSemanticModel(tree);
Attributes\AttributeTests_RefReadOnly.cs (6)
1377var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 1419var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 1448var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 1454Assert.True(model.TryGetSpeculativeSemanticModel(position, localfunction, out var newModel)); 1475var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 1481Assert.True(model.TryGetSpeculativeSemanticModel(position, localfunction, out var newModel));
Attributes\AttributeTests_WellKnownAttributes.cs (7)
5766var model = compilation.GetSemanticModel(tree); 9548var model = comp.GetSemanticModel(tree); 9597var model = comp.GetSemanticModel(tree); 9653var model = comp2.GetSemanticModel(tree); 11436var model = comp.GetSemanticModel(tree); 11461var model = comp.GetSemanticModel(tree); 11492var model = comp.GetSemanticModel(tree);
Diagnostics\DiagnosticAnalyzerTests.cs (15)
3265var semanticModel1 = compilation.GetSemanticModel(tree1); 3311var semanticModel1 = compilation.GetSemanticModel(tree1); 3347var semanticModel1 = compilation.GetSemanticModel(tree1); 3604var model = compilation.GetSemanticModel(tree); 3684var semanticModel1 = compilation.GetSemanticModel(tree1); 3751var semanticModel = compilation.GetSemanticModel(tree); 3812var semanticModel = compilation.GetSemanticModel(tree); 4045var model = compilation.GetSemanticModel(tree); 4055private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _cache = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 4057public override SemanticModel GetSemanticModel(SyntaxTree tree, Compilation compilation, SemanticModelOptions options) 4062public void VerifyCachedModel(SyntaxTree tree, SemanticModel model) 4257var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 4312var semanticModel = compilation.GetSemanticModel(tree); 4437var model = compilation.GetSemanticModel(tree);
Diagnostics\DiagnosticSuppressorTests.cs (1)
717var semanticModel = compilation.GetSemanticModel(tree);
Diagnostics\GetDiagnosticsTests.cs (14)
44var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 79var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 94var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 172var model = compilation.GetSemanticModel(tree1); 221var model = compilation.GetSemanticModel(tree1); 273var model = compilation.GetSemanticModel(tree1); 340var model = compilation.GetSemanticModel(tree1); 406var model = compilation.GetSemanticModel(tree1); 447var model = compilation.GetSemanticModel(tree); 796var model = compilation.GetSemanticModel(tree, true); 849var model = compilation.GetSemanticModel(tree, true); 904var semanticModel = compilation.GetSemanticModel(syntaxTree); 1183var semanticModel = compilation.GetSemanticModel(syntaxTree); 1696var model1 = compilation.GetSemanticModel(tree1);
FieldKeywordTests.cs (13)
616var model = comp.GetSemanticModel(tree); 658var model = comp.GetSemanticModel(tree); 706var model = comp.GetSemanticModel(tree); 1400var model = comp.GetSemanticModel(tree); 1458var model = comp.GetSemanticModel(tree); 9584var model = comp.GetSemanticModel(tree); 10600var model = comp.GetSemanticModel(tree); 10605Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(previousAccessor.Body.SpanStart, modifiedAccessor, out var speculativeModel)); 10634var model = comp.GetSemanticModel(tree); 10639Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(previousAccessor.Body.SpanStart, modifiedAccessor, out var speculativeModel)); 12858var model = comp.GetSemanticModel(tree); 12884var model = comp.GetSemanticModel(tree); 12911var model = comp.GetSemanticModel(tree);
FirstClassSpanTests.cs (10)
2822var model = comp.GetSemanticModel(tree); 2855var model = comp.GetSemanticModel(tree); 5031var model = comp.GetSemanticModel(tree); 6757var model = comp.GetSemanticModel(tree); 6807var model = comp.GetSemanticModel(tree); 6857var model = comp.GetSemanticModel(tree); 6907var model = comp.GetSemanticModel(tree); 6956var model = comp.GetSemanticModel(tree); 6997var model = comp.GetSemanticModel(tree); 8876var model = comp.GetSemanticModel(invocation.SyntaxTree);
FlowAnalysis\FlowTestBase.cs (11)
137protected T CompileAndGetModelAndConstructorInitializer<T>(string program, Func<SemanticModel, ConstructorInitializerSyntax, T> analysisDelegate, params MetadataReference[] references) 141var model = comp.GetSemanticModel(tree); 158protected T CompileAndGetModelAndPrimaryConstructorInitializer<T>(string program, Func<SemanticModel, PrimaryConstructorBaseTypeSyntax, T> analysisDelegate, params MetadataReference[] references) 162var model = comp.GetSemanticModel(tree); 179protected T CompileAndGetModelAndExpression<T>(string program, Func<SemanticModel, ExpressionSyntax, T> analysisDelegate, params MetadataReference[] references) 184protected T CompileAndGetModelAndExpression<T>(string program, Func<SemanticModel, ExpressionSyntax, T> analysisDelegate, TargetFramework targetFramework, bool assertNoDiagnostics, params MetadataReference[] references) 194var model = comp.GetSemanticModel(tree); 211protected T CompileAndGetModelAndStatements<T>(string program, Func<SemanticModel, StatementSyntax, StatementSyntax, T> analysisDelegate) 215var model = comp.GetSemanticModel(tree); 284protected IEnumerable<T> CompileAndGetModelAndMultipleExpressions<T>(string program, Func<SemanticModel, ExpressionSyntax, T> analysisDelegate, int treeindex = 0, int which = -1) 295protected IEnumerable<T> CompileAndGetModelAndMultipleStatements<T>(string program, Func<SemanticModel, StatementSyntax, T> analysisDelegate, int treeindex = 0, int which = -1)
FlowAnalysis\FlowTests.cs (1)
5859var model = compilation.GetSemanticModel(tree);
FlowAnalysis\IterationJumpYieldStatementTests.cs (1)
913var semanticModel = comp.GetSemanticModel(tree);
FlowAnalysis\RegionAnalysisTests.cs (21)
3101var semanticModel = compilation.GetSemanticModel(compilation.SyntaxTrees[0]); 4524var model = compilation.GetSemanticModel(tree); 5485var model = comp.GetSemanticModel(tree); 5533var model = comp.GetSemanticModel(tree); 5577var model = comp.GetSemanticModel(tree); 5620var model = comp.GetSemanticModel(tree); 6215var model = comp.GetSemanticModel(tree); 6313var model = compilation.GetSemanticModel(tree); 6352var model = compilation.GetSemanticModel(tree); 6379var model = compilation.GetSemanticModel(tree); 6417var model = compilation.GetSemanticModel(tree); 6445var model = compilation.GetSemanticModel(tree); 6480var model = compilation.GetSemanticModel(tree); 7906var model = compilation.GetSemanticModel(tree); 8098var model = compilation.GetSemanticModel(tree); 8126var model = compilation.GetSemanticModel(tree); 14120var model = comp.GetSemanticModel(tree); 14143var model = comp.GetSemanticModel(tree); 14167var model = comp.GetSemanticModel(tree); 14205var model = comp.GetSemanticModel(tree); 14250var model = comp.GetSemanticModel(tree);
OverloadResolutionPriorityTests.cs (11)
443var model = comp.GetSemanticModel(tree); 699var model = comp3.GetSemanticModel(tree); 759var model = comp3.GetSemanticModel(tree); 807var model = comp3.GetSemanticModel(tree); 978var model = comp.GetSemanticModel(tree); 2240var model = comp.GetSemanticModel(tree); 2312var model = comp.GetSemanticModel(tree); 2347var model = comp.GetSemanticModel(tree); 2410var model = comp.GetSemanticModel(tree); 2455var model = comp.GetSemanticModel(tree); 2582var model = comp.GetSemanticModel(tree);
PartialEventsAndConstructorsTests.cs (3)
1986var model = comp.GetSemanticModel(tree); 2068var model = comp.GetSemanticModel(tree); 2143var model = comp.GetSemanticModel(tree);
RefReadonlyParameterTests.cs (3)
1548var model = comp.GetSemanticModel(tree); 7125var model = comp.GetSemanticModel(tree); 7153var model = comp.GetSemanticModel(tree);
RefStructInterfacesTests.cs (54)
7575var model = comp.GetSemanticModel(tree); 7765var model = comp.GetSemanticModel(tree); 7984var model = comp.GetSemanticModel(tree); 8175var model = comp.GetSemanticModel(tree); 8368var model = comp.GetSemanticModel(tree); 8443var model = comp.GetSemanticModel(tree); 8647var model = comp.GetSemanticModel(tree); 9018var model = comp.GetSemanticModel(tree); 9222var model = comp.GetSemanticModel(tree); 9386var model = comp.GetSemanticModel(tree); 9586var model = comp.GetSemanticModel(tree); 9810var model = comp.GetSemanticModel(tree); 10019var model = comp.GetSemanticModel(tree); 10246var model = comp.GetSemanticModel(tree); 10349var model = comp.GetSemanticModel(tree); 10444var model = comp.GetSemanticModel(tree); 10629var model = comp.GetSemanticModel(tree); 10826var model = comp.GetSemanticModel(tree); 11066var model = comp.GetSemanticModel(tree); 11294var model = comp.GetSemanticModel(tree); 11506var model = comp.GetSemanticModel(tree); 11606var model = comp.GetSemanticModel(tree); 11701var model = comp.GetSemanticModel(tree); 14656var model = comp.GetSemanticModel(tree); 14997var model = comp.GetSemanticModel(tree); 15363var model = comp.GetSemanticModel(tree); 15707var model = comp.GetSemanticModel(tree); 16055var model = comp.GetSemanticModel(tree); 16132var model = comp.GetSemanticModel(tree); 16493var model = comp.GetSemanticModel(tree); 17158var model = comp.GetSemanticModel(tree); 17223var model = comp.GetSemanticModel(tree); 17288var model = comp.GetSemanticModel(tree); 17372var model = comp.GetSemanticModel(tree); 17460var model = comp.GetSemanticModel(tree); 17553var model = comp.GetSemanticModel(tree); 17650var model = comp.GetSemanticModel(tree); 17734var model = comp.GetSemanticModel(tree); 18160var model = comp.GetSemanticModel(tree); 18357var model = comp.GetSemanticModel(tree); 18580var model = comp.GetSemanticModel(tree); 18777var model = comp.GetSemanticModel(tree); 18978var model = comp.GetSemanticModel(tree); 19052var model = comp.GetSemanticModel(tree); 19262var model = comp.GetSemanticModel(tree); 19597var model = comp.GetSemanticModel(tree); 19768var model = comp.GetSemanticModel(tree); 19925var model = comp.GetSemanticModel(tree); 20093var model = comp.GetSemanticModel(tree); 20261var model = comp.GetSemanticModel(tree); 20366var model = comp.GetSemanticModel(tree); 21635var model = comp2.GetSemanticModel(tree); 21703var model = comp.GetSemanticModel(tree); 22105var model = comp.GetSemanticModel(tree);
Semantics\CollectionExpressionTests.cs (54)
199var model = comp.GetSemanticModel(tree); 234var model = comp.GetSemanticModel(tree); 4772var model = comp.GetSemanticModel(tree); 16085var model = comp.GetSemanticModel(tree); 16161var model = comp.GetSemanticModel(tree); 16234var model = comp.GetSemanticModel(tree); 16296var model = comp.GetSemanticModel(tree); 16420var model = comp.GetSemanticModel(tree); 16503var model = comp.GetSemanticModel(tree); 16592var model = comp.GetSemanticModel(tree); 16931var model = comp.GetSemanticModel(tree); 16948private static void VerifyTypes(SemanticModel model, ExpressionSyntax expr, string expectedType, string expectedConvertedType, ConversionKind expectedConversionKind) 29347SemanticModel IOperation.SemanticModel => throw null; 30866var model = comp.GetSemanticModel(tree); 30910var model = comp.GetSemanticModel(tree); 30956var model = comp.GetSemanticModel(tree); 31000var model = comp.GetSemanticModel(tree); 31043var model = comp.GetSemanticModel(tree); 31086var model = comp.GetSemanticModel(tree); 31125var model = comp.GetSemanticModel(tree); 31158var model = comp.GetSemanticModel(tree); 31192var model = comp.GetSemanticModel(tree); 31245var model = comp.GetSemanticModel(tree); 31311var model = comp.GetSemanticModel(tree); 31372var model = comp.GetSemanticModel(tree); 31448var model = comp.GetSemanticModel(tree); 31491var model = comp.GetSemanticModel(tree); 31538var model = comp.GetSemanticModel(tree); 34090var model = comp.GetSemanticModel(tree); 34138var model = comp.GetSemanticModel(tree); 34196var model = comp.GetSemanticModel(tree); 34294var model = comp.GetSemanticModel(tree); 34919var model = comp.GetSemanticModel(tree); 34955var model = comp.GetSemanticModel(tree); 34986var model = comp.GetSemanticModel(tree); 35014var model = comp.GetSemanticModel(tree); 35056var model = comp.GetSemanticModel(tree); 35102var model = comp.GetSemanticModel(tree); 35165var model = comp.GetSemanticModel(tree); 35261var model = comp.GetSemanticModel(tree); 35656var model = comp.GetSemanticModel(tree); 36084var model = compilation.GetSemanticModel(tree); 36125var model = compilation.GetSemanticModel(tree); 40796var model = comp.GetSemanticModel(tree); 40831var model = comp.GetSemanticModel(tree); 40868var model = comp.GetSemanticModel(tree); 40905var model = comp.GetSemanticModel(tree); 40942var model = comp.GetSemanticModel(tree); 40979var model = comp.GetSemanticModel(tree); 41022var model = comp.GetSemanticModel(tree); 44900var model = comp.GetSemanticModel(tree); 44956var model = comp.GetSemanticModel(tree); 45003var model = comp.GetSemanticModel(tree); 45055var model = comp.GetSemanticModel(tree);
Semantics\ExtensionOperatorsTests.cs (127)
688var model = comp2.GetSemanticModel(tree); 787var model = comp.GetSemanticModel(tree); 835var model = comp.GetSemanticModel(tree); 906var model = comp.GetSemanticModel(tree); 967var model = comp.GetSemanticModel(tree); 1035var model = comp.GetSemanticModel(tree); 1745var model = comp.GetSemanticModel(tree); 2178var model = comp2.GetSemanticModel(tree); 3282var model = comp.GetSemanticModel(tree); 3340var model = comp.GetSemanticModel(tree); 3909var model = comp.GetSemanticModel(tree); 3950var model = comp.GetSemanticModel(tree); 3990var model = comp.GetSemanticModel(tree); 4037var model = comp.GetSemanticModel(tree); 4268var model = comp.GetSemanticModel(tree); 4766var model = comp2.GetSemanticModel(tree); 4884var model = comp2.GetSemanticModel(tree); 5056var model = comp.GetSemanticModel(tree); 5110var model = comp.GetSemanticModel(tree); 5158var model = comp.GetSemanticModel(tree); 5206var model = comp.GetSemanticModel(tree); 5255var model = comp.GetSemanticModel(tree); 5303var model = comp.GetSemanticModel(tree); 5352var model = comp.GetSemanticModel(tree); 5403var model = comp.GetSemanticModel(tree); 5458var model = comp.GetSemanticModel(tree); 5572var model = comp.GetSemanticModel(tree); 5644var model = comp.GetSemanticModel(tree); 5715var model = comp.GetSemanticModel(tree); 5786var model = comp.GetSemanticModel(tree); 5848var model = comp.GetSemanticModel(tree); 5911var model = comp.GetSemanticModel(tree); 5976var model = comp.GetSemanticModel(tree); 6046var model = comp.GetSemanticModel(tree); 6114var model = comp.GetSemanticModel(tree); 6188var model = comp.GetSemanticModel(tree); 7660var model = comp.GetSemanticModel(tree); 7742var model = comp.GetSemanticModel(tree); 8386var model = comp2.GetSemanticModel(tree); 8457var model = comp2.GetSemanticModel(tree); 9013var model = comp.GetSemanticModel(tree); 9071var model = comp.GetSemanticModel(tree); 9707var model = comp.GetSemanticModel(tree); 9766var model = comp.GetSemanticModel(tree); 10193var model = comp.GetSemanticModel(tree); 10234var model = comp.GetSemanticModel(tree); 10277var model = comp.GetSemanticModel(tree); 10320var model = comp.GetSemanticModel(tree); 10483var model = comp.GetSemanticModel(tree); 10542var model = comp.GetSemanticModel(tree); 11558var model = comp2.GetSemanticModel(tree); 11657var model = comp.GetSemanticModel(tree); 11705var model = comp.GetSemanticModel(tree); 11776var model = comp.GetSemanticModel(tree); 11837var model = comp.GetSemanticModel(tree); 11905var model = comp.GetSemanticModel(tree); 13262var model = comp.GetSemanticModel(tree); 13800var model = comp2.GetSemanticModel(tree); 14126var model = comp.GetSemanticModel(tree); 14889var model = comp.GetSemanticModel(tree); 14939var model = comp.GetSemanticModel(tree); 15109var model = comp.GetSemanticModel(tree); 15176var model = comp.GetSemanticModel(tree); 15301var model = comp.GetSemanticModel(tree); 16096var model = comp.GetSemanticModel(tree); 16147var model = comp.GetSemanticModel(tree); 17252var model = comp.GetSemanticModel(tree); 17392var model = comp.GetSemanticModel(tree); 17824var model = comp.GetSemanticModel(tree); 17897var model = comp.GetSemanticModel(tree); 18360var model = comp.GetSemanticModel(tree); 18410var model = comp.GetSemanticModel(tree); 18903var model = comp2.GetSemanticModel(tree); 19030var model = comp2.GetSemanticModel(tree); 19134var model = comp2.GetSemanticModel(tree); 19194var model = comp2.GetSemanticModel(tree); 19255var model = comp2.GetSemanticModel(tree); 19294var model = comp2.GetSemanticModel(tree); 19337var model = comp2.GetSemanticModel(tree); 19391var model = comp.GetSemanticModel(tree); 19436var model = comp.GetSemanticModel(tree); 19876var model = comp.GetSemanticModel(tree); 19931var model = comp.GetSemanticModel(tree); 20385var model = comp2.GetSemanticModel(tree); 20512var model = comp2.GetSemanticModel(tree); 20692var model = comp.GetSemanticModel(tree); 20746var model = comp.GetSemanticModel(tree); 20794var model = comp.GetSemanticModel(tree); 20842var model = comp.GetSemanticModel(tree); 20891var model = comp.GetSemanticModel(tree); 20939var model = comp.GetSemanticModel(tree); 20988var model = comp.GetSemanticModel(tree); 21039var model = comp.GetSemanticModel(tree); 21094var model = comp.GetSemanticModel(tree); 21208var model = comp.GetSemanticModel(tree); 21280var model = comp.GetSemanticModel(tree); 21351var model = comp.GetSemanticModel(tree); 21422var model = comp.GetSemanticModel(tree); 21484var model = comp.GetSemanticModel(tree); 21547var model = comp.GetSemanticModel(tree); 21612var model = comp.GetSemanticModel(tree); 21682var model = comp.GetSemanticModel(tree); 21750var model = comp.GetSemanticModel(tree); 21824var model = comp.GetSemanticModel(tree); 23809var model = comp.GetSemanticModel(tree); 23891var model = comp.GetSemanticModel(tree); 25872var model = comp.GetSemanticModel(tree); 25972var model = comp.GetSemanticModel(tree); 26456var model = comp.GetSemanticModel(tree); 26511var model = comp.GetSemanticModel(tree); 26953var model = comp.GetSemanticModel(tree); 26998var model = comp.GetSemanticModel(tree); 27376var model = comp.GetSemanticModel(tree); 27431var model = comp.GetSemanticModel(tree); 27480var model = comp.GetSemanticModel(tree); 27535var model = comp.GetSemanticModel(tree); 27700var model = comp.GetSemanticModel(tree); 27734var model = comp.GetSemanticModel(tree); 27779var model = comp.GetSemanticModel(tree); 27867var model = comp.GetSemanticModel(tree); 27994var model = comp.GetSemanticModel(tree); 28084var model = comp.GetSemanticModel(tree); 28286var model = comp.GetSemanticModel(tree); 28449var model = comp.GetSemanticModel(tree); 28616var model = comp.GetSemanticModel(tree); 28743var model = comp.GetSemanticModel(tree); 29041var model = comp.GetSemanticModel(tree);
Semantics\ExtensionTests.cs (467)
148var model = comp.GetSemanticModel(tree); 249var model = comp.GetSemanticModel(tree); 337var model = comp.GetSemanticModel(tree); 371var model = comp.GetSemanticModel(tree); 398var model = comp.GetSemanticModel(tree); 428var model = comp.GetSemanticModel(tree); 458var model = comp.GetSemanticModel(tree); 487var model = comp.GetSemanticModel(tree); 518var model = comp.GetSemanticModel(tree); 542var model = comp.GetSemanticModel(tree); 647var model = comp.GetSemanticModel(tree); 678var model = comp.GetSemanticModel(tree); 719var model = comp.GetSemanticModel(tree); 772var model = comp.GetSemanticModel(tree); 888var model = comp.GetSemanticModel(tree); 916var model1 = comp.GetSemanticModel(tree1); 925var model2 = comp.GetSemanticModel(tree2); 950var model = comp.GetSemanticModel(tree); 977var model = comp.GetSemanticModel(tree); 1281var model = comp.GetSemanticModel(tree); 1458var model = comp.GetSemanticModel(tree); 1632var model = comp.GetSemanticModel(tree); 1656var model = comp.GetSemanticModel(tree); 1689var model = comp.GetSemanticModel(tree); 1718var model = comp.GetSemanticModel(tree); 1746var model = comp.GetSemanticModel(tree); 1785var model = comp.GetSemanticModel(tree); 1877var model = comp.GetSemanticModel(tree); 1905var model = comp.GetSemanticModel(tree); 1992var model = comp.GetSemanticModel(tree); 2171var model = comp.GetSemanticModel(tree); 2204var model = comp.GetSemanticModel(tree); 2359var model = comp.GetSemanticModel(tree); 2386var model = comp.GetSemanticModel(tree); 2420var model = comp.GetSemanticModel(tree); 2491var model = comp.GetSemanticModel(tree); 2526var model = comp.GetSemanticModel(tree); 2580var model = comp.GetSemanticModel(tree); 2608var model = comp.GetSemanticModel(tree); 2642var model = comp.GetSemanticModel(tree); 2668var model = comp.GetSemanticModel(tree); 2725var model = comp.GetSemanticModel(tree); 2742var model = comp.GetSemanticModel(tree); 2758var model = comp.GetSemanticModel(tree); 2781var model = comp.GetSemanticModel(tree); 2826var model = comp.GetSemanticModel(tree); 2848var model = comp.GetSemanticModel(tree); 2877var model = comp.GetSemanticModel(tree); 2925var model = comp.GetSemanticModel(tree); 2949var model = comp.GetSemanticModel(tree); 2975var model = comp.GetSemanticModel(tree); 3317var model = comp.GetSemanticModel(tree); 3379var model = comp.GetSemanticModel(tree); 3401var model = comp.GetSemanticModel(tree); 3564var model = comp.GetSemanticModel(tree); 3692var model = comp.GetSemanticModel(tree); 3939var model = comp.GetSemanticModel(tree); 4242var model = comp.GetSemanticModel(tree); 4347var model = comp.GetSemanticModel(tree); 4976var model = comp.GetSemanticModel(tree); 5007var model = comp.GetSemanticModel(tree); 5051var model = comp.GetSemanticModel(tree); 12291var model = comp.GetSemanticModel(tree); 12317var model = comp.GetSemanticModel(tree); 12379var model = comp.GetSemanticModel(tree); 12432var model = comp.GetSemanticModel(tree); 12467var model = comp.GetSemanticModel(tree); 12503var model = comp.GetSemanticModel(tree); 12640var model = comp.GetSemanticModel(tree); 12725var model = comp.GetSemanticModel(tree); 12765var model = comp.GetSemanticModel(tree); 12871var model = comp.GetSemanticModel(tree); 12927var model = comp.GetSemanticModel(tree); 12977var model = comp.GetSemanticModel(tree); 13016var model = comp.GetSemanticModel(tree); 13047var model = comp.GetSemanticModel(tree); 13079var model = comp.GetSemanticModel(tree); 13115var model = comp.GetSemanticModel(tree); 13153var model = comp.GetSemanticModel(tree); 13186var model = comp.GetSemanticModel(tree); 13228var model = comp.GetSemanticModel(tree); 13263var model = comp.GetSemanticModel(tree); 13289var model = comp.GetSemanticModel(tree); 13319var model = comp.GetSemanticModel(tree); 13349var model = comp.GetSemanticModel(tree); 13383var model = comp.GetSemanticModel(tree); 13416var model = comp.GetSemanticModel(tree); 13447var model = comp.GetSemanticModel(tree); 13506var model = comp.GetSemanticModel(tree); 13533var model = comp.GetSemanticModel(tree); 13566var model = comp.GetSemanticModel(tree); 13594var model = comp.GetSemanticModel(tree); 13624var model = comp.GetSemanticModel(tree); 13654var model = comp.GetSemanticModel(tree); 13681var model = comp.GetSemanticModel(tree); 13779var model = comp.GetSemanticModel(tree); 13802var model = comp.GetSemanticModel(tree); 13830var model = comp.GetSemanticModel(tree); 13862var model = comp.GetSemanticModel(tree); 13919var model = comp.GetSemanticModel(tree); 13952var model = comp.GetSemanticModel(tree); 13996var model = comp.GetSemanticModel(tree); 14041var model = comp.GetSemanticModel(tree); 14288var model = comp.GetSemanticModel(tree); 14332var model = comp.GetSemanticModel(tree); 14369var model = comp.GetSemanticModel(tree); 14406var model = comp.GetSemanticModel(tree); 14443var model = comp.GetSemanticModel(tree); 14480var model = comp.GetSemanticModel(tree); 14512var model = comp.GetSemanticModel(tree); 14550var model = comp.GetSemanticModel(tree); 14576var model = comp.GetSemanticModel(tree); 14602var model = comp.GetSemanticModel(tree); 14628var model = comp.GetSemanticModel(tree); 14663var model = comp.GetSemanticModel(tree); 14713var model = comp.GetSemanticModel(tree); 14744var model = comp.GetSemanticModel(tree); 14775var model = comp.GetSemanticModel(tree); 14805var model = comp.GetSemanticModel(tree); 14835var model = comp.GetSemanticModel(tree); 14881var model = comp.GetSemanticModel(tree); 14913var model = comp.GetSemanticModel(tree); 14992var model = comp.GetSemanticModel(tree); 15034var model = comp.GetSemanticModel(tree); 15106var model = comp.GetSemanticModel(tree); 15172var model = comp.GetSemanticModel(tree); 15207var model = comp.GetSemanticModel(tree); 15253var model = comp.GetSemanticModel(tree); 15285var model = comp.GetSemanticModel(tree); 15312var model = comp.GetSemanticModel(tree); 15340var model = comp.GetSemanticModel(tree); 15367var model = comp.GetSemanticModel(tree); 15429var model = comp.GetSemanticModel(tree); 15459var model = comp.GetSemanticModel(tree); 15511var model = comp.GetSemanticModel(tree); 15586var model = comp.GetSemanticModel(tree); 15625var model = comp.GetSemanticModel(tree); 15661var model = comp.GetSemanticModel(tree); 15718var model = comp.GetSemanticModel(tree); 15745var model = comp.GetSemanticModel(tree); 16055var model = comp.GetSemanticModel(tree); 16081var model = comp.GetSemanticModel(tree); 16144var model = comp.GetSemanticModel(tree); 16224var model = comp.GetSemanticModel(tree); 16337var model = comp.GetSemanticModel(tree); 16360var model = comp.GetSemanticModel(tree); 16387var model = comp.GetSemanticModel(tree); 16414var model = comp.GetSemanticModel(tree); 16440var model = comp.GetSemanticModel(tree); 16465var model = comp.GetSemanticModel(tree); 16492var model = comp.GetSemanticModel(tree); 16565var model = comp.GetSemanticModel(tree); 16593var model = comp.GetSemanticModel(tree); 16622var model = comp.GetSemanticModel(tree); 16649var model = comp.GetSemanticModel(tree); 16677var model = comp.GetSemanticModel(tree); 16780var model = comp.GetSemanticModel(tree); 16898var model = comp.GetSemanticModel(tree); 16925var model = comp.GetSemanticModel(tree); 16950var model = comp.GetSemanticModel(tree); 16974var model = comp.GetSemanticModel(tree); 16999var model = comp.GetSemanticModel(tree); 17022var model = comp.GetSemanticModel(tree); 17047var model = comp.GetSemanticModel(tree); 17284var model = comp.GetSemanticModel(tree); 17313var model = comp.GetSemanticModel(tree); 17345var model = comp.GetSemanticModel(tree); 17368var model = comp.GetSemanticModel(tree); 17392var model = comp.GetSemanticModel(tree); 17417var model = comp.GetSemanticModel(tree); 17441var model = comp.GetSemanticModel(tree); 17466var model = comp.GetSemanticModel(tree); 17495var model = comp.GetSemanticModel(tree); 17528var model = comp.GetSemanticModel(tree); 17557var model = comp.GetSemanticModel(tree); 17585var model = comp.GetSemanticModel(tree); 17614var model = comp.GetSemanticModel(tree); 17641var model = comp.GetSemanticModel(tree); 17674var model = comp.GetSemanticModel(tree); 17784var model = comp.GetSemanticModel(tree); 17820var model = comp.GetSemanticModel(tree); 17857var model = comp.GetSemanticModel(tree); 17884var model = comp.GetSemanticModel(tree); 17920var model = comp.GetSemanticModel(tree); 17968var model = comp.GetSemanticModel(tree); 18001var model = comp.GetSemanticModel(tree); 18029var model = comp.GetSemanticModel(tree); 18057var model = comp.GetSemanticModel(tree); 18085var model = comp.GetSemanticModel(tree); 18113var model = comp.GetSemanticModel(tree); 18141var model = comp.GetSemanticModel(tree); 18178var model = comp.GetSemanticModel(tree); 18208var model = comp.GetSemanticModel(tree); 18282var model = comp.GetSemanticModel(tree); 18311var model = comp.GetSemanticModel(tree); 18336var model = comp.GetSemanticModel(tree); 18424var model = comp.GetSemanticModel(tree); 18470var model = comp.GetSemanticModel(tree); 18496var model = comp.GetSemanticModel(tree); 18523var model = comp.GetSemanticModel(tree); 18561var model = comp.GetSemanticModel(tree); 18599var model = comp.GetSemanticModel(tree); 18638var model = comp.GetSemanticModel(tree); 18679var model = comp.GetSemanticModel(tree); 18720var model = comp.GetSemanticModel(tree); 18764var model = comp.GetSemanticModel(tree); 18808var model = comp.GetSemanticModel(tree); 18847var model = comp.GetSemanticModel(tree); 18886var model = comp.GetSemanticModel(tree); 18925var model = comp.GetSemanticModel(tree); 18963var model = comp.GetSemanticModel(tree); 19010var model = comp.GetSemanticModel(tree); 19042var model = comp.GetSemanticModel(tree); 19074var model = comp.GetSemanticModel(tree); 19124var model = comp.GetSemanticModel(tree); 19158var model = comp.GetSemanticModel(tree); 19190var model = comp.GetSemanticModel(tree); 19228var model = comp.GetSemanticModel(tree); 19265var model = comp.GetSemanticModel(tree); 19298var model = comp.GetSemanticModel(tree); 19348var model = comp.GetSemanticModel(tree); 19395var model = comp.GetSemanticModel(tree); 19423var model = comp.GetSemanticModel(tree); 19453var model = comp.GetSemanticModel(tree); 19480var model = comp.GetSemanticModel(tree); 19507var model = comp.GetSemanticModel(tree); 19540var model = comp.GetSemanticModel(tree); 19586var model = comp.GetSemanticModel(tree); 19614var model = comp.GetSemanticModel(tree); 19648var model = comp.GetSemanticModel(tree); 19678var model = comp.GetSemanticModel(tree); 19793var model = comp.GetSemanticModel(tree); 19894var model = comp.GetSemanticModel(tree); 20023var model = comp.GetSemanticModel(tree); 20055var model = comp.GetSemanticModel(tree); 20080var model = comp.GetSemanticModel(tree); 20268var model = comp.GetSemanticModel(tree); 20335var model = comp.GetSemanticModel(tree); 20377var model = comp.GetSemanticModel(tree); 20425var model = comp.GetSemanticModel(tree); 20470var model = comp.GetSemanticModel(tree); 20507var model = comp.GetSemanticModel(tree); 20555var model = comp.GetSemanticModel(tree); 20603var model = comp.GetSemanticModel(tree); 20653var model = comp.GetSemanticModel(tree); 20703var model = comp.GetSemanticModel(tree); 20757var model = comp.GetSemanticModel(tree); 20811var model = comp.GetSemanticModel(tree); 20865var model = comp.GetSemanticModel(tree); 20913var model = comp.GetSemanticModel(tree); 20961var model = comp.GetSemanticModel(tree); 21001var model = comp.GetSemanticModel(tree); 21041var model = comp.GetSemanticModel(tree); 21084var model = comp.GetSemanticModel(tree); 21124var model = comp.GetSemanticModel(tree); 21167var model = comp.GetSemanticModel(tree); 21298var model = comp.GetSemanticModel(tree); 21360var model = comp.GetSemanticModel(tree); 21415var model = comp.GetSemanticModel(tree); 21457var model = comp.GetSemanticModel(tree); 21718var model = comp.GetSemanticModel(tree); 21881var model = comp.GetSemanticModel(tree); 23891var model = comp.GetSemanticModel(tree); 23945var model = comp.GetSemanticModel(tree); 24122var model = comp.GetSemanticModel(tree); 24686var model = comp.GetSemanticModel(tree); 24719var model = comp.GetSemanticModel(tree); 24750var model = comp.GetSemanticModel(tree); 24778var model = comp.GetSemanticModel(tree); 24806var model = comp.GetSemanticModel(tree); 24832var model = comp.GetSemanticModel(tree); 24859var model = comp.GetSemanticModel(tree); 24891var model = comp.GetSemanticModel(tree); 24928var model = comp.GetSemanticModel(tree); 24958var model = comp.GetSemanticModel(tree); 24985var model = comp.GetSemanticModel(tree); 25023var model = comp.GetSemanticModel(tree); 25060var model = comp.GetSemanticModel(tree); 25101var model = comp.GetSemanticModel(tree); 25138var model = comp.GetSemanticModel(tree); 25174var model = comp.GetSemanticModel(tree); 25211var model = comp.GetSemanticModel(tree); 25386var model = comp.GetSemanticModel(tree); 25433var model = comp.GetSemanticModel(tree); 25468var model = comp.GetSemanticModel(tree); 25498var model = comp.GetSemanticModel(tree); 25528var model = comp.GetSemanticModel(tree); 25577var model = comp.GetSemanticModel(tree); 25624var model = comp.GetSemanticModel(tree); 25656var model = comp.GetSemanticModel(tree); 25683var model = comp.GetSemanticModel(tree); 25801var model = comp.GetSemanticModel(tree); 25836var model = comp.GetSemanticModel(tree); 25894var model = comp.GetSemanticModel(tree); 25933var model = comp.GetSemanticModel(tree); 25983var model = comp.GetSemanticModel(tree); 27651var model = comp.GetSemanticModel(tree); 28095var model = comp.GetSemanticModel(tree); 28218var model = comp.GetSemanticModel(tree); 28372var model = comp.GetSemanticModel(tree); 28913var model = comp.GetSemanticModel(tree); 28942var model = comp.GetSemanticModel(tree); 28977var model = comp.GetSemanticModel(tree); 29012var model = comp.GetSemanticModel(tree); 29040var model = comp.GetSemanticModel(tree); 29092var model = comp.GetSemanticModel(tree); 29132var model = comp.GetSemanticModel(tree); 29165var model = comp.GetSemanticModel(tree); 29259var model = comp.GetSemanticModel(tree); 29292var model = comp.GetSemanticModel(tree); 29322var model = comp.GetSemanticModel(tree); 29350var model = comp.GetSemanticModel(tree); 29378var model = comp.GetSemanticModel(tree); 29408var model = comp.GetSemanticModel(tree); 29462var model = comp.GetSemanticModel(tree); 29491var model = comp.GetSemanticModel(tree); 29520var model = comp.GetSemanticModel(tree); 29548var model = comp.GetSemanticModel(tree); 29604var model = comp.GetSemanticModel(tree); 29721var model = comp.GetSemanticModel(tree); 29762var model = comp.GetSemanticModel(tree); 30043var model = comp.GetSemanticModel(tree); 30066var model = comp.GetSemanticModel(tree); 33826var model = comp.GetSemanticModel(tree); 33853var model = comp.GetSemanticModel(tree); 33880var model = comp.GetSemanticModel(tree); 33907var model = comp.GetSemanticModel(tree); 33934var model = comp.GetSemanticModel(tree); 33981var model = comp.GetSemanticModel(tree); 34011var model = comp.GetSemanticModel(tree); 34057var model = comp.GetSemanticModel(tree); 34082var model = comp.GetSemanticModel(tree); 34113var model = comp.GetSemanticModel(tree); 34141var model = comp.GetSemanticModel(tree); 34170var model = comp.GetSemanticModel(tree); 34249var model = comp.GetSemanticModel(tree); 34292var model = comp.GetSemanticModel(tree); 34323var model = comp.GetSemanticModel(tree); 34359var model = comp.GetSemanticModel(tree); 34417var model = comp.GetSemanticModel(tree); 34463var model = comp.GetSemanticModel(tree); 34598var model = comp.GetSemanticModel(tree); 34638var model = comp.GetSemanticModel(tree); 34674var model = comp.GetSemanticModel(tree); 34723var model = comp.GetSemanticModel(tree); 34772var model = comp.GetSemanticModel(tree); 34861var model = comp.GetSemanticModel(tree); 34894var model = comp.GetSemanticModel(tree); 34924var model = comp.GetSemanticModel(tree); 34955var model = comp.GetSemanticModel(tree); 34986var model = comp.GetSemanticModel(tree); 35020var model = comp.GetSemanticModel(tree); 35081var model = comp.GetSemanticModel(tree); 35115var model = comp.GetSemanticModel(tree); 35148var model = comp.GetSemanticModel(tree); 35486var model = comp.GetSemanticModel(tree); 35520var model = comp.GetSemanticModel(tree); 35544var model = comp.GetSemanticModel(tree); 35598var model = comp.GetSemanticModel(tree); 35788var model = comp.GetSemanticModel(tree); 35818var model = comp.GetSemanticModel(tree); 35858var model = comp.GetSemanticModel(tree); 35890var model = comp.GetSemanticModel(tree); 35923var model = comp.GetSemanticModel(tree); 36174var model = comp.GetSemanticModel(tree); 36200var model = comp.GetSemanticModel(tree); 36287var model = comp.GetSemanticModel(tree); 36318var model = comp.GetSemanticModel(tree); 36349var model = comp.GetSemanticModel(tree); 36380var model = comp.GetSemanticModel(tree); 36411var model = comp.GetSemanticModel(tree); 36446var model = comp.GetSemanticModel(tree); 36481var model = comp.GetSemanticModel(tree); 36565var model = comp.GetSemanticModel(tree); 36614var model = comp.GetSemanticModel(tree); 36649var model = comp.GetSemanticModel(tree); 36680var model = comp.GetSemanticModel(tree); 36714var model = comp.GetSemanticModel(tree); 36752var model = comp.GetSemanticModel(tree); 36889var model = comp.GetSemanticModel(tree); 36948var model = comp.GetSemanticModel(tree); 37445var model = comp.GetSemanticModel(tree); 37475var model = comp.GetSemanticModel(tree); 37506var model = comp.GetSemanticModel(tree); 37534var model = comp.GetSemanticModel(tree); 37561var model = comp.GetSemanticModel(tree); 37608var model = comp.GetSemanticModel(tree); 37631var model = comp.GetSemanticModel(tree); 37660var model = comp.GetSemanticModel(tree); 37701var model = comp.GetSemanticModel(tree); 37737var model = comp.GetSemanticModel(tree); 37757var model = comp.GetSemanticModel(tree); 37817var model = comp.GetSemanticModel(tree); 37881var model = comp.GetSemanticModel(tree); 37914var model = comp.GetSemanticModel(tree); 37953var model = comp.GetSemanticModel(tree); 37985var model = comp.GetSemanticModel(tree); 38026var model = comp.GetSemanticModel(tree); 38057var model = comp.GetSemanticModel(tree); 38088var model = comp.GetSemanticModel(tree); 38112var model = comp.GetSemanticModel(tree); 38146var model = comp.GetSemanticModel(tree); 38177var model = comp.GetSemanticModel(tree); 38211var model = comp.GetSemanticModel(tree); 38248var model = comp.GetSemanticModel(tree); 38284var model = comp.GetSemanticModel(tree); 38324var model = comp.GetSemanticModel(tree); 38360var model = comp.GetSemanticModel(tree); 38396var model = comp.GetSemanticModel(tree); 38432var model = comp.GetSemanticModel(tree); 38460var model = comp.GetSemanticModel(tree); 38484var model = comp.GetSemanticModel(tree); 38515var model = comp.GetSemanticModel(tree); 38546var model = comp.GetSemanticModel(tree); 38583var model = comp.GetSemanticModel(tree); 38609var model = comp.GetSemanticModel(tree); 38634var model = comp.GetSemanticModel(tree); 38660var model = comp.GetSemanticModel(tree); 38714var model = comp.GetSemanticModel(tree); 38752var model = comp.GetSemanticModel(tree); 38781var model = comp.GetSemanticModel(tree); 38811var model = comp.GetSemanticModel(tree); 38841var model = comp.GetSemanticModel(tree); 38863var model = comp.GetSemanticModel(tree); 38896var model = comp.GetSemanticModel(tree); 38930var model = comp.GetSemanticModel(tree); 38963var model = comp.GetSemanticModel(tree); 39006var model = comp.GetSemanticModel(tree); 39131var model = comp.GetSemanticModel(tree); 39764var model = comp.GetSemanticModel(tree); 39822var model = comp.GetSemanticModel(tree); 40345var model = comp.GetSemanticModel(tree); 40371var model = comp.GetSemanticModel(tree); 40394var model = comp.GetSemanticModel(tree); 40420var model = comp.GetSemanticModel(tree); 40444var model = comp.GetSemanticModel(tree); 40470var model = comp.GetSemanticModel(tree); 40496var model = comp.GetSemanticModel(tree); 40520var model = comp.GetSemanticModel(tree); 40545var model = comp.GetSemanticModel(tree); 40589var model = comp.GetSemanticModel(tree); 40630var model = comp.GetSemanticModel(tree); 40745var model = comp.GetSemanticModel(tree); 40817var model = comp.GetSemanticModel(tree); 46137var model = comp.GetSemanticModel(tree); 46185var model = comp.GetSemanticModel(tree); 46226var model = comp.GetSemanticModel(tree); 46265var model = comp.GetSemanticModel(tree); 46490var model = comp.GetSemanticModel(tree); 46531var model = comp.GetSemanticModel(tree); 46597var model = comp.GetSemanticModel(tree); 46733var model = comp.GetSemanticModel(tree); 46780var model = comp.GetSemanticModel(tree); 46833var model = comp.GetSemanticModel(tree); 46888var model = comp.GetSemanticModel(tree); 46932var model = comp.GetSemanticModel(tree); 47255var model = comp.GetSemanticModel(tree); 47297var model = comp.GetSemanticModel(tree); 48980var model = comp.GetSemanticModel(tree); 49241var model = comp.GetSemanticModel(tree); 49274var model = comp.GetSemanticModel(tree); 50422var model = comp.GetSemanticModel(tree); 50426private static IEnumerable<string> PrintXmlNameSymbols(SyntaxTree tree, SemanticModel model) 50442internal static IEnumerable<string> PrintXmlCrefSymbols(SyntaxTree tree, SemanticModel model) 51634var model = comp.GetSemanticModel(tree); 51721var model = comp.GetSemanticModel(tree); 51746var model = comp.GetSemanticModel(tree);
Semantics\ExtensionTests2.cs (60)
1377var model = comp.GetSemanticModel(tree); 1456var model = comp.GetSemanticModel(tree); 1492var model = comp.GetSemanticModel(tree); 3116var model = comp.GetSemanticModel(tree); 5082var model = comp.GetSemanticModel(tree); 5122var model = comp.GetSemanticModel(tree); 5176var model = comp.GetSemanticModel(tree); 5212var model = comp.GetSemanticModel(tree); 5256var model = comp.GetSemanticModel(tree); 5296var model = comp.GetSemanticModel(tree); 5331var model = comp.GetSemanticModel(tree); 5367var model = comp.GetSemanticModel(tree); 5400var model = comp.GetSemanticModel(tree); 5436var model = comp.GetSemanticModel(tree); 5465var model = comp.GetSemanticModel(tree); 5498var model = comp.GetSemanticModel(tree); 5531var model = comp.GetSemanticModel(tree); 5560var model = comp.GetSemanticModel(tree); 5592var model = comp.GetSemanticModel(tree); 5621var model = comp.GetSemanticModel(tree); 5651var model = comp.GetSemanticModel(tree); 5683var model = comp.GetSemanticModel(tree); 5719var model = comp.GetSemanticModel(tree); 5752var model = comp.GetSemanticModel(tree); 5781var model = comp.GetSemanticModel(tree); 5810var model = comp.GetSemanticModel(tree); 5840var model = comp.GetSemanticModel(tree); 5876var model = comp.GetSemanticModel(tree); 5903var model = comp.GetSemanticModel(tree); 5938var model = comp.GetSemanticModel(tree); 5973var model = comp.GetSemanticModel(tree); 6016var model = comp.GetSemanticModel(tree); 6051var model = comp.GetSemanticModel(tree); 6085var model = comp.GetSemanticModel(tree); 6147var model = comp.GetSemanticModel(tree); 6217var model = comp.GetSemanticModel(tree); 6245var model = comp.GetSemanticModel(tree); 6300var model = comp.GetSemanticModel(tree); 6336var model = comp.GetSemanticModel(tree); 6373var model = comp.GetSemanticModel(tree); 6410var model = comp.GetSemanticModel(tree); 6525var model = comp.GetSemanticModel(tree); 6654var model = comp.GetSemanticModel(tree); 6675var model = comp.GetSemanticModel(tree); 6713var model = comp.GetSemanticModel(tree); 6777var model = comp.GetSemanticModel(tree); 6915var model = comp.GetSemanticModel(tree); 6939var model = comp.GetSemanticModel(tree); 6964var model = comp.GetSemanticModel(tree); 7077var model = comp.GetSemanticModel(tree); 7124var model = comp.GetSemanticModel(tree); 30646var model = comp.GetSemanticModel(tree); 32291var model = comp.GetSemanticModel(tree); 33710var model = comp.GetSemanticModel(tree); 33838var model = comp.GetSemanticModel(tree); 33865var model = comp.GetSemanticModel(tree); 33894var model = comp.GetSemanticModel(tree); 33989var model = comp.GetSemanticModel(tree); 34094var model = comp.GetSemanticModel(tree); 34974var model = comp.GetSemanticModel(tree);
Semantics\InlineArrayTests.cs (16)
2357var model = comp.GetSemanticModel(tree); 2392var model = comp.GetSemanticModel(tree); 2426var model = comp.GetSemanticModel(tree); 2506var model = comp.GetSemanticModel(tree); 6031var model = comp.GetSemanticModel(tree); 6197var model = comp.GetSemanticModel(tree); 8121var model = comp.GetSemanticModel(tree); 8839var model = comp.GetSemanticModel(tree); 9207var model = comp.GetSemanticModel(tree); 10551var model = comp.GetSemanticModel(tree); 11295var model = comp.GetSemanticModel(tree); 15212var model = comp.GetSemanticModel(tree); 16499var model = comp.GetSemanticModel(tree); 18587var model = comp.GetSemanticModel(tree); 18913var model = comp.GetSemanticModel(tree); 19250var model = comp.GetSemanticModel(tree);
Semantics\LockTests.cs (1)
181var model = compilation.GetSemanticModel(tree);
Semantics\OutVarTests.cs (470)
57var model = compilation.GetSemanticModel(tree); 101var model = compilation.GetSemanticModel(tree); 217var model = compilation.GetSemanticModel(tree); 270var model = compilation.GetSemanticModel(tree); 333var model = compilation.GetSemanticModel(tree); 906var model = compilation.GetSemanticModel(tree); 917private static void VerifyModelForOutVarWithoutDataFlow(SemanticModel model, DeclarationExpressionSyntax decl, params IdentifierNameSyntax[] references) 922private static void VerifyModelForOutVarWithoutDataFlow(SemanticModel model, DeclarationExpressionSyntax decl, bool isShadowed, params IdentifierNameSyntax[] references) 927private static void VerifyModelForDeclarationVarWithoutDataFlow(SemanticModel model, DeclarationExpressionSyntax decl, params IdentifierNameSyntax[] references) 932internal static void VerifyModelForOutVar(SemanticModel model, DeclarationExpressionSyntax decl, params IdentifierNameSyntax[] references) 937private static void VerifyModelForOutVarInNotExecutableCode(SemanticModel model, DeclarationExpressionSyntax decl, params IdentifierNameSyntax[] references) 943SemanticModel model, 953SemanticModel model, 1002SemanticModel model, 1069private static void AssertTypeFromOperation(SemanticModel model, ITypeSymbol expectedType, DeclarationExpressionSyntax decl) 1086private static void VerifyDataFlow(SemanticModel model, DeclarationExpressionSyntax decl, bool isDelegateCreation, bool isExecutableCode, IdentifierNameSyntax[] references, ISymbol symbol) 1135private static void VerifyModelForOutVarDuplicateInSameScope(SemanticModel model, DeclarationExpressionSyntax decl) 1151private static void VerifyNotInScope(SemanticModel model, IdentifierNameSyntax reference) 1158private static void VerifyNotAnOutField(SemanticModel model, IdentifierNameSyntax reference) 1168internal static void VerifyNotAnOutLocal(SemanticModel model, IdentifierNameSyntax reference) 1403var model = compilation.GetSemanticModel(tree); 1461var model = compilation.GetSemanticModel(tree); 1495var model = compilation.GetSemanticModel(tree); 1530var model = compilation.GetSemanticModel(tree); 1564var model = compilation.GetSemanticModel(tree); 1598var model = compilation.GetSemanticModel(tree); 1638var model = compilation.GetSemanticModel(tree); 1676var model = compilation.GetSemanticModel(tree); 1713var model = compilation.GetSemanticModel(tree); 1749var model = compilation.GetSemanticModel(tree); 1882var model = compilation.GetSemanticModel(tree); 2003var model = compilation.GetSemanticModel(tree); 2113var model = compilation.GetSemanticModel(tree); 2224var model = compilation.GetSemanticModel(tree); 2334var model = compilation.GetSemanticModel(tree); 2636var model = compilation.GetSemanticModel(tree); 2853var model = compilation.GetSemanticModel(tree); 2948var model = compilation.GetSemanticModel(tree); 3200var model = compilation.GetSemanticModel(tree); 3302var model = compilation.GetSemanticModel(tree); 3374var model = compilation.GetSemanticModel(tree); 3426var model = compilation.GetSemanticModel(tree); 3460var model = compilation.GetSemanticModel(tree); 3501var model = compilation.GetSemanticModel(tree); 3642var model = compilation.GetSemanticModel(tree); 3863var model = compilation.GetSemanticModel(tree); 3960var model = compilation.GetSemanticModel(tree); 3996var model = compilation.GetSemanticModel(tree); 4051var model = compilation.GetSemanticModel(tree); 4095var model = compilation.GetSemanticModel(tree); 4146var model = compilation.GetSemanticModel(tree); 4206var model = compilation.GetSemanticModel(tree); 4272var model = compilation.GetSemanticModel(tree); 4495var model = compilation.GetSemanticModel(tree); 4674var model = compilation.GetSemanticModel(tree); 4915var model = compilation.GetSemanticModel(tree); 5017var model = compilation.GetSemanticModel(tree); 5064var model = compilation.GetSemanticModel(tree); 5102var model = compilation.GetSemanticModel(tree); 5179var model = compilation.GetSemanticModel(tree); 5282var model = compilation.GetSemanticModel(tree); 5409var model = compilation.GetSemanticModel(tree); 5511var model = compilation.GetSemanticModel(tree); 5575var model = compilation.GetSemanticModel(tree); 5707var model = compilation.GetSemanticModel(tree); 5747var model = compilation.GetSemanticModel(tree); 5908var model = compilation.GetSemanticModel(tree); 6049var model = compilation.GetSemanticModel(tree); 6326var model = compilation.GetSemanticModel(tree); 6561var model = compilation.GetSemanticModel(tree); 6817var model = compilation.GetSemanticModel(tree); 7063var model = compilation.GetSemanticModel(tree); 7301var model = compilation.GetSemanticModel(tree); 7623var model = compilation.GetSemanticModel(tree); 7772var model = compilation.GetSemanticModel(tree); 7832var model = compilation.GetSemanticModel(tree); 7894var model = compilation.GetSemanticModel(tree); 7960var model = compilation.GetSemanticModel(tree); 8024var model = compilation.GetSemanticModel(tree); 8091var model = compilation.GetSemanticModel(tree); 8153var model = compilation.GetSemanticModel(tree); 8208var model = compilation.GetSemanticModel(tree); 8386var model = compilation.GetSemanticModel(tree); 8486var model = compilation.GetSemanticModel(tree); 8658var model = compilation.GetSemanticModel(tree); 8760var model = compilation.GetSemanticModel(tree); 8796var model = compilation.GetSemanticModel(tree); 8868var model = compilation.GetSemanticModel(tree); 8918var model = compilation.GetSemanticModel(tree); 9160var model = compilation.GetSemanticModel(tree); 9262var model = compilation.GetSemanticModel(tree); 9333var model = compilation.GetSemanticModel(tree); 9426var model = compilation.GetSemanticModel(tree); 9506var model = compilation.GetSemanticModel(tree); 9582var model = compilation.GetSemanticModel(tree); 9635var model = compilation.GetSemanticModel(tree); 9692var model = compilation.GetSemanticModel(tree); 9757var model = compilation.GetSemanticModel(tree); 9814var model = compilation.GetSemanticModel(tree); 9889var model = compilation.GetSemanticModel(tree); 9984var model = compilation.GetSemanticModel(tree); 10066var model = compilation.GetSemanticModel(tree); 10147var model = compilation.GetSemanticModel(tree); 10203var model = compilation.GetSemanticModel(tree); 10259var model = compilation.GetSemanticModel(tree); 10326var model = compilation.GetSemanticModel(tree); 10385var model = compilation.GetSemanticModel(tree); 10457var model = compilation.GetSemanticModel(tree); 10541var model = compilation.GetSemanticModel(tree); 10719var model = compilation.GetSemanticModel(tree); 10816var model = compilation.GetSemanticModel(tree); 10852var model = compilation.GetSemanticModel(tree); 10907var model = compilation.GetSemanticModel(tree); 10957var model = compilation.GetSemanticModel(tree); 11045var model = compilation.GetSemanticModel(tree); 11182var model = compilation.GetSemanticModel(tree); 11264var model = compilation.GetSemanticModel(tree); 11426var model = compilation.GetSemanticModel(tree); 11466var model = compilation.GetSemanticModel(tree); 11714var model = compilation.GetSemanticModel(tree); 11971var model = compilation.GetSemanticModel(tree); 12123var model = compilation.GetSemanticModel(tree); 12273var model = compilation.GetSemanticModel(tree); 12350var model = compilation.GetSemanticModel(tree); 12419var model = compilation.GetSemanticModel(tree); 12495var model = compilation.GetSemanticModel(tree); 12657var model = compilation.GetSemanticModel(tree); 12777var model = compilation.GetSemanticModel(tree); 12864var model = compilation.GetSemanticModel(tree); 12919var model = compilation.GetSemanticModel(tree); 12961var model = compilation.GetSemanticModel(tree); 13016var model = compilation.GetSemanticModel(tree); 13200var model = compilation.GetSemanticModel(tree); 13294var model = compilation.GetSemanticModel(tree); 13332var model = compilation.GetSemanticModel(tree); 13384var model = compilation.GetSemanticModel(tree); 13438var model = compilation.GetSemanticModel(tree); 13604var model = compilation.GetSemanticModel(tree); 13695var model = compilation.GetSemanticModel(tree); 13731var model = compilation.GetSemanticModel(tree); 13795var model = compilation.GetSemanticModel(tree); 13845var model = compilation.GetSemanticModel(tree); 14126var model = compilation.GetSemanticModel(tree); 14255var model = compilation.GetSemanticModel(tree); 14302var model = compilation.GetSemanticModel(tree); 14351var model = compilation.GetSemanticModel(tree); 14393var model = compilation.GetSemanticModel(tree); 14435var model = compilation.GetSemanticModel(tree); 14480var model = compilation.GetSemanticModel(tree); 14522var model = compilation.GetSemanticModel(tree); 14567var model = compilation.GetSemanticModel(tree); 14616var model = compilation.GetSemanticModel(tree); 14670var model = compilation.GetSemanticModel(tree); 14729var model = compilation.GetSemanticModel(tree); 14776var model = compilation.GetSemanticModel(tree); 14826var model = compilation.GetSemanticModel(tree); 14941var model = compilation.GetSemanticModel(tree); 15121var model = compilation.GetSemanticModel(tree); 15214var model = compilation.GetSemanticModel(tree); 15252var model = compilation.GetSemanticModel(tree); 15310var model = compilation.GetSemanticModel(tree); 15368var model = compilation.GetSemanticModel(tree); 15529var model = compilation.GetSemanticModel(tree); 15742var model = compilation.GetSemanticModel(tree); 15955var model = compilation.GetSemanticModel(tree); 16070var model = compilation.GetSemanticModel(tree); 16157var model = compilation.GetSemanticModel(tree); 16398var model = compilation.GetSemanticModel(tree); 16494var model = compilation.GetSemanticModel(tree); 16530var model = compilation.GetSemanticModel(tree); 16587var model = compilation.GetSemanticModel(tree); 16641var model = compilation.GetSemanticModel(tree); 16701var model = compilation.GetSemanticModel(tree); 16761var model = compilation.GetSemanticModel(tree); 16824var model = compilation.GetSemanticModel(tree); 16958var model = compilation.GetSemanticModel(tree); 17050var model = compilation.GetSemanticModel(tree); 17089var model = compilation.GetSemanticModel(tree); 17147var model = compilation.GetSemanticModel(tree); 17201var model = compilation.GetSemanticModel(tree); 17385var model = compilation.GetSemanticModel(tree); 17487var model = compilation.GetSemanticModel(tree); 17525var model = compilation.GetSemanticModel(tree); 17588var model = compilation.GetSemanticModel(tree); 17641var model = compilation.GetSemanticModel(tree); 17676var model = compilation.GetSemanticModel(tree); 17709var model = compilation.GetSemanticModel(tree); 17742var model = compilation.GetSemanticModel(tree); 17781var model = compilation.GetSemanticModel(tree); 17828var model = compilation.GetSemanticModel(tree); 17858var model = compilation.GetSemanticModel(tree); 17889var model = compilation.GetSemanticModel(tree); 17918var model = compilation.GetSemanticModel(tree); 17950var model = compilation.GetSemanticModel(tree); 17992var model = compilation.GetSemanticModel(tree); 18029var model = compilation.GetSemanticModel(tree); 18066var model = compilation.GetSemanticModel(tree); 18101var model = compilation.GetSemanticModel(tree); 18140var model = compilation.GetSemanticModel(tree); 18181var model = compilation.GetSemanticModel(tree); 18224var model = compilation.GetSemanticModel(tree); 18267var model = compilation.GetSemanticModel(tree); 18306var model = compilation.GetSemanticModel(tree); 18347var model = compilation.GetSemanticModel(tree); 18382var model = compilation.GetSemanticModel(tree); 18428var model = compilation.GetSemanticModel(tree); 18492var model = compilation.GetSemanticModel(tree); 18541var model = compilation.GetSemanticModel(tree); 18586var model = compilation.GetSemanticModel(tree); 18638var model = compilation.GetSemanticModel(tree); 18682var model = compilation.GetSemanticModel(tree); 18724var model = compilation.GetSemanticModel(tree); 18778var model = compilation.GetSemanticModel(tree); 18811var model = context.SemanticModel; 18871var model = compilation.GetSemanticModel(tree); 18915var model = compilation.GetSemanticModel(tree); 18957var model = compilation.GetSemanticModel(tree); 19010var model = compilation.GetSemanticModel(tree); 19055var model = compilation.GetSemanticModel(tree); 19098var model = compilation.GetSemanticModel(tree); 19152var model = compilation.GetSemanticModel(tree); 19201var model = compilation.GetSemanticModel(tree); 19248var model = compilation.GetSemanticModel(tree); 19286var model = compilation.GetSemanticModel(tree); 19327var model = compilation.GetSemanticModel(tree); 19361var model = compilation.GetSemanticModel(tree); 19422var model = compilation.GetSemanticModel(tree); 19467var model = compilation.GetSemanticModel(tree); 19505var model = compilation.GetSemanticModel(tree); 19544var model = compilation.GetSemanticModel(tree); 19585var model = compilation.GetSemanticModel(tree); 19648var model = compilation.GetSemanticModel(tree); 19680var model = compilation.GetSemanticModel(tree); 19723var model = compilation.GetSemanticModel(tree); 19757var model = compilation.GetSemanticModel(tree); 19830var model = compilation.GetSemanticModel(tree); 19863var model = compilation.GetSemanticModel(tree); 19896var model = compilation.GetSemanticModel(tree); 19931var model = compilation.GetSemanticModel(tree); 19966var model = compilation.GetSemanticModel(tree); 20004var model = compilation.GetSemanticModel(tree); 20036var model = compilation.GetSemanticModel(tree); 20210var model = compilation.GetSemanticModel(tree); 20238var model = compilation.GetSemanticModel(tree); 20346var model = compilation.GetSemanticModel(tree); 20603var model = compilation.GetSemanticModel(tree); 20646var model = compilation.GetSemanticModel(tree); 20763var model = compilation.GetSemanticModel(tree); 20816var model = compilation.GetSemanticModel(tree); 20907var model = compilation.GetSemanticModel(tree); 21026var model = compilation.GetSemanticModel(tree); 21121var model = compilation.GetSemanticModel(tree); 21225var model = compilation.GetSemanticModel(tree); 21282var model = compilation.GetSemanticModel(tree); 21350var model = compilation.GetSemanticModel(tree); 21400var model = compilation.GetSemanticModel(tree); 21634var model = compilation.GetSemanticModel(tree); 21807var model = compilation.GetSemanticModel(tree); 22001var model = compilation.GetSemanticModel(tree); 22128var model = compilation.GetSemanticModel(tree); 22226var model = compilation.GetSemanticModel(tree); 22414var model = compilation.GetSemanticModel(tree); 22569var model = compilation.GetSemanticModel(tree); 22648var model = compilation.GetSemanticModel(tree); 22685SemanticModel model, 22703private static void VerifyModelNotSupported(SemanticModel model, params IdentifierNameSyntax[] references) 22771var model = compilation.GetSemanticModel(tree); 22853var model = compilation.GetSemanticModel(tree); 22937var model = compilation.GetSemanticModel(tree); 23004var model = compilation.GetSemanticModel(tree); 23043var model = compilation.GetSemanticModel(tree); 23199var model = compilation.GetSemanticModel(tree); 23293var model = compilation.GetSemanticModel(tree); 23383var model = compilation.GetSemanticModel(tree); 23431var model = compilation.GetSemanticModel(tree); 23464var model = compilation.GetSemanticModel(tree); 23515var model = compilation.GetSemanticModel(tree); 23659var model = compilation.GetSemanticModel(tree); 23757var model = compilation.GetSemanticModel(tree); 23855var model = compilation.GetSemanticModel(tree); 23997var model = compilation.GetSemanticModel(tree); 24101var model = compilation.GetSemanticModel(tree); 24196var model = compilation.GetSemanticModel(tree); 24284var model = compilation.GetSemanticModel(tree); 24390var model = compilation.GetSemanticModel(tree); 24483var model = compilation.GetSemanticModel(tree); 24514var model = compilation.GetSemanticModel(tree); 24716var model = compilation.GetSemanticModel(tree); 24975var model = compilation.GetSemanticModel(tree); 25166var model = compilation.GetSemanticModel(tree); 25279var model = compilation.GetSemanticModel(tree); 25378var model = compilation.GetSemanticModel(tree); 25557var model = compilation.GetSemanticModel(tree); 25601var model = compilation.GetSemanticModel(tree); 25682var model = compilation.GetSemanticModel(tree); 25726var model = compilation.GetSemanticModel(tree); 25781var model = compilation.GetSemanticModel(tree); 25862var model = compilation.GetSemanticModel(tree); 25922var model = compilation.GetSemanticModel(tree); 26019var model = compilation.GetSemanticModel(tree); 26076var model = compilation.GetSemanticModel(tree); 26143var model = compilation.GetSemanticModel(tree); 26191var model = compilation.GetSemanticModel(tree); 26272var model = compilation.GetSemanticModel(tree); 26319var model = compilation.GetSemanticModel(tree); 26414var model = compilation.GetSemanticModel(tree); 26462var model = compilation.GetSemanticModel(tree); 26546var model = compilation.GetSemanticModel(tree); 26606var model = compilation.GetSemanticModel(tree); 26690var model = compilation.GetSemanticModel(tree); 26750var model = compilation.GetSemanticModel(tree); 26811var model = compilation.GetSemanticModel(tree); 26881var model = compilation.GetSemanticModel(tree); 26925var model = compilation.GetSemanticModel(tree); 27011var model = compilation.GetSemanticModel(tree); 27056var model = compilation.GetSemanticModel(tree); 27148var model = compilation.GetSemanticModel(tree); 27202var model = compilation.GetSemanticModel(tree); 27301var model = compilation.GetSemanticModel(tree); 27355var model = compilation.GetSemanticModel(tree); 27424var model = compilation.GetSemanticModel(tree); 27501var model = compilation.GetSemanticModel(tree); 27574var model = compilation.GetSemanticModel(tree); 27678var model = compilation.GetSemanticModel(tree); 27751var model = compilation.GetSemanticModel(tree); 27814var model = compilation.GetSemanticModel(tree); 27891var model = compilation.GetSemanticModel(tree); 27964var model = compilation.GetSemanticModel(tree); 28069var model = compilation.GetSemanticModel(tree); 28142var model = compilation.GetSemanticModel(tree); 28215var model = compilation.GetSemanticModel(tree); 28290var model = compilation.GetSemanticModel(tree); 28344var model = compilation.GetSemanticModel(tree); 28441var model = compilation.GetSemanticModel(tree); 28495var model = compilation.GetSemanticModel(tree); 28562var model = compilation.GetSemanticModel(tree); 28610var model = compilation.GetSemanticModel(tree); 28694var model = compilation.GetSemanticModel(tree); 28755var model = compilation.GetSemanticModel(tree); 28862var model = compilation.GetSemanticModel(tree); 28918var model = compilation.GetSemanticModel(tree); 29013var model = compilation.GetSemanticModel(tree); 29069var model = compilation.GetSemanticModel(tree); 29134var model = compilation.GetSemanticModel(tree); 29220var model = compilation.GetSemanticModel(tree); 29287var model = compilation.GetSemanticModel(tree); 29396var model = compilation.GetSemanticModel(tree); 29463var model = compilation.GetSemanticModel(tree); 29536var model = compilation.GetSemanticModel(tree); 29585var model = compilation.GetSemanticModel(tree); 29683var model = compilation.GetSemanticModel(tree); 29759var model = compilation.GetSemanticModel(tree); 29884var model = compilation.GetSemanticModel(tree); 29960var model = compilation.GetSemanticModel(tree); 30038var model = compilation.GetSemanticModel(tree); 30124var model = compilation.GetSemanticModel(tree); 30185var model = compilation.GetSemanticModel(tree); 30296var model = compilation.GetSemanticModel(tree); 30357var model = compilation.GetSemanticModel(tree); 30421var model = compilation.GetSemanticModel(tree); 30476var model = compilation.GetSemanticModel(tree); 30520var model = compilation.GetSemanticModel(tree); 30564var model = compilation.GetSemanticModel(tree); 30605var model = compilation.GetSemanticModel(tree); 30685var model = compilation.GetSemanticModel(tree); 30754var model = compilation.GetSemanticModel(tree); 30856var model = compilation.GetSemanticModel(tree); 30925var model = compilation.GetSemanticModel(tree); 30989var model = compilation.GetSemanticModel(tree); 31044var model = compilation.GetSemanticModel(tree); 31088var model = compilation.GetSemanticModel(tree); 31132var model = compilation.GetSemanticModel(tree); 31216var model = compilation.GetSemanticModel(tree); 31275var model = compilation.GetSemanticModel(tree); 31389var model = compilation.GetSemanticModel(tree); 31448var model = compilation.GetSemanticModel(tree); 31517var model = compilation.GetSemanticModel(tree); 31572var model = compilation.GetSemanticModel(tree); 31616var model = compilation.GetSemanticModel(tree); 31660var model = compilation.GetSemanticModel(tree); 31701var model = compilation.GetSemanticModel(tree); 31755var model = compilation.GetSemanticModel(tree); 31789var model = compilation.GetSemanticModel(tree); 31842var model = compilation.GetSemanticModel(tree); 31882var model = compilation.GetSemanticModel(tree); 31932var model = compilation.GetSemanticModel(tree); 31966var model = compilation.GetSemanticModel(tree); 32022var model = compilation.GetSemanticModel(tree); 32062var model = compilation.GetSemanticModel(tree); 32107var model = compilation.GetSemanticModel(tree); 32151var model = compilation.GetSemanticModel(tree); 32185var model = compilation.GetSemanticModel(tree); 32219var model = compilation.GetSemanticModel(tree); 32259var model = compilation.GetSemanticModel(tree); 32299var model = compilation.GetSemanticModel(tree); 32354var model = compilation.GetSemanticModel(tree); 32423var model = compilation.GetSemanticModel(tree); 32470var model = compilation.GetSemanticModel(tree); 32509var model = compilation.GetSemanticModel(tree); 32536var model = compilation.GetSemanticModel(tree); 32564var model = compilation.GetSemanticModel(tree); 32592var model = compilation.GetSemanticModel(tree); 32618var model = compilation.GetSemanticModel(tree); 32656var model = compilation.GetSemanticModel(tree); 32692var model = compilation.GetSemanticModel(tree); 32699SemanticModel model, 32707SemanticModel model, 32715SemanticModel model, 32936var model = compilation.GetSemanticModel(tree); 32965var model = comp.Compilation.GetSemanticModel(tree); 33050var model = comp.GetSemanticModel(tree); 33119var model = comp.GetSemanticModel(tree); 33164var model = comp.GetSemanticModel(tree); 33228var model = comp.GetSemanticModel(tree); 33494var model = comp.GetSemanticModel(tree); 33535var model = comp.GetSemanticModel(tree); 33598var model = compilation.GetSemanticModel(tree); 33681var model = compilation.GetSemanticModel(tree); 33769var model = compilation.GetSemanticModel(tree); 33867var model = compilation.GetSemanticModel(tree); 33966var model = compilation.GetSemanticModel(tree); 34064var model = compilation.GetSemanticModel(tree); 34137var model = compilation.GetSemanticModel(tree); 34193var model = compilation.GetSemanticModel(tree); 34259var model = compilation.GetSemanticModel(tree); 34386var model = compilation.GetSemanticModel(tree); 34477var model = compilation.GetSemanticModel(tree); 34584var model = compilation.GetSemanticModel(tree); 34705var model = compilation.GetSemanticModel(tree); 34745var model = compilation.GetSemanticModel(tree); 34821var model = compilation.GetSemanticModel(tree); 34876var model = compilation.GetSemanticModel(tree); 34930var model = compilation.GetSemanticModel(tree); 34988var model = compilation.GetSemanticModel(tree); 35038var model = compilation.GetSemanticModel(tree); 35092var model = compilation.GetSemanticModel(tree); 35132var model = compilation.GetSemanticModel(tree); 35166var model = compilation.GetSemanticModel(tree); 35205var model = compilation.GetSemanticModel(tree); 35249var model = compilation.GetSemanticModel(tree); 35280var model = compilation.GetSemanticModel(tree); 35319var model = compilation.GetSemanticModel(tree); 35351var model = compilation.GetSemanticModel(tree); 35387var model = compilation.GetSemanticModel(tree); 35426var model = compilation.GetSemanticModel(tree); 35456var model = compilation.GetSemanticModel(tree); 35493var model = compilation.GetSemanticModel(tree); 35545var model = compilation.GetSemanticModel(tree); 35650var model = comp.GetSemanticModel(tree); 35685var model = comp.GetSemanticModel(tree); 35763var model = compilation.GetSemanticModel(tree); 35805var model = compilation.GetSemanticModel(tree); 35834var model = compilation.GetSemanticModel(tree); 35880var model = compilation.GetSemanticModel(tree); 35968var model = compilation.GetSemanticModel(tree); 36108var model = compilation.GetSemanticModel(tree); 36216var model = compilation.GetSemanticModel(tree); 36309var model = compilation.GetSemanticModel(tree); 36348var model = comp.GetSemanticModel(tree); 36352Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel)); 36394var model = comp.GetSemanticModel(tree); 36398Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel)); 36434var model = comp.GetSemanticModel(tree); 36438Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel)); 36476var model = comp.GetSemanticModel(tree); 36480Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel)); 36511var model = comp.GetSemanticModel(tree); 36515Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel)); 36549var model = comp.GetSemanticModel(tree); 36553Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel));
Semantics\ParamsCollectionTests.cs (14)
164var model = comp.GetSemanticModel(tree); 213var model = comp.GetSemanticModel(tree); 329var model = comp.GetSemanticModel(tree); 512var model = comp.GetSemanticModel(tree); 657var model = comp.GetSemanticModel(tree); 1401var model = comp.GetSemanticModel(tree); 2525var model = comp.GetSemanticModel(tree); 2661var model = comp.GetSemanticModel(tree); 2745var model = comp.GetSemanticModel(tree); 2941var model = comp.GetSemanticModel(tree); 4326var model = comp2.GetSemanticModel(tree); 5876var model = comp.GetSemanticModel(tree); 5958var model = comp.GetSemanticModel(tree); 9055var model = comp.GetSemanticModel(tree);
Semantics\PatternMatchingTestBase.cs (15)
64protected static void VerifyModelForDeclarationOrVarSimplePattern(SemanticModel model, SingleVariableDesignationSyntax decl, params IdentifierNameSyntax[] references) 69protected static void VerifyModelForDeclarationOrVarSimplePatternWithoutDataFlow(SemanticModel model, SingleVariableDesignationSyntax decl, params IdentifierNameSyntax[] references) 75SemanticModel model, 130private static void AssertTypeInfo(SemanticModel model, TypeSyntax typeSyntax, ITypeSymbol expectedType) 139protected static void VerifyModelForDeclarationOrVarPatternDuplicateInSameScope(SemanticModel model, SingleVariableDesignationSyntax designation) 165protected static void VerifyModelForDuplicateVariableDeclarationInSameScope(SemanticModel model, VariableDeclaratorSyntax declarator) 177SemanticModel model, 190protected static void VerifyNotAPatternField(SemanticModel model, IdentifierNameSyntax reference) 200protected static void VerifyNotAPatternLocal(SemanticModel model, IdentifierNameSyntax reference) 214protected static void VerifyNotInScope(SemanticModel model, IdentifierNameSyntax reference) 222SemanticModel model, 230SemanticModel model, 238SemanticModel model, 370SemanticModel model, 414protected static void VerifyModelNotSupported(SemanticModel model, params IdentifierNameSyntax[] references)
Semantics\PatternMatchingTests.cs (53)
693var model = compilation.GetSemanticModel(tree); 737var model = compilation.GetSemanticModel(tree); 777var model = compilation.GetSemanticModel(tree); 843var model = compilation.GetSemanticModel(tree); 890var model = compilation.GetSemanticModel(tree); 1152var model = compilation.GetSemanticModel(tree); 1221var model = compilation.GetSemanticModel(tree); 1271var model = compilation.GetSemanticModel(tree); 1315var model = compilation.GetSemanticModel(tree); 1430var model = compilation.GetSemanticModel(tree); 1480var model = compilation.GetSemanticModel(tree); 1537var model = compilation.GetSemanticModel(tree); 1589var model = compilation.GetSemanticModel(tree); 1654var model = compilation.GetSemanticModel(tree); 1731var model = compilation.GetSemanticModel(tree); 1784var model = compilation.GetSemanticModel(tree); 1828var model = compilation.GetSemanticModel(tree); 1882var model = compilation.GetSemanticModel(tree); 1936var model = compilation.GetSemanticModel(tree); 1993var model = compilation.GetSemanticModel(tree); 2031var model = compilation.GetSemanticModel(tree); 2077var model = compilation.GetSemanticModel(tree); 2131var model = compilation.GetSemanticModel(tree); 2179var model = compilation.GetSemanticModel(tree); 2235var model = compilation.GetSemanticModel(tree); 2295var model = compilation.GetSemanticModel(tree); 2353var model = compilation.GetSemanticModel(tree); 2414var model = compilation.GetSemanticModel(tree); 2459var model = compilation.GetSemanticModel(tree); 2498var model = compilation.GetSemanticModel(tree); 2542var model = compilation.GetSemanticModel(tree); 2614var model = compilation.GetSemanticModel(tree); 2662var model = compilation.GetSemanticModel(tree); 2700var model = compilation.GetSemanticModel(tree); 2745var model = compilation.GetSemanticModel(tree); 2789var model = compilation.GetSemanticModel(tree); 2841var model = compilation.GetSemanticModel(tree); 2883var model = compilation.GetSemanticModel(tree); 3038var model = compilation.GetSemanticModel(tree); 3085var model = compilation.GetSemanticModel(tree); 3264var model = compilation.GetSemanticModel(tree); 3443var model1 = compilation.GetSemanticModel(tree); 3456var model2 = compilation.GetSemanticModel(tree); 3478var model = compilation.GetSemanticModel(tree); 4248var model = compilation.GetSemanticModel(tree); 4289var model = compilation.GetSemanticModel(tree); 4790var model = compilation.GetSemanticModel(tree); 4828var model = compilation.GetSemanticModel(tree); 6574var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 11392var model = comp.GetSemanticModel(tree); 11416var model = comp.GetSemanticModel(tree); 11437var model = comp.GetSemanticModel(tree); 11494var model = comp.GetSemanticModel(tree);
Semantics\PatternMatchingTests_Global.cs (123)
78var model = compilation.GetSemanticModel(tree); 122var model = compilation.GetSemanticModel(tree); 200var model = compilation.GetSemanticModel(tree); 244var model = compilation.GetSemanticModel(tree); 294var model = compilation.GetSemanticModel(tree); 370var model = compilation.GetSemanticModel(tree); 430var model = compilation.GetSemanticModel(tree); 522var model = compilation.GetSemanticModel(tree); 579var model = compilation.GetSemanticModel(tree); 641var model = compilation.GetSemanticModel(tree); 683var model = compilation.GetSemanticModel(tree); 759var model = compilation.GetSemanticModel(tree); 806var model = compilation.GetSemanticModel(tree); 896var model = compilation.GetSemanticModel(tree); 944var model = compilation.GetSemanticModel(tree); 1023var model = compilation.GetSemanticModel(tree); 1076var model = compilation.GetSemanticModel(tree); 1155var model = compilation.GetSemanticModel(tree); 1208var model = compilation.GetSemanticModel(tree); 1264var model = compilation.GetSemanticModel(tree); 1329var model = compilation.GetSemanticModel(tree); 1373var model = compilation.GetSemanticModel(tree); 1454var model = compilation.GetSemanticModel(tree); 1499var model = compilation.GetSemanticModel(tree); 1586var model = compilation.GetSemanticModel(tree); 1640var model = compilation.GetSemanticModel(tree); 1734var model = compilation.GetSemanticModel(tree); 1788var model = compilation.GetSemanticModel(tree); 1852var model = compilation.GetSemanticModel(tree); 1926var model = compilation.GetSemanticModel(tree); 1996var model = compilation.GetSemanticModel(tree); 2097var model = compilation.GetSemanticModel(tree); 2167var model = compilation.GetSemanticModel(tree); 2226var model = compilation.GetSemanticModel(tree); 2300var model = compilation.GetSemanticModel(tree); 2370var model = compilation.GetSemanticModel(tree); 2472var model = compilation.GetSemanticModel(tree); 2542var model = compilation.GetSemanticModel(tree); 2611var model = compilation.GetSemanticModel(tree); 2681var model = compilation.GetSemanticModel(tree); 2735var model = compilation.GetSemanticModel(tree); 2827var model = compilation.GetSemanticModel(tree); 2881var model = compilation.GetSemanticModel(tree); 2943var model = compilation.GetSemanticModel(tree); 2989var model = compilation.GetSemanticModel(tree); 3070var model = compilation.GetSemanticModel(tree); 3129var model = compilation.GetSemanticModel(tree); 3229var model = compilation.GetSemanticModel(tree); 3285var model = compilation.GetSemanticModel(tree); 3375var model = compilation.GetSemanticModel(tree); 3431var model = compilation.GetSemanticModel(tree); 3491var model = compilation.GetSemanticModel(tree); 3572var model = compilation.GetSemanticModel(tree); 3639var model = compilation.GetSemanticModel(tree); 3743var model = compilation.GetSemanticModel(tree); 3810var model = compilation.GetSemanticModel(tree); 3874var model = compilation.GetSemanticModel(tree); 3968var model = compilation.GetSemanticModel(tree); 4044var model = compilation.GetSemanticModel(tree); 4166var model = compilation.GetSemanticModel(tree); 4242var model = compilation.GetSemanticModel(tree); 4313var model = compilation.GetSemanticModel(tree); 4394var model = compilation.GetSemanticModel(tree); 4455var model = compilation.GetSemanticModel(tree); 4561var model = compilation.GetSemanticModel(tree); 4622var model = compilation.GetSemanticModel(tree); 4677var model = compilation.GetSemanticModel(tree); 4723var model = compilation.GetSemanticModel(tree); 4762var model = compilation.GetSemanticModel(tree); 4801var model = compilation.GetSemanticModel(tree); 4833var model = compilation.GetSemanticModel(tree); 4908var model = compilation.GetSemanticModel(tree); 4977var model = compilation.GetSemanticModel(tree); 5074var model = compilation.GetSemanticModel(tree); 5143var model = compilation.GetSemanticModel(tree); 5198var model = compilation.GetSemanticModel(tree); 5244var model = compilation.GetSemanticModel(tree); 5283var model = compilation.GetSemanticModel(tree); 5322var model = compilation.GetSemanticModel(tree); 5401var model = compilation.GetSemanticModel(tree); 5477var model = compilation.GetSemanticModel(tree); 5586var model = compilation.GetSemanticModel(tree); 5662var model = compilation.GetSemanticModel(tree); 5727var model = compilation.GetSemanticModel(tree); 5778var model = compilation.GetSemanticModel(tree); 5817var model = compilation.GetSemanticModel(tree); 5856var model = compilation.GetSemanticModel(tree); 5893var model = compilation.GetSemanticModel(tree); 5939var model = compilation.GetSemanticModel(tree); 5977var model = compilation.GetSemanticModel(tree); 6027var model = compilation.GetSemanticModel(tree); 6064var model = compilation.GetSemanticModel(tree); 6111var model = compilation.GetSemanticModel(tree); 6143var model = compilation.GetSemanticModel(tree); 6197var model = compilation.GetSemanticModel(tree); 6235var model = compilation.GetSemanticModel(tree); 6270var model = compilation.GetSemanticModel(tree); 6299var model = compilation.GetSemanticModel(tree); 6321var model = compilation.GetSemanticModel(tree); 6350var model = compilation.GetSemanticModel(tree); 6374var model = compilation.GetSemanticModel(tree); 6397var model = compilation.GetSemanticModel(tree); 6514var model = compilation.GetSemanticModel(tree); 6602var model = compilation.GetSemanticModel(tree); 6686var model = compilation.GetSemanticModel(tree); 6729var model = compilation.GetSemanticModel(tree); 6762var model = compilation.GetSemanticModel(tree); 6804var model = compilation.GetSemanticModel(tree); 6942var model = compilation.GetSemanticModel(tree); 7040var model = compilation.GetSemanticModel(tree); 7132var model = compilation.GetSemanticModel(tree); 7259var model = compilation.GetSemanticModel(tree); 7363var model = compilation.GetSemanticModel(tree); 7452var model = compilation.GetSemanticModel(tree); 7528var model = compilation.GetSemanticModel(tree); 7622var model = compilation.GetSemanticModel(tree); 7709var model = compilation.GetSemanticModel(tree); 7734var model = compilation.GetSemanticModel(tree); 7930var model = compilation.GetSemanticModel(tree); 8189var model = compilation.GetSemanticModel(tree); 8374var model = compilation.GetSemanticModel(tree); 8481var model = compilation.GetSemanticModel(tree); 8580var model = compilation.GetSemanticModel(tree);
Semantics\PatternMatchingTests_ListPatterns.cs (11)
3381var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 3707var model = compilation.GetSemanticModel(tree); 3756var model = compilation.GetSemanticModel(tree); 3786var model = compilation.GetSemanticModel(tree); 4151var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 4238var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 4315var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 4429var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 4471var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 4481var model = compilation.GetSemanticModel(tree); 4622var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false);
Semantics\PatternMatchingTests_Scope.cs (115)
203var model = compilation.GetSemanticModel(tree); 284var model = compilation.GetSemanticModel(tree); 330var model = compilation.GetSemanticModel(tree); 371var model = compilation.GetSemanticModel(tree); 401var model = compilation.GetSemanticModel(tree); 588var model = compilation.GetSemanticModel(tree); 676var model = compilation.GetSemanticModel(tree); 706var model = compilation.GetSemanticModel(tree); 858var model = compilation.GetSemanticModel(tree); 945var model = compilation.GetSemanticModel(tree); 975var model = compilation.GetSemanticModel(tree); 1156var model = compilation.GetSemanticModel(tree); 1249var model = compilation.GetSemanticModel(tree); 1279var model = compilation.GetSemanticModel(tree); 1519var model = compilation.GetSemanticModel(tree); 1819var model = compilation.GetSemanticModel(tree); 2070var model = compilation.GetSemanticModel(tree); 2216var model = compilation.GetSemanticModel(tree); 2352var model = compilation.GetSemanticModel(tree); 2417var model = compilation.GetSemanticModel(tree); 2480var model = compilation.GetSemanticModel(tree); 2550var model = compilation.GetSemanticModel(tree); 2706var model = compilation.GetSemanticModel(tree); 2789var model = compilation.GetSemanticModel(tree); 2985var model = compilation.GetSemanticModel(tree); 3154var model = compilation.GetSemanticModel(tree); 3269var model = compilation.GetSemanticModel(tree); 3358var model = compilation.GetSemanticModel(tree); 3446var model = compilation.GetSemanticModel(tree); 3533var model = compilation.GetSemanticModel(tree); 3609var model = compilation.GetSemanticModel(tree); 3706var model = compilation.GetSemanticModel(tree); 3797var model = compilation.GetSemanticModel(tree); 3887var model = compilation.GetSemanticModel(tree); 3979var model = compilation.GetSemanticModel(tree); 4075var model = compilation.GetSemanticModel(tree); 4221var model = compilation.GetSemanticModel(tree); 4503var model = compilation.GetSemanticModel(tree); 4903var model = compilation.GetSemanticModel(tree); 5212var model = compilation.GetSemanticModel(tree); 5305var model = compilation.GetSemanticModel(tree); 5335var model = compilation.GetSemanticModel(tree); 5500var model = compilation.GetSemanticModel(tree); 5707var model = compilation.GetSemanticModel(tree); 5914var model = compilation.GetSemanticModel(tree); 6023var model = compilation.GetSemanticModel(tree); 6104var model = compilation.GetSemanticModel(tree); 6187var model = compilation.GetSemanticModel(tree); 6274var model = compilation.GetSemanticModel(tree); 6348var model = compilation.GetSemanticModel(tree); 6418var model = compilation.GetSemanticModel(tree); 6465var model = compilation.GetSemanticModel(tree); 6518var model = compilation.GetSemanticModel(tree); 6588var model = compilation.GetSemanticModel(tree); 6677var model = compilation.GetSemanticModel(tree); 6753var model = compilation.GetSemanticModel(tree); 6828var model = compilation.GetSemanticModel(tree); 6878var model = compilation.GetSemanticModel(tree); 6928var model = compilation.GetSemanticModel(tree); 7085var model = compilation.GetSemanticModel(tree); 7175var model = compilation.GetSemanticModel(tree); 7205var model = compilation.GetSemanticModel(tree); 7407var model = compilation.GetSemanticModel(tree); 7498var model = compilation.GetSemanticModel(tree); 7528var model = compilation.GetSemanticModel(tree); 7722var model = compilation.GetSemanticModel(tree); 7951var model = compilation.GetSemanticModel(tree); 8201var model = compilation.GetSemanticModel(tree); 8441var model = compilation.GetSemanticModel(tree); 8673var model = compilation.GetSemanticModel(tree); 8989var model = compilation.GetSemanticModel(tree); 9132var model = compilation.GetSemanticModel(tree); 9304var model = compilation.GetSemanticModel(tree); 9513var model = compilation.GetSemanticModel(tree); 9604var model = compilation.GetSemanticModel(tree); 9634var model = compilation.GetSemanticModel(tree); 9799var model = compilation.GetSemanticModel(tree); 9928var model = compilation.GetSemanticModel(tree); 10076var model = compilation.GetSemanticModel(tree); 10164var model = compilation.GetSemanticModel(tree); 10197var model = compilation.GetSemanticModel(tree); 10366var model = compilation.GetSemanticModel(tree); 10587var model = compilation.GetSemanticModel(tree); 10683var model = compilation.GetSemanticModel(tree); 10713var model = compilation.GetSemanticModel(tree); 11000var model = compilation.GetSemanticModel(tree); 11130var model = compilation.GetSemanticModel(tree); 11178var model = compilation.GetSemanticModel(tree); 11228var model = compilation.GetSemanticModel(tree); 11271var model = compilation.GetSemanticModel(tree); 11314var model = compilation.GetSemanticModel(tree); 11360var model = compilation.GetSemanticModel(tree); 11403var model = compilation.GetSemanticModel(tree); 11805var model = compilation.GetSemanticModel(tree); 11902var model = compilation.GetSemanticModel(tree); 11991var model = compilation.GetSemanticModel(tree); 12089var model = compilation.GetSemanticModel(tree); 12140var model = compilation.GetSemanticModel(tree); 12202var model = compilation.GetSemanticModel(tree); 12246var model = compilation.GetSemanticModel(tree); 12475var model = compilation.GetSemanticModel(tree); 12642var model = compilation.GetSemanticModel(tree); 12833var model = compilation.GetSemanticModel(tree); 12954var model = compilation.GetSemanticModel(tree); 13046var model = compilation.GetSemanticModel(tree); 13228var model = compilation.GetSemanticModel(tree); 13371var model = compilation.GetSemanticModel(tree); 13445var model = compilation.GetSemanticModel(tree); 13533var model = compilation.GetSemanticModel(tree); 13610var model = compilation.GetSemanticModel(tree); 13689var model = compilation.GetSemanticModel(tree); 13756var model = compilation.GetSemanticModel(tree); 13786var model = compilation.GetSemanticModel(tree); 13821var model = comp.GetSemanticModel(tree); 14018var model = compilation.GetSemanticModel(tree);
Semantics\PatternMatchingTests2.cs (9)
739var model = compilation.GetSemanticModel(tree); 746var model = compilation.GetSemanticModel(tree); 2041var gotModel = model.TryGetSpeculativeSemanticModel(returnStatement.Location.SourceSpan.Start, modifiedReturnStatement, out var speculativeModel); 2082var gotModel = model.TryGetSpeculativeSemanticModel(returnStatement.Location.SourceSpan.Start, modifiedReturnStatement, out var speculativeModel); 2175var model = compilation.GetSemanticModel(tree); 2267var model = compilation.GetSemanticModel(tree); 2311var model = compilation.GetSemanticModel(tree); 2357var model = compilation.GetSemanticModel(tree); 2887var model = comp.GetSemanticModel(tree);
Semantics\PatternMatchingTests3.cs (11)
47var model = compilation.GetSemanticModel(tree); 107var model = compilation.GetSemanticModel(tree); 158var model = compilation.GetSemanticModel(tree); 203var model = compilation.GetSemanticModel(tree); 254var model = compilation.GetSemanticModel(tree); 297var model = compilation.GetSemanticModel(tree); 344var model = compilation.GetSemanticModel(tree); 1887var model = compilation.GetSemanticModel(tree); 1935var model = compilation.GetSemanticModel(tree); 4099var model = compilation.GetSemanticModel(tree); 4326var model = compilation.GetSemanticModel(tree);
Semantics\PatternMatchingTests4.cs (2)
1009var model = compilation.GetSemanticModel(tree); 4840var model = comp.GetSemanticModel(tree);
Semantics\PatternMatchingTests5.cs (9)
427var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 564var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 795var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 841var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 895var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 1105var model = compilation.GetSemanticModel(tree); 1185var model = compilation.GetSemanticModel(tree); 1236var model = compilation.GetSemanticModel(tree); 1288var model = compilation.GetSemanticModel(tree);
Semantics\PatternSwitchTests.cs (5)
1510var model = compilation.GetSemanticModel(tree); 1893var model = compilation.GetSemanticModel(tree); 1928var model = compilation.GetSemanticModel(tree); 3239var model = compilation.GetSemanticModel(tree); 3270var model = compilation.GetSemanticModel(tree);
Semantics\PrimaryConstructorTests.cs (41)
420var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 961var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 1003var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 1071var model = comp.GetSemanticModel(tree); 1293var model = comp.GetSemanticModel(tree); 1364var model = comp.GetSemanticModel(tree); 1410var model = comp.GetSemanticModel(tree); 1466var model = comp.GetSemanticModel(tree); 1525var model = comp.GetSemanticModel(tree); 1614var model = comp.GetSemanticModel(tree); 1813var model = comp.GetSemanticModel(tree); 1853var model = comp.GetSemanticModel(tree); 1896var model = comp.GetSemanticModel(tree); 1966var model = comp.GetSemanticModel(tree); 2113var model = comp.GetSemanticModel(tree); 2162SemanticModel speculativeModel; 2295var model = comp.GetSemanticModel(tree); 2424var model = comp.GetSemanticModel(tree); 2472var model = comp.GetSemanticModel(tree); 2640var model = comp.GetSemanticModel(tree); 2678var model = comp.GetSemanticModel(tree); 2715var model = comp.GetSemanticModel(tree); 2751var model = comp.GetSemanticModel(tree); 6105var model = comp.GetSemanticModel(tree); 6842var model = comp.GetSemanticModel(tree); 6868var model = comp.GetSemanticModel(tree); 7804var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8766var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 9172var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 19797var model = comp.GetSemanticModel(tree); 19825var model = comp.GetSemanticModel(tree); 19862var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 19893var model = comp.GetSemanticModel(tree); 19928var model = comp.GetSemanticModel(tree); 19964var model = comp.GetSemanticModel(tree); 20656var semanticModel = comp.GetSemanticModel(tree); 20689var semanticModel = comp.GetSemanticModel(tree); 20733var semanticModel = comp.GetSemanticModel(tree); 20780var semanticModel = comp.GetSemanticModel(tree); 20830var semanticModel = comp.GetSemanticModel(tree); 21687var model = comp.GetSemanticModel(tree, ignoreAccessibility: false);
Semantics\RecordTests.cs (32)
281var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 437var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 469var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 2548var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8149var model = comp.GetSemanticModel(tree); 8662var model = comp.GetSemanticModel(tree); 8922var model = comp.GetSemanticModel(tree); 21247var model = comp.GetSemanticModel(tree); 21471var model = comp.GetSemanticModel(tree); 21542var model = comp.GetSemanticModel(tree); 21588var model = comp.GetSemanticModel(tree); 21644var model = comp.GetSemanticModel(tree); 21703var model = comp.GetSemanticModel(tree); 21792var model = comp.GetSemanticModel(tree); 21991var model = comp.GetSemanticModel(tree); 22028var model = comp.GetSemanticModel(tree); 22068var model = comp.GetSemanticModel(tree); 22103var model = comp.GetSemanticModel(tree); 22182var model = comp.GetSemanticModel(tree); 22329var model = comp.GetSemanticModel(tree); 22378SemanticModel speculativeModel; 22511var model = comp.GetSemanticModel(tree); 23020var model = comp.GetSemanticModel(tree); 23474var model = comp.GetSemanticModel(tree); 24746var model = comp.GetSemanticModel(tree); 24781var model = comp.GetSemanticModel(tree); 24815var model = comp.GetSemanticModel(tree); 24850var model = comp.GetSemanticModel(tree); 28295var model = comp.GetSemanticModel(tree); 28452var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 30475var model = comp.GetSemanticModel(tree); 30499var model = comp.GetSemanticModel(tree);
Symbols\UserDefinedCompoundAssignmentOperatorsTests.cs (13)
3133var model = comp2.GetSemanticModel(tree); 3681var model = comp2.GetSemanticModel(tree); 4215var model = comp2.GetSemanticModel(tree); 5021var model = comp1.GetSemanticModel(tree); 12038var model = comp2.GetSemanticModel(tree); 12424var model = comp2.GetSemanticModel(tree); 13012var model = comp2.GetSemanticModel(tree); 13317var model = comp2.GetSemanticModel(tree); 13883var model = comp2.GetSemanticModel(tree); 14296var model = comp2.GetSemanticModel(tree); 14981var model = comp2.GetSemanticModel(tree); 15331var model = comp2.GetSemanticModel(tree); 16450var model = comp1.GetSemanticModel(tree);
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (5)
EndToEndTests.cs (5)
492var model = comp.GetSemanticModel(tree); 612var model = comp.GetSemanticModel(tree); 699var model = comp.GetSemanticModel(tree); 881var model = comp.GetSemanticModel(tree); 950var model = comp.GetSemanticModel(tree);
Microsoft.CodeAnalysis.CSharp.Features (576)
AddImport\CSharpAddImportFeatureService.cs (11)
246SemanticModel semanticModel, 254SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 260SemanticModel semanticModel, 307SemanticModel semanticModel, 369var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 435SemanticModel semanticModel, 453SemanticModel semanticModel, 508SemanticModel semanticModel, 529SemanticModel semanticModel, 572SemanticModel semanticModel, 620SyntaxNode node, SemanticModel semanticModel, out SyntaxNode objectCreationExpression)
BraceCompletion\LessAndGreaterThanBraceCompletionService.cs (1)
65var semanticModel = await document.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false);
ChangeSignature\CSharpChangeSignatureService.cs (4)
154var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 417var semanticModel = document.SemanticModel; 600private static bool IsParamsArrayExpanded(SemanticModel semanticModel, SyntaxNode node, SymbolInfo symbolInfo, CancellationToken cancellationToken) 874var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
CodeLens\CSharpCodeLensDisplayInfoService.cs (2)
83public string GetDisplayName(SemanticModel semanticModel, SyntaxNode node) 181private static string GetEnclosingScopeString(SyntaxNode node, SemanticModel semanticModel, SymbolDisplayFormat symbolDisplayFormat)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (4)
50var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 70var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 253SemanticModel semanticModel, 296private static ImmutableArray<string> GetReservedNames(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (2)
190var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 436var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (3)
24protected abstract TypeSyntax FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken); 25protected abstract TypeStyleResult AnalyzeTypeName(TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 43var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
CodeRefactorings\UseExplicitOrImplicitType\UseExplicitTypeCodeRefactoringProvider.cs (2)
29protected override TypeSyntax FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 32protected override TypeStyleResult AnalyzeTypeName(TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken)
CodeRefactorings\UseExplicitOrImplicitType\UseImplicitTypeCodeRefactoringProvider.cs (2)
29protected override TypeSyntax FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 32protected override TypeStyleResult AnalyzeTypeName(TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (12)
59var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 72private static Func<SyntaxNode, SyntaxNode>? GetReplacementFunc(SyntaxNode? node, SemanticModel model) 94private static Func<SyntaxNode, SyntaxNode>? CombineLogicalAndOperands(BinaryExpressionSyntax logicalAnd, SemanticModel model) 162private static Func<SyntaxNode, SyntaxNode>? CombineWhenClauseCondition(PatternSyntax switchPattern, ExpressionSyntax condition, SemanticModel model) 306SemanticModel model) 330SemanticModel model, 369static (ExpressionSyntax Expression, ExpressionSyntax Constant, bool Flipped)? TryDetermineConstant(BinaryExpressionSyntax node, SemanticModel model) 421SemanticModel model) 478static bool TryGetInnermostReceiver(ExpressionSyntax node, ArrayBuilder<IdentifierNameSyntax> builder, [NotNullWhen(true)] out ExpressionSyntax? receiver, SemanticModel model) 515private static ExpressionSyntax? GetInnermostReceiver(ExpressionSyntax node, ArrayBuilder<IdentifierNameSyntax> builder, SemanticModel model) 519static bool CanConvertToSubpattern(IdentifierNameSyntax name, SemanticModel model) 611var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (5)
90var semanticModel = await document.ReuseExistingSpeculativeModelAsync(attributeSyntax, cancellationToken).ConfigureAwait(false); 154CompletionContext context, SemanticModel semanticModel, 177CompletionContext context, SemanticModel semanticModel, SyntaxToken token, AttributeSyntax attributeSyntax, ISet<string> existingNamedParameters) 219SemanticModel semanticModel, 235SemanticModel semanticModel,
Completion\CompletionProviders\AwaitCompletionProvider.cs (2)
52protected override TextChange? GetReturnTypeChange(SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 147protected override ITypeSymbol? GetTypeSymbolOfExpression(SemanticModel semanticModel, SyntaxNode potentialAwaitableExpression, CancellationToken cancellationToken)
Completion\CompletionProviders\CompletionUtilities.cs (2)
252public static bool IsSpeculativeTypeParameterContext(SyntaxTree syntaxTree, int position, SemanticModel? semanticModel, bool includeStatementContexts, CancellationToken cancellationToken) 307static int WalkOutOfGenericType(SyntaxTree syntaxTree, int position, SemanticModel? semanticModel, CancellationToken cancellationToken)
Completion\CompletionProviders\CrefCompletionProvider.cs (8)
89protected override async Task<(SyntaxToken, SemanticModel?, ImmutableArray<ISymbol>)> GetSymbolsAsync( 106var semanticModel = await document.ReuseExistingSpeculativeModelAsync( 165SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken) 180SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken) 211QualifiedCrefSyntax parent, SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken) 237SemanticModel semanticModel, ImmutableArray<ISymbol> symbols, SyntaxToken token, int position, ImmutableArray<KeyValuePair<string, string>> options) 259SemanticModel semanticModel, ISymbol symbol, SyntaxToken token, int position, StringBuilder builder, 276SemanticModel semanticModel,
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (2)
44var semanticModel = await document.ReuseExistingSpeculativeModelAsync(token.Parent, cancellationToken).ConfigureAwait(false); 106private static bool IsLambdaExpression(SemanticModel semanticModel, SyntaxTree tree, int position, SyntaxToken token, ITypeInferenceService typeInferrer, CancellationToken cancellationToken)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (22)
71var semanticModel = await document.ReuseExistingSpeculativeModelAsync(token.SpanStart, cancellationToken).ConfigureAwait(false); 99SyntaxToken token, SemanticModel semanticModel, 113SyntaxToken token, SemanticModel semanticModel, 138SemanticModel semanticModel, SyntaxToken token, TypeSyntax type, out NameDeclarationInfo result) 166SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken, out NameDeclarationInfo result) 203private static bool IsPossibleOutVariableDeclaration(SyntaxToken token, SemanticModel semanticModel, 236SyntaxToken token, SemanticModel semanticModel, 258private static bool IsPropertyDeclaration(SyntaxToken token, SemanticModel semanticModel, 273SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken, out NameDeclarationInfo result) 288SemanticModel semanticModel, 322SemanticModel semanticModel, 333SemanticModel semanticModel, 358SemanticModel semanticModel, 387private static bool IsFieldDeclaration(SyntaxToken token, SemanticModel semanticModel, 398private static bool IsIncompleteMemberDeclaration(SyntaxToken token, SemanticModel semanticModel, 409private static bool IsLocalFunctionDeclaration(SyntaxToken token, SemanticModel semanticModel, 420private static bool IsLocalVariableDeclaration(SyntaxToken token, SemanticModel semanticModel, 465private static bool IsEmbeddedVariableDeclaration(SyntaxToken token, SemanticModel semanticModel, 478private static bool IsForEachVariableDeclaration(SyntaxToken token, SemanticModel semanticModel, 510private static bool IsPrimaryConstructorParameter(SyntaxToken token, SemanticModel semanticModel, 530private static bool IsParameterDeclaration(SyntaxToken token, SemanticModel semanticModel, 544SemanticModel semanticModel,
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (2)
64private ImmutableArray<ImmutableArray<string>> GetBaseNames(SemanticModel semanticModel, NameDeclarationInfo nameInfo) 273var semanticModel = context.SemanticModel;
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (3)
70var semanticModel = syntaxContext.SemanticModel; 105SemanticModel semanticModel, 266SemanticModel semanticModel, SyntaxToken token,
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (6)
98var semanticModel = await Document.ReuseExistingSpeculativeModelAsync(Position, CancellationToken).ConfigureAwait(false); 180private string ToDisplayString(ISymbol symbol, SemanticModel semanticModel) 189private string ToDisplayString(IPropertySymbol symbol, SemanticModel semanticModel) 212private string ToDisplayString(IMethodSymbol symbol, SemanticModel semanticModel) 247private void AddParameters(ImmutableArray<IParameterSymbol> parameters, StringBuilder builder, SemanticModel semanticModel) 275private void AddType(ITypeSymbol symbol, StringBuilder builder, SemanticModel semanticModel)
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (1)
107var semanticModel = context.SemanticModel;
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (2)
72var semanticModel = await document.ReuseExistingSpeculativeModelAsync(callingConventionList, cancellationToken).ConfigureAwait(false); 92private static void AddTypes(HashSet<CompletionItem> completionItems, int contextPosition, SemanticModel semanticModel, CancellationToken cancellationToken)
Completion\CompletionProviders\ImportCompletion\ExtensionMethodImportCompletionProvider.cs (1)
62SemanticModel semanticModel,
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (7)
81var semanticModel = await document.ReuseExistingSpeculativeModelAsync(argumentList, cancellationToken).ConfigureAwait(false); 151SemanticModel semanticModel, 168SemanticModel semanticModel, 184SemanticModel semanticModel, 207SemanticModel semanticModel, 230SemanticModel semanticModel, 249SemanticModel semanticModel,
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (3)
73var semanticModel = await document.ReuseExistingSpeculativeModelAsync(expression, cancellationToken).ConfigureAwait(false); 93Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 122private static ITypeSymbol? GetInitializedType(SyntaxToken token, Document document, SemanticModel semanticModel, CancellationToken cancellationToken)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (2)
113var semanticModel = syntaxContext.SemanticModel; 122CompletionContext context, int position, SemanticModel semanticModel, ImmutableArray<ISymbol> unnamedSymbols, CancellationToken cancellationToken)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (1)
40private static void AddConversion(CompletionContext context, SemanticModel semanticModel, int position, IMethodSymbol conversion)
Completion\CompletionProviders\OverrideCompletionProvider.cs (1)
49public override bool TryDetermineReturnType(SyntaxToken startToken, SemanticModel semanticModel, CancellationToken cancellationToken, out ITypeSymbol? returnType, out SyntaxToken nextToken)
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (1)
134protected override string GetDisplayText(IMethodSymbol method, SemanticModel semanticModel, int position)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (4)
57var semanticModel = await document.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false); 98static ITypeSymbol? GetMemberAccessType(ITypeSymbol? type, ExpressionSyntax? expression, Document document, SemanticModel semanticModel, int position) 117static ITypeSymbol? GetMemberType(ITypeSymbol? type, string name, Document document, SemanticModel semanticModel, int position) 134static ImmutableArray<ISymbol> GetCandidatePropertiesAndFields(Document document, SemanticModel semanticModel, int position, ITypeSymbol? type)
Completion\CompletionProviders\SnippetCompletionProvider.cs (2)
123var semanticModel = context.SemanticModel; 168CompletionContext context, SolutionServices services, SemanticModel semanticModel, bool isPreProcessorContext)
Completion\CompletionProviders\TupleNameCompletionProvider.cs (1)
50var semanticModel = context.SemanticModel;
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (1)
90var semanticModel = await document.ReuseExistingSpeculativeModelAsync(attachedToken.Parent, cancellationToken).ConfigureAwait(false);
Completion\Providers\ContextVariableArgumentProvider.cs (1)
28protected override bool IsInstanceContext(SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken)
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
57SemanticModel model, ForEachInfo foreachInfo, SyntaxEditor editor, CancellationToken cancellationToken)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
34public override bool CanImplicitlyConvert(SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol targetType)
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (4)
39SemanticModel semanticModel, 211SemanticModel semanticModel, 339SemanticModel semanticModel, 353internal static bool TypeSymbolIsList(ITypeSymbol typeSymbol, SemanticModel semanticModel)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (3)
45SemanticModel semanticModel, 57private sealed class Converter(SemanticModel semanticModel, ISemanticFactsService semanticFacts, QueryExpressionSyntax source, CancellationToken cancellationToken) 59private readonly SemanticModel _semanticModel = semanticModel;
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (5)
78var semanticModels = new ConcurrentSet<SemanticModel>(); 80var semanticModel = await GetSemanticModelAsync(document).ConfigureAwait(false); 131async ValueTask<SemanticModel> GetSemanticModelAsync(Document document) 135var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 239var semanticModel = await GetSemanticModelAsync(solution.GetRequiredDocument(syntaxTree)).ConfigureAwait(false);
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (5)
39var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 99SemanticModel semanticModel, 195SemanticModel semanticModel, 279SemanticModel semanticModel, 289SemanticModel semanticModel,
ConvertProgram\ConvertToTopLevelStatementsCodeRefactoringProvider.cs (1)
50var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ConvertToExtension\ConvertToExtensionCodeRefactoringProvider.cs (3)
64SemanticModel semanticModel, 122SemanticModel semanticModel, ClassDeclarationSyntax classDeclaration, CancellationToken cancellationToken) 151var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ConvertToExtension\ConvertToExtensionFixAllProvider.cs (1)
37var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Copilot\CSharpImplementNotImplementedExceptionFixProvider.cs (1)
84var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Debugging\CSharpProximityExpressionsService.cs (1)
63var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Debugging\DataTipInfoGetter.cs (2)
39var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false); 50var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Diagnostics\Analyzers\CSharpPreferFrameworkTypeDiagnosticAnalyzer.cs (1)
32protected override bool IsIdentifierNameReplaceableWithFrameworkType(SemanticModel semanticModel, IdentifierNameSyntax node)
Diagnostics\Analyzers\CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs (2)
55var semanticModel = context.SemanticModel; 82SemanticModel model, SyntaxNode node, CSharpSimplifierOptions options,
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.cs (2)
42private readonly SemanticModel _semanticModel; 73public TypeSyntaxSimplifierWalker(CSharpSimplifyTypeNamesDiagnosticAnalyzer analyzer, SemanticModel semanticModel, CSharpSimplifierOptions options, AnalyzerOptions analyzerOptions, TextSpanMutableIntervalTree? ignoredSpans, CancellationToken cancellationToken)
Diagnostics\CSharpAnalyzerDriverService.cs (1)
21SemanticModel model,
DocumentHighlighting\CSharpDocumentHighlightsService.cs (2)
53var semanticModel = (SemanticModel?)null;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (5)
1011protected override ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode declaration, CancellationToken cancellationToken) 1379SemanticModel model, 1485internal override IMethodSymbol GetLambdaExpressionSymbol(SemanticModel model, SyntaxNode lambdaExpression, CancellationToken cancellationToken) 1494internal override bool QueryClauseLambdasTypeEquivalent(SemanticModel oldModel, SyntaxNode oldNode, SemanticModel newModel, SyntaxNode newNode, CancellationToken cancellationToken)
EditAndContinue\DeclarationBody\CopyConstructorDeclarationBody.cs (1)
47public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\CSharpLambdaBody.cs (1)
36public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\FieldWithInitializerDeclarationBody.cs (1)
35public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\OrdinaryInstanceConstructorWithExplicitInitializerDeclarationBody.cs (1)
37public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\OrdinaryInstanceConstructorWithImplicitInitializerDeclarationBody.cs (1)
31public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\PrimaryConstructorWithExplicitInitializerDeclarationBody.cs (1)
45public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\PrimaryConstructorWithImplicitInitializerDeclarationBody.cs (1)
45public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\PropertyOrIndexerAccessorDeclarationBody.cs (1)
77public sealed override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody\TopLevelCodeDeclarationBody.cs (1)
31public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (1)
32var semanticModel = context.SemanticModel;
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
86var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 125var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ExternalAccess\Pythia\Api\IPythiaDeclarationNameRecommenderImplmentation.cs (1)
28public SemanticModel SemanticModel => _context.SemanticModel;
ExternalAccess\Pythia\Api\IPythiaSignatureHelpProviderImplementation.cs (1)
14Task<(ImmutableArray<PythiaSignatureHelpItemWrapper> items, int? selectedItemIndex)> GetMethodGroupItemsAndSelectionAsync(ImmutableArray<IMethodSymbol> accessibleMethods, Document document, InvocationExpressionSyntax invocationExpression, SemanticModel semanticModel, SymbolInfo currentSymbol, CancellationToken cancellationToken);
ExternalAccess\Pythia\Api\PythiaSignatureHelpItemWrapper.cs (1)
22SemanticModel semanticModel,
ExternalAccess\Pythia\PythiaSignatureHelpProvider.cs (1)
34SemanticModel semanticModel,
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (4)
150var semanticModel = SemanticDocument.SemanticModel; 785var semanticModel = SemanticDocument.SemanticModel; 1092var semanticModel = originalDocument.SemanticModel; 1134var semanticModel = SemanticDocument.SemanticModel;
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (1)
38var semanticModel = SemanticDocument.SemanticModel;
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (2)
25private readonly SemanticModel _semanticModel; 28public PostProcessor(SemanticModel semanticModel, int contextPosition)
ExtractMethod\CSharpSelectionResult.ExpressionResult.cs (2)
54var model = SemanticDocument.SemanticModel; 83SemanticModel semanticModel, ExpressionSyntax node, CancellationToken cancellationToken)
ExtractMethod\CSharpSelectionResult.StatementResult.cs (1)
52var semanticModel = SemanticDocument.SemanticModel;
ExtractMethod\CSharpSelectionValidator.cs (2)
75var model = SemanticDocument.SemanticModel; 165SemanticModel semanticModel,
ExtractMethod\CSharpSelectionValidator.Validator.cs (2)
17public static bool Check(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 44private static bool CheckExpression(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken)
Formatting\CSharpAccessibilityModifiersNewDocumentFormattingProvider.cs (1)
39var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (2)
72var semanticModel = document.SemanticModel; 205protected override bool TryConvertToLocalDeclaration(ITypeSymbol type, SyntaxToken identifierToken, SemanticModel semanticModel, CancellationToken cancellationToken, out SyntaxNode newRoot)
GenerateType\CSharpGenerateTypeService.cs (13)
52SemanticModel semanticModel, 175var semanticModel = document.SemanticModel; 421private static IMethodSymbol GetMethodSymbolIfPresent(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 451SemanticModel semanticModel, 460SemanticModel semanticModel, 469SemanticModel semanticModel, 497SemanticModel semanticModel, IList<ArgumentSyntax> arguments, CancellationToken cancellationToken) 508protected override INamedTypeSymbol DetermineTypeToGenerateIn(SemanticModel semanticModel, SimpleNameSyntax simpleName, CancellationToken cancellationToken) 511protected override Accessibility GetAccessibility(State state, SemanticModel semanticModel, bool intoNamespace, CancellationToken cancellationToken) 536protected override ITypeSymbol DetermineArgumentType(SemanticModel semanticModel, ArgumentSyntax argument, CancellationToken cancellationToken) 546var semanticModel = await selectedDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 760SemanticModel semanticModel, 803SemanticModel semanticModel,
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (1)
28protected override int? GetTargetPositionIfControlFlow(SemanticModel semanticModel, SyntaxToken token)
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (2)
58var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 253var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (2)
66var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 88SemanticModel semanticModel, INamedTypeSymbol interfaceType,
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (2)
50var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 276var semanticModel = compilation.GetSemanticModel(group.Key);
InlineHints\CSharpInlineParameterNameHintsService.cs (3)
27SemanticModel semanticModel, 44SemanticModel semanticModel, 60SemanticModel semanticModel,
InlineHints\CSharpInlineTypeHintsService.cs (1)
22SemanticModel semanticModel,
IntroduceVariable\CSharpIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
96var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
LanguageServices\CSharpStructuralTypeDisplayService.cs (1)
33INamedTypeSymbol anonymousType, SemanticModel semanticModel, int position)
LanguageServices\CSharpSymbolDisplayService.cs (1)
12protected override AbstractSymbolDescriptionBuilder CreateDescriptionBuilder(SemanticModel semanticModel, int position, SymbolDescriptionOptions options, CancellationToken cancellationToken)
LanguageServices\CSharpSymbolDisplayService.SymbolDescriptionBuilder.cs (3)
22SemanticModel semanticModel, 115protected override ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat format) 240var semanticModel = GetSemanticModel(equalsValue.SyntaxTree);
MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeRefactoringProvider.cs (1)
40var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
NavigationBar\CSharpNavigationBarItemService.cs (6)
52var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 63Solution solution, SemanticModel semanticModel, HashSet<INamedTypeSymbol> types, CancellationToken cancellationToken) 136SemanticModel semanticModel, HashSet<INamedTypeSymbol> types, CancellationToken cancellationToken) 167private static INamedTypeSymbol? GetType(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 189Solution solution, ISymbol member, SemanticModel semanticModel, CancellationToken cancellationToken) 217Solution solution, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
Organizing\CSharpOrganizingService.Rewriter.cs (2)
17private sealed class Rewriter(CSharpOrganizingService treeOrganizer, IEnumerable<ISyntaxOrganizer> organizers, SemanticModel semanticModel, CancellationToken cancellationToken) : CSharpSyntaxRewriter 20private readonly SemanticModel _semanticModel = semanticModel;
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (1)
121var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
QuickInfo\CSharpSemanticQuickInfoProvider.cs (3)
88SemanticModel semanticModel, 175static TypeInfo GetTypeInfo(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) 235var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Rename\CSharpRenameIssuesService.cs (1)
25SemanticModel semanticModel, ISymbol symbol, SyntaxToken triggerToken, [NotNullWhen(true)] out string? langError)
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (8)
43SemanticModel semanticModel, 64SemanticModel semanticModel, SyntaxGenerator generator, GetAndSetMethods getAndSetMethods, 117SemanticModel semanticModel, SyntaxGenerator generator, GetAndSetMethods getAndSetMethods, 235SemanticModel semanticModel, SyntaxGenerator generator, GetAndSetMethods getAndSetMethods, 243SemanticModel semanticModel, SyntaxGenerator generator, GetAndSetMethods getAndSetMethods) 283private static TNode ReplaceReferencesToParameterWithValue<TNode>(SemanticModel semanticModel, IParameterSymbol parameter, TNode node) 290private sealed class Rewriter(SemanticModel semanticModel, IParameterSymbol parameter) : CSharpSyntaxRewriter 292private readonly SemanticModel _semanticModel = semanticModel;
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (2)
69var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 87SemanticModel semanticModel, VariableDeclaratorSyntax variable,
SignatureHelp\AbstractCSharpSignatureHelpProvider.cs (2)
46SemanticModel semanticModel, 63protected IList<TaggedText> GetAwaitableUsage(IMethodSymbol method, SemanticModel semanticModel, int position)
SignatureHelp\AbstractGenericNameSignatureHelpProvider.cs (4)
55var semanticModel = await document.ReuseExistingSpeculativeModelAsync(simpleName, cancellationToken).ConfigureAwait(false); 124SemanticModel semanticModel, 186SemanticModel semanticModel, 200SemanticModel semanticModel,
SignatureHelp\AbstractGenericNameSignatureHelpProvider_Method.cs (2)
14SemanticModel semanticModel, 74private static IList<SymbolDisplayPart> GetPostambleParts(IMethodSymbol method, SemanticModel semanticModel, int position)
SignatureHelp\AbstractGenericNameSignatureHelpProvider_NamedType.cs (1)
13SemanticModel semanticModel,
SignatureHelp\AbstractOrdinaryMethodSignatureHelpProvider.cs (3)
20SemanticModel semanticModel) 29SemanticModel semanticModel, 49SemanticModel semanticModel,
SignatureHelp\AttributeSignatureHelpProvider.cs (4)
80var semanticModel = await document.ReuseExistingSpeculativeModelAsync(attribute, cancellationToken).ConfigureAwait(false); 130SemanticModel semanticModel, 157SemanticModel semanticModel, 216SemanticModel semanticModel,
SignatureHelp\ConstructorInitializerSignatureHelpProvider.cs (3)
75var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 134SemanticModel semanticModel, 153SemanticModel semanticModel,
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (5)
58var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 179SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken, 195int position, SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken, 221SemanticModel semanticModel, 240SemanticModel semanticModel)
SignatureHelp\InitializerExpressionSignatureHelpProvider.cs (1)
71var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (2)
75var semanticModel = await document.ReuseExistingSpeculativeModelAsync(invocationExpression, cancellationToken).ConfigureAwait(false); 125var semanticModel = await document.ReuseExistingSpeculativeModelAsync(invocationExpression, cancellationToken).ConfigureAwait(false);
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_DelegateAndFunctionPointerInvoke.cs (4)
19InvocationExpressionSyntax invocationExpression, SemanticModel semanticModel, ISymbol within, 39private static IList<SignatureHelpItem> GetDelegateOrFunctionPointerInvokeItems(InvocationExpressionSyntax invocationExpression, IMethodSymbol invokeMethod, SemanticModel semanticModel, IStructuralTypeDisplayService structuralTypeDisplayService, IDocumentationCommentFormattingService documentationCommentFormattingService, out int? selectedItem, CancellationToken cancellationToken) 58private static IList<SymbolDisplayPart> GetDelegateOrFunctionPointerInvokePreambleParts(IMethodSymbol invokeMethod, SemanticModel semanticModel, int position) 80IMethodSymbol invokeMethod, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formattingService, CancellationToken cancellationToken)
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (2)
24SemanticModel semanticModel, 37SemanticModel semanticModel,
SignatureHelp\LightweightOverloadResolution.cs (1)
22SemanticModel semanticModel,
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (2)
69var semanticModel = await document.ReuseExistingSpeculativeModelAsync(objectCreationExpression, cancellationToken).ConfigureAwait(false); 113var semanticModel = await document.ReuseExistingSpeculativeModelAsync(objectCreationExpression, cancellationToken).ConfigureAwait(false);
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider_DelegateType.cs (3)
18SemanticModel semanticModel, 36private static IList<SymbolDisplayPart> GetDelegateTypePreambleParts(IMethodSymbol invokeMethod, SemanticModel semanticModel, int position) 46private static IList<SignatureHelpSymbolParameter> GetDelegateTypeParameters(IMethodSymbol invokeMethod, SemanticModel semanticModel, int position)
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider_NormalType.cs (2)
21SemanticModel semanticModel, 41SemanticModel semanticModel,
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (3)
80var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 121SemanticModel semanticModel, 139SemanticModel semanticModel,
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (5)
109var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 124private IEnumerable<INamedTypeSymbol>? FindNearestTupleConstructionWithInferrableType(SyntaxNode root, SemanticModel semanticModel, int position, SignatureHelpTriggerInfo triggerInfo, 150SyntaxNode targetExpression, SemanticModel semanticModel, IEnumerable<INamedTypeSymbol> tupleTypes, CancellationToken cancellationToken) 165ImmutableArray<TaggedText> separatorParts, SemanticModel semanticModel, int position) 178private static IEnumerable<SignatureHelpParameter> ConvertTupleMembers(INamedTypeSymbol tupleType, SemanticModel semanticModel, int position)
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Snippets\AbstractCSharpForLoopSnippetProvider.cs (1)
48var semanticModel = syntaxContext.SemanticModel;
Snippets\AbstractCSharpMainMethodSnippetProvider.cs (1)
19var semanticModel = context.SemanticModel;
Snippets\CSharpClassSnippetProvider.cs (1)
48var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Snippets\CSharpConsoleSnippetProvider.cs (1)
27var semanticModel = context.SemanticModel;
Snippets\CSharpConstructorSnippetProvider.cs (1)
61var semanticModel = await document.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false);
Snippets\CSharpEnumSnippetProvider.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Snippets\CSharpForEachLoopSnippetProvider.cs (1)
60var semanticModel = syntaxContext.SemanticModel;
Snippets\CSharpInterfaceSnippetProvider.cs (1)
44var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Snippets\CSharpSnippetFunctionService.cs (1)
41var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Snippets\CSharpStructSnippetProvider.cs (1)
46var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
45SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
59var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (2)
33SemanticModel semanticModel, 82private (VariableDeclaratorSyntax, ISymbol)? TryGetVariableDeclaratorAndSymbol(SemanticModel semanticModel)
src\Analyzers\CSharp\Analyzers\ForEachCast\CSharpForEachCastDiagnosticAnalyzer.cs (1)
27SemanticModel semanticModel, CommonForEachStatementSyntax node)
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (3)
126var semanticModel = context.SemanticModel; 250SemanticModel semanticModel, 328SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
274var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticDiagnosticAnalyzer.cs (1)
49var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticHelper.cs (3)
17private static bool TryGetDataFlowAnalysis(LocalFunctionStatementSyntax localFunction, SemanticModel semanticModel, [NotNullWhen(returnValue: true)] out DataFlowAnalysis? dataFlow) 38public static bool CanMakeLocalFunctionStaticBecauseNoCaptures(LocalFunctionStatementSyntax localFunction, SemanticModel semanticModel) 43public static bool CanMakeLocalFunctionStaticByRefactoringCaptures(LocalFunctionStatementSyntax localFunction, SemanticModel semanticModel, out ImmutableArray<ISymbol> captures)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
218var semanticModel = blockOperation.SemanticModel; 261SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
47var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
25protected override bool IsUnnecessaryCast(SemanticModel model, ExpressionSyntax cast, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
50var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (4)
59var semanticModel = context.SemanticModel; 210var rewrittenSemanticModel = analyzer.SpeculativeSemanticModel; 243SemanticModel semanticModel1, 245SemanticModel semanticModel2,
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (1)
317private SyntaxTreeState GetOrCreateSyntaxTreeState(SyntaxTree tree, bool defaultCompleted, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (2)
18SemanticModel semanticModel, 23private readonly SemanticModel _semanticModel = semanticModel;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryParentheses\CSharpRemoveUnnecessaryExpressionParenthesesDiagnosticAnalyzer.cs (2)
29SemanticModel semanticModel, CancellationToken cancellationToken, 38ParenthesizedExpressionSyntax parenthesizedExpression, SemanticModel semanticModel, CancellationToken cancellationToken,
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryParentheses\CSharpRemoveUnnecessaryPatternParenthesesDiagnosticAnalyzer.cs (1)
29SemanticModel semanticModel, CancellationToken cancellationToken,
src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\UnnecessaryNullableWarningSuppressionsUtilities.cs (4)
22private static bool ShouldAnalyzeNode(SemanticModel semanticModel, PostfixUnaryExpressionSyntax node, CancellationToken cancellationToken) 44SemanticModel semanticModel, 73SemanticModel semanticModel, 91var updatedSemanticModel = updatedCompilation.GetSemanticModel(updatedTree);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryUnsafeModifier\UnnecessaryUnsafeModifierUtilities.cs (5)
25private static bool ShouldAnalyzeNode(SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 38SemanticModel semanticModel, 77SemanticModel semanticModel, 90SemanticModel semanticModel, 108var updatedSemanticModel = updatedCompilation.GetSemanticModel(updatedTree);
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
44var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\SimplifyBooleanExpression\CSharpSimplifyConditionalDiagnosticAnalyzer.cs (1)
25protected override CommonConversion GetConversion(SemanticModel semanticModel, ExpressionSyntax node, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (2)
59SemanticModel semanticModel, 181var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (3)
50SemanticModel semanticModel, 205SemanticModel semanticModel, IMethodSymbol setMethod, CancellationToken cancellationToken) 239SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
27protected override bool IsTargetTyped(SemanticModel semanticModel, ConditionalExpressionSyntax conditional, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (1)
25protected override bool IsTargetTyped(SemanticModel semanticModel, ConditionalExpressionSyntax conditional, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\UseCoalesceExpressionHelpers.cs (1)
12public static bool IsTargetTyped(SemanticModel semanticModel, ConditionalExpressionSyntax conditional, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (4)
37var semanticModel = context.SemanticModel; 62SemanticModel semanticModel, 119SemanticModel semanticModel, 140var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (2)
39var semanticModel = context.SemanticModel; 102SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
27var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyDiagnosticAnalyzer.cs (1)
28var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (2)
70var semanticModel = context.SemanticModel; 156var semanticModel = state.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
41var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (3)
43var semanticModel = context.SemanticModel; 85var semanticModel = context.SemanticModel; 124SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (8)
62SemanticModel semanticModel, 80SemanticModel semanticModel, 385SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 735SemanticModel semanticModel, 856SemanticModel semanticModel, 1007SemanticModel semanticModel, ArgumentSyntax argument, out bool unwrapArgument, out bool useSpread, CancellationToken cancellationToken) 1046public static bool IsIterable(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 1079SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
16SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerDiagnosticAnalyzer.cs (1)
50SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (3)
52var semanticModel = context.SemanticModel; 118var semanticModel = context.SemanticModel; 173SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (6)
90SemanticModel semanticModel, 120SemanticModel semanticModel, 135SemanticModel semanticModel, 199SemanticModel semanticModel, INamedTypeSymbol tupleType, 244SemanticModel semanticModel, SyntaxNode searchScope, ILocalSymbol local, 285SemanticModel semanticModel, SyntaxNode container, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForAccessorsHelper.cs (1)
68protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, AccessorDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForConstructorsHelper.cs (1)
50protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, ConstructorDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForConversionOperatorsHelper.cs (1)
50protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, ConversionOperatorDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForIndexersHelper.cs (2)
63protected override IndexerDeclarationSyntax WithGenerateBody(SemanticModel semanticModel, IndexerDeclarationSyntax declaration, CancellationToken cancellationToken) 66protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, IndexerDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs (1)
54SemanticModel semanticModel, LocalFunctionStatementSyntax statement, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForMethodsHelper.cs (1)
52SemanticModel semanticModel, MethodDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForOperatorsHelper.cs (1)
52protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, OperatorDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (2)
67SemanticModel semanticModel, PropertyDeclarationSyntax declaration, CancellationToken cancellation) 70protected override bool CreateReturnStatementForExpression(SemanticModel semanticModel, PropertyDeclarationSyntax declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper.cs (1)
31public abstract SyntaxNode Update(SemanticModel semanticModel, SyntaxNode declaration, bool useExpressionBody, CancellationToken cancellationToken);
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (5)
68public sealed override SyntaxNode Update(SemanticModel semanticModel, SyntaxNode declaration, bool useExpressionBody, CancellationToken cancellationToken) 225SemanticModel semanticModel, TDeclaration declaration, bool useExpressionBody, CancellationToken cancellationToken) 283SemanticModel semanticModel, TDeclaration declaration, CancellationToken cancellationToken); 292SemanticModel semanticModel, TDeclaration declaration, CancellationToken cancellationToken) 308SemanticModel semanticModel, TDeclaration declaration, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (1)
71SemanticModel semanticModel, CodeStyleOption2<ExpressionBodyPreference> option,
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaHelpers.cs (3)
22SemanticModel semanticModel, ExpressionBodyPreference preference, 68SemanticModel semanticModel, ExpressionBodyPreference preference, LambdaExpressionSyntax declaration, LanguageVersion languageVersion, CancellationToken cancellationToken) 109SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseImplicitlyTypedLambdaExpression\CSharpUseImplicitlyTypedLambdaExpressionDiagnosticAnalyzer.cs (2)
40var semanticModel = context.SemanticModel; 59SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (2)
37var semanticModel = context.SemanticModel; 68SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
50var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
197var semanticModel = instance.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
78var semanticModel = operation.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (2)
53var semanticModel = context.SemanticModel; 70SemanticModel semanticModel, ExpressionSyntax left, ExpressionSyntax right)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (1)
87var semanticModel = operation.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (3)
86var semanticModel = syntaxContext.SemanticModel; 237SemanticModel semanticModel, INamedTypeSymbol? expressionTypeOpt, ISymbol local, BlockSyntax block, 388SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
53var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseNullPropagation\CSharpUseNullPropagationDiagnosticAnalyzer.cs (1)
108SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (1)
62if (operation.SemanticModel.TryGetSpeculativeSemanticModel(typeSyntax.SpanStart, dummyStatement, out var speculativeModel))
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
67var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (1)
62var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (4)
19private readonly SemanticModel _semanticModel; 29SemanticModel semanticModel, 56SemanticModel semanticModel, 252var semanticModel = _semanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
83var semanticModel = syntaxContext.SemanticModel; 269SemanticModel semanticModel, 317SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
110var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
71var semanticModel = context.SemanticModel;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (4)
389var semanticModel = compilation.GetSemanticModel(primaryConstructorDeclaration.SyntaxTree); 407SemanticModel semanticModel, 464SemanticModel semanticModel, 546var semanticModel = operation.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (4)
86var semanticModel = context.SemanticModel; 133SemanticModel semanticModel, 176SemanticModel semanticModel, 226SemanticModel semanticModel,
src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
108var semanticModel = syntaxContext.SemanticModel;
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
85var semanticModel = context.Operation.SemanticModel;
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\ArgumentFixer.cs (1)
29protected override SymbolInfo GetSpeculativeSymbolInfo(SemanticModel semanticModel, ArgumentListSyntax newArgumentList)
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\AttributeArgumentFixer.cs (1)
29protected override SymbolInfo GetSpeculativeSymbolInfo(SemanticModel semanticModel, AttributeArgumentListSyntax newArgumentList)
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (2)
52SemanticModel semanticModel, 90SemanticModel semanticModel, ExpressionSyntax targetNode, ITypeSymbol conversionType)
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (1)
42var semanticModel = await context.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\AddParameter\CSharpAddParameterCodeFixProvider.cs (2)
49protected override ITypeSymbol GetArgumentType(SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken) 56SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (2)
37var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 98var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
64var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (3)
24private readonly SemanticModel _semanticModel; 30private Rewriter(SemanticModel semanticModel, bool isAllThrowStatements, CancellationToken cancellationToken) 39SemanticModel model,
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (3)
35SemanticModel semanticModel, 47SemanticModel semanticModel, 62SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (2)
40var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 86var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
38SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\ConvertTypeOfToNameOf\CSharpConvertTypeOfToNameOfCodeFixProvider.cs (1)
32protected override SyntaxNode GetSymbolTypeExpression(SemanticModel model, MemberAccessExpressionSyntax node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (3)
43var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 51SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken, 137var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (2)
76var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 153private static ITypeSymbol? InferTupleType(TupleExpressionSyntax tuple, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\ForEachCast\CSharpForEachCastCodeFixProvider.cs (1)
20SemanticModel semanticModel, CommonForEachStatementSyntax forEachStatement)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (5)
55var semanticModel = document.SemanticModel; 173protected override string GenerateNameForExpression(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 176protected override ITypeSymbol GetArgumentType(SemanticModel semanticModel, Argument<ExpressionSyntax> argument, CancellationToken cancellationToken) 182protected override IMethodSymbol? GetCurrentConstructor(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 185protected override IMethodSymbol? GetDelegatedConstructor(SemanticModel semanticModel, IMethodSymbol constructor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
54var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (2)
47protected override bool AreSpecialOptionsActive(SemanticModel semanticModel) 50protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (3)
32protected override bool AreSpecialOptionsActive(SemanticModel semanticModel) 35protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel) 38public override ImmutableArray<IParameterSymbol> TryMakeParameters(SemanticModel semanticModel, SyntaxNode target, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (4)
40protected override bool AreSpecialOptionsActive(SemanticModel semanticModel) 43protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel) 61var semanticModel = document.SemanticModel; 146SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (2)
51var semanticModel = Document.SemanticModel; 70var semanticModel = Document.SemanticModel;
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
49Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken,
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (5)
97CSharpSimplifierOptions options, SemanticModel semanticModel, 324SemanticModel semanticModel, 355topmostContainer.SpanStart, updatedTopmostContainer, out var speculativeModel)) 384SemanticModel semanticModel, 386out SemanticModel speculativeModel)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (6)
53var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 89SemanticModel model, ExpressionSyntax? expression, [NotNullWhen(true)] out ITypeSymbol? returnExpressionType) 103SyntaxNode node, SemanticModel model, CancellationToken cancellationToken, 117private static bool IsCorrectTypeForYieldReturn(ITypeSymbol typeArgument, ITypeSymbol returnExpressionType, ITypeSymbol methodReturnType, SemanticModel model) 151private static bool CanConvertTypes(ITypeSymbol typeArgument, ITypeSymbol returnExpressionType, SemanticModel model) 190private static bool IsCorrectTypeForYieldReturn(ITypeSymbol methodReturnType, SemanticModel model)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
38var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 111SemanticModel model,
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
46var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
85var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
52var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
48var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (3)
82var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 99Document document, SemanticModel model, SyntaxEditor editor, SyntaxNode node, HashSet<TypeSyntax> alreadyHandled, CancellationToken cancellationToken) 111Document document, SemanticModel? model, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
60var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryParentheses\CSharpRemoveUnnecessaryParenthesesCodeFixProvider.cs (1)
20protected override bool CanRemoveParentheses(SyntaxNode current, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryNullableWarningSuppressionsCodeFixProvider.cs (1)
54var linkedSemanticModel = await linkedDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
91protected override SyntaxNode? TryUpdateParentOfUpdatedNode(SyntaxNode parent, SyntaxNode newNameNode, SyntaxEditor editor, ISyntaxFacts syntaxFacts, SemanticModel semanticModel)
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (2)
47var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 78SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (1)
22SemanticModel semanticModel, SyntaxNode expressionToCoalesce,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (2)
64var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 100SemanticModel semanticModel, ExpressionSyntax expression, INamedTypeSymbol? expressionType)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
44var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (1)
52var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocCodeFixProvider.cs (1)
40var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
44var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
58SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (3)
33SemanticModel semanticModel, InvocationExpressionSyntax invocationExpression, CancellationToken cancellationToken) 102var semanticModel = await context.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 117var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
44var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (2)
57var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 76SemanticModel semanticModel, SyntaxEditor editor, Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (5)
22internal static LambdaExpressionSyntax Update(SemanticModel semanticModel, LambdaExpressionSyntax lambdaExpression, CancellationToken cancellationToken) 26SemanticModel semanticModel, LambdaExpressionSyntax lambdaExpression, CancellationToken cancellationToken) 35SemanticModel semanticModel, LambdaExpressionSyntax declaration, CancellationToken cancellationToken) 57SemanticModel semanticModel, LambdaExpressionSyntax lambdaExpression, ExpressionSyntax expressionBody) 80SemanticModel semanticModel, LambdaExpressionSyntax declaration)
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
40var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (5)
96var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 148var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 163SemanticModel semanticModel, 184SemanticModel semanticModel, 247private static ITypeSymbol GetConvertedType(SemanticModel semanticModel, SyntaxNode typeSyntax, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
64SemanticModel semanticModel, SyntaxNode currentRoot,
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
56var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 125SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
76var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 125var semanticModel = p.Target.SemanticModel;
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
47var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 84SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (2)
38var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 47SemanticModel semanticModel,
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
120var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (2)
63SemanticModel? semanticModel, 78SemanticModel? semanticModel,
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockFixAllProvider.cs (1)
41var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (2)
46var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 91private static IArrayCreationOperation GetArrayCreationOperation(SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (4)
20SemanticModel model, 32SemanticModel model, 54SemanticModel model, 414SemanticModel model,
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (3)
166var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 172SemanticModel semanticModel, SyntaxNode root, SyntaxNode declaration, 252var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeRefactoringProvider.cs (2)
172var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 197var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
UseNamedArguments\CSharpUseNamedArgumentsCodeRefactoringProvider.cs (1)
38protected override bool IsImplicitIndexOrRangeIndexer(ImmutableArray<IParameterSymbol> parameters, TSyntax argument, SemanticModel semanticModel)
UsePatternMatching\CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs (2)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 54var updatedSemanticModel = CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.ReplaceMatches(
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (6)
66var semanticModel = context.SemanticModel; 109SemanticModel semanticModel, 155var updatedSemanticModel = ReplaceMatches( 200SemanticModel updatedSemanticModel, CancellationToken cancellationToken) 210public static SemanticModel ReplaceMatches( 211SemanticModel semanticModel, BinaryExpressionSyntax isExpression,
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Testing\CSharpTestMethodFinderTests.cs (1)
484var semanticModel = await workspace.CurrentSolution.GetRequiredDocument(testDocument.Id).GetRequiredSemanticModelAsync(CancellationToken.None);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (36)
IOperation\IOperationTests.cs (12)
461var model = compilation.GetSemanticModel(tree); 491var model = compilation.GetSemanticModel(tree); 510var model = compilation.GetSemanticModel(tree); 525var model = compilation.GetSemanticModel(tree); 555var model = comp.GetSemanticModel(tree); 590var model = compilation.GetSemanticModel(tree); 618var model = compilation.GetSemanticModel(tree); 620SemanticModel speculativeModel; 662var semanticModel = compilation.GetSemanticModel(syntaxTree); 677SemanticModel model, 681SemanticModel memberModel = ((Operation)operation).OwningSemanticModel; 718var model = comp.GetSemanticModel(tree);
IOperation\IOperationTests_IAnonymousFunctionExpression.cs (4)
407var semanticModel = compilation.GetSemanticModel(syntaxTree); 487var semanticModel = compilation.GetSemanticModel(syntaxTree); 846var semanticModel = compilation.GetSemanticModel(tree); 901var semanticModel = compilation.GetSemanticModel(tree);
IOperation\IOperationTests_IConstructorBodyOperation.cs (6)
38var model = compilation.GetSemanticModel(tree); 485var model = compilation.GetSemanticModel(tree); 1070var model = compilation.GetSemanticModel(tree); 1090var model = compilation.GetSemanticModel(tree); 1123var model = compilation.GetSemanticModel(tree); 1161var model = compilation.GetSemanticModel(tree);
IOperation\IOperationTests_IConversionExpression.cs (2)
5290var model = compilation.GetSemanticModel(tree); 5380var semanticModel = compilation.GetSemanticModel(finalSyntax.SyntaxTree);
IOperation\IOperationTests_IFieldReferenceExpression.cs (1)
705var model = comp.GetSemanticModel(syntaxTree);
IOperation\IOperationTests_IFixedStatement.cs (1)
692var model = comp.GetSemanticModel(tree);
IOperation\IOperationTests_ILocalFunctionStatement.cs (2)
1792var semanticModel = compilation.GetSemanticModel(tree); 1847var semanticModel = compilation.GetSemanticModel(tree);
IOperation\IOperationTests_IMethodBodyOperation.cs (6)
33var model = compilation.GetSemanticModel(tree); 560var model = compilation.GetSemanticModel(tree); 702var model = compilation.GetSemanticModel(tree); 844var model = compilation.GetSemanticModel(tree); 976var model = compilation.GetSemanticModel(tree); 1122var model = compilation.GetSemanticModel(tree);
IOperation\IOperationTests_ISymbolInitializer.cs (1)
36var semanticModel = compilation.GetSemanticModel(tree);
IOperation\IOperationTests_IVariableDeclaration.cs (1)
924var model = comp.GetSemanticModel(tree, ignoreAccessibility: false);
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (16)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.Fixer.cs (1)
55private static int? FindFirstUnusedIdentifierIndex(SemanticModel model, int docOffset, string baseName)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.Fixer.IdentifierGenerator.cs (2)
16public IdentifierGenerator(SemanticModel model, int offsetForSpeculativeSymbolResolution) 20public IdentifierGenerator(SemanticModel model, IBlockOperation block)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDynamicInterfaceCastableImplementation.Fixer.cs (1)
29var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\CSharpPreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (1)
119var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\CSharpUseSearchValues.cs (4)
25protected override bool IsConstantByteOrCharArrayVariableDeclaratorSyntax(SemanticModel semanticModel, SyntaxNode syntax, out int length) 45protected override bool IsConstantByteOrCharReadOnlySpanPropertyDeclarationSyntax(SemanticModel semanticModel, SyntaxNode syntax, out int length) 57protected override bool IsConstantByteOrCharArrayCreationSyntax(SemanticModel semanticModel, SyntaxNode syntax, out int length) 92internal static bool IsConstantByteOrCharArrayCreationExpression(SemanticModel semanticModel, ExpressionSyntax expression, List<char>? values, out int length)
Microsoft.NetCore.Analyzers\Performance\CSharpUseSearchValues.Fixer.cs (1)
22protected override async ValueTask<(SyntaxNode TypeDeclaration, INamedTypeSymbol? TypeSymbol, bool IsRealType)> GetTypeSymbolAsync(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Performance\CSharpUseStringMethodCharOverloadWithSingleCharacters.Fixer.cs (2)
20protected override bool TryGetChar(SemanticModel model, SyntaxNode argumentListNode, out char c) 71SemanticModel model,
Microsoft.NetCore.Analyzers\Runtime\CSharpForwardCancellationTokenToInvocations.Fixer.cs (1)
22SemanticModel model,
Microsoft.NetCore.Analyzers\Runtime\CSharpPreferStreamAsyncMemoryOverloads.Fixer.cs (1)
57protected override bool IsPassingZeroAndBufferLength(SemanticModel model, SyntaxNode bufferValueNode, SyntaxNode offsetValueNode, SyntaxNode countValueNode)
Microsoft.NetCore.Analyzers\Runtime\CSharpSpecifyCultureForToLowerAndToUpper.Fixer.cs (1)
30var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\CSharpUseOrdinalStringComparison.Fixer.cs (1)
53SemanticModel model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
InteractiveSessionTests.cs (1)
1180var semanticModel = compilation.GetSemanticModel(tree);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1221)
Semantics\AccessCheckTests.cs (2)
742var model = c.GetSemanticModel(tree); 896var model = c1.GetSemanticModel(tree);
Semantics\AccessibilityTests.cs (1)
19private static readonly SemanticModel s_testModel;
Semantics\AnonymousFunctionTests.cs (2)
980var semanticModel = compilation.GetSemanticModel(syntaxTree); 1014var semanticModel = compilation.GetSemanticModel(syntaxTree);
Semantics\ArglistTests.cs (1)
958var model = comp.GetSemanticModel(tree);
Semantics\AwaitExpressionTests.cs (16)
84var model = csCompilation.GetSemanticModel(tree); 277var treeModel = comp.GetSemanticModel(tree); 303var treeModel = comp.GetSemanticModel(tree); 333var treeModel = comp.GetSemanticModel(tree); 440var semanticModel = compilation.GetSemanticModel(compilation.SyntaxTrees[0]); 461var model = comp.GetSemanticModel(tree); 618var model = comp.GetSemanticModel(tree); 669var model = comp.GetSemanticModel(tree); 709var model = comp.GetSemanticModel(tree); 735var model = comp.GetSemanticModel(tree); 781var model = comp.GetSemanticModel(tree); 845var model = comp.GetSemanticModel(tree); 885var model = comp.GetSemanticModel(tree); 890var success = model.TryGetSpeculativeSemanticModel(actualLocalDecl.SpanStart, speculativeLocalDecl, out var specModel); 914var model = comp.GetSemanticModel(tree); 919var success = model.TryGetSpeculativeSemanticModel(actualUsingStmt.SpanStart, speculativeUsingStmt, out var specModel);
Semantics\BetterCandidates.cs (4)
1086var model = compilation.GetSemanticModel(compilation.SyntaxTrees[0]); 1163var model = compilation.GetSemanticModel(compilation.SyntaxTrees[0]); 1211var model = compilation.GetSemanticModel(compilation.SyntaxTrees[0]); 1264var model = compilation.GetSemanticModel(compilation.SyntaxTrees[0]);
Semantics\BindingAsyncTests.cs (2)
56var model = compilation.GetSemanticModel(tree); 85var model = compilation.GetSemanticModel(tree);
Semantics\BindingTests.cs (18)
2364var model = comp.GetSemanticModel(tree); 2383var model = comp.GetSemanticModel(tree); 2720var model = compilation.GetSemanticModel(tree); 2776var model = compilation.GetSemanticModel(tree); 2831var model = compilation.GetSemanticModel(tree); 2887var model = compilation.GetSemanticModel(tree); 2924var model = comp.GetSemanticModel(tree); 2966var model = comp.GetSemanticModel(tree); 3035var model = comp.GetSemanticModel(tree); 3115var model = comp.GetSemanticModel(tree); 3188var model = comp.GetSemanticModel(tree); 3273var model = comp.GetSemanticModel(tree); 3378var model = comp.GetSemanticModel(tree); 3730var model = comp.GetSemanticModel(tree); 3911var model = comp.GetSemanticModel(tree); 3937var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 3984var model = comp.GetSemanticModel(tree); 4025var model = comp.GetSemanticModel(tree);
Semantics\ColorColorTests.cs (19)
590var model = comp.GetSemanticModel(tree); 635var model = comp.GetSemanticModel(tree); 726var model = comp.GetSemanticModel(tree); 1064var model = comp.GetSemanticModel(tree); 1110var model = comp.GetSemanticModel(tree); 1156var model = comp.GetSemanticModel(tree); 1201var model = comp.GetSemanticModel(tree); 1242var model = comp.GetSemanticModel(tree); 1279var model = comp.GetSemanticModel(tree); 1815var semanticModel = comp.GetSemanticModel(syntaxTree, false); 1842var model = comp.GetSemanticModel(tree); 1881var model1 = compilation.GetSemanticModel(tree); 1891var model2 = compilation.GetSemanticModel(tree); 1938var model1 = compilation.GetSemanticModel(tree); 1948var model2 = compilation.GetSemanticModel(tree); 1995var model1 = compilation.GetSemanticModel(tree); 2005var model2 = compilation.GetSemanticModel(tree); 2045var model1 = compilation.GetSemanticModel(tree); 2054var model2 = compilation.GetSemanticModel(tree);
Semantics\ConditionalOperatorTests.cs (4)
1295var model = comp.GetSemanticModel(tree); 1352var model = compilation.GetSemanticModel(tree); 1408var model = compilation.GetSemanticModel(tree); 1455var model = compilation.GetSemanticModel(tree);
Semantics\ConstantTests.cs (3)
3520var model = comp.GetSemanticModel(tree); 4080var model = comp.GetSemanticModel(tree); 4101var model = comp.GetSemanticModel(tree);
Semantics\DeconstructionTests.cs (26)
1838var model = comp.Compilation.GetSemanticModel(tree, ignoreAccessibility: false); 3764var model = compilation.GetSemanticModel(tree); 3942var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 4168var model = comp.GetSemanticModel(tree); 4236var model = comp.GetSemanticModel(tree); 4371var model = comp.GetSemanticModel(tree); 4505var model = comp.GetSemanticModel(tree); 4663var model = comp.GetSemanticModel(tree); 4721var model = comp1.GetSemanticModel(tree); 4757var model = comp.GetSemanticModel(tree); 4835var model = comp.GetSemanticModel(tree); 4940var model = comp.GetSemanticModel(tree); 4986var model = comp.GetSemanticModel(tree); 5044var model = comp.GetSemanticModel(tree); 5185var model = comp.GetSemanticModel(tree); 5329var model = comp.GetSemanticModel(tree); 5476var model = comp.GetSemanticModel(tree); 5653var model = comp.GetSemanticModel(tree); 5763var model = comp.GetSemanticModel(tree); 5876var model = comp.GetSemanticModel(tree); 5985var model = comp.GetSemanticModel(tree); 6028var model = comp.GetSemanticModel(tree); 6068var model = comp.GetSemanticModel(tree); 6110var model = comp.GetSemanticModel(tree); 6150var model = comp.GetSemanticModel(tree); 6553var model = comp.GetSemanticModel(tree);
Semantics\DelegateTypeTests.cs (64)
748var model = comp.GetSemanticModel(tree); 794var model = comp.GetSemanticModel(tree); 894var model = comp.GetSemanticModel(tree); 937var model = comp.GetSemanticModel(tree); 995var model = comp.GetSemanticModel(tree); 1035var model = comp.GetSemanticModel(tree); 1210var model = comp.GetSemanticModel(tree); 1246var model = comp.GetSemanticModel(tree); 1331var model = comp.GetSemanticModel(tree); 1371var model = comp.GetSemanticModel(tree); 1414var model = comp.GetSemanticModel(tree); 1458var model = comp.GetSemanticModel(tree); 1553var model = comp.GetSemanticModel(tree); 1633var model = comp.GetSemanticModel(tree); 1683var model = comp.GetSemanticModel(tree); 1733var model = comp.GetSemanticModel(tree); 1783var model = comp.GetSemanticModel(tree); 1833var model = comp.GetSemanticModel(tree); 1883var model = comp.GetSemanticModel(tree); 1933var model = comp.GetSemanticModel(tree); 1979var model = comp.GetSemanticModel(tree); 2027var model = comp.GetSemanticModel(tree); 2081var model = comp.GetSemanticModel(tree); 2146var model = comp.GetSemanticModel(tree); 2208var model = comp.GetSemanticModel(tree); 2267var model = comp.GetSemanticModel(tree); 2316var model = comp.GetSemanticModel(tree); 2355var model = comp.GetSemanticModel(tree); 2398var model = comp.GetSemanticModel(tree); 2466var model = comp.GetSemanticModel(tree); 2518var model = comp.GetSemanticModel(tree); 2567var model = comp.GetSemanticModel(tree); 2615var model = comp.GetSemanticModel(tree); 2667var model = comp.GetSemanticModel(tree); 2713var model = comp.GetSemanticModel(tree); 2761var model = comp.GetSemanticModel(tree); 2808var model = comp.GetSemanticModel(tree); 2854var model = comp.GetSemanticModel(tree); 2905var model = comp.GetSemanticModel(tree); 2933var model = comp.GetSemanticModel(tree); 2964var model = comp.GetSemanticModel(tree); 2992var model = comp.GetSemanticModel(tree); 3021var model = comp.GetSemanticModel(tree); 3054var model = comp.GetSemanticModel(tree); 3085var model = comp.GetSemanticModel(tree); 3116var model = comp.GetSemanticModel(tree); 3149var model = comp.GetSemanticModel(tree); 3632var model = comp.GetSemanticModel(tree); 3674var model = comp.GetSemanticModel(tree); 8099var model = comp.GetSemanticModel(tree); 8122var model = comp.GetSemanticModel(tree); 10457var model = comp.GetSemanticModel(tree); 10467static (string?, string?, string?) getVariableInfo(SemanticModel model, VariableDeclaratorSyntax variable) 11155var model = comp.GetSemanticModel(tree); 11241var model = comp.GetSemanticModel(tree); 12181var model = comp.GetSemanticModel(syntaxTree); 12189static void speculate(SemanticModel? model, int position, string text, string expectedDelegateType) 14451private static void VerifyLocalDelegateType(SemanticModel model, VariableDeclaratorSyntax variable, string expectedInvokeMethod) 14469private static void VerifyExpressionType(SemanticModel model, ExpressionSyntax variable, string expectedSymbol, string expectedInvokeMethod) 14803var model = comp.GetSemanticModel(tree); 14850var model = comp.GetSemanticModel(tree); 14863static void verifyConversions(SemanticModel model, ExpressionSyntax expr, ITypeSymbol destination, ConversionKind expectedImplicitKind, ConversionKind expectedExplicitKind) 19870var model = comp.GetSemanticModel(tree); 19912var model = comp.GetSemanticModel(tree);
Semantics\DynamicTests.cs (85)
3858var model = verifier.Compilation.GetSemanticModel(tree); 3891var model = verifier.Compilation.GetSemanticModel(tree); 3919var model = verifier.Compilation.GetSemanticModel(tree); 3947var model = verifier.Compilation.GetSemanticModel(tree); 3998var model = verifier.Compilation.GetSemanticModel(tree); 4977var model = comp1.GetSemanticModel(tree); 5101var model = comp1.GetSemanticModel(tree); 5224var model = comp1.GetSemanticModel(tree); 5342var model = comp1.GetSemanticModel(tree); 5383var model = comp1.GetSemanticModel(tree); 5427var model = comp1.GetSemanticModel(tree); 5471var model = comp1.GetSemanticModel(tree); 5515var model = comp1.GetSemanticModel(tree); 5579var model = comp.GetSemanticModel(tree); 5617var model = comp.GetSemanticModel(tree); 5656var model = comp.GetSemanticModel(tree); 5692var model = comp.GetSemanticModel(tree); 5733var model = comp1.GetSemanticModel(tree); 5778var model = comp1.GetSemanticModel(tree); 5823var model = comp1.GetSemanticModel(tree); 5868var model = comp1.GetSemanticModel(tree); 5936var model = comp.GetSemanticModel(tree); 5975var model = comp.GetSemanticModel(tree); 6023var model = comp.GetSemanticModel(tree); 6146var model = comp.GetSemanticModel(tree); 6266var model = comp.GetSemanticModel(tree); 6378var model = comp1.GetSemanticModel(tree); 6420var model = comp1.GetSemanticModel(tree); 6467var model = comp1.GetSemanticModel(tree); 6511var model = comp1.GetSemanticModel(tree); 6553var model = comp.GetSemanticModel(tree); 6607var model = comp.GetSemanticModel(tree); 6672var model = comp.GetSemanticModel(tree); 6781var model = comp.GetSemanticModel(tree); 6891var model = comp.GetSemanticModel(tree); 6992var model = comp.GetSemanticModel(tree); 7060var model = comp.GetSemanticModel(tree); 7163var model = comp.GetSemanticModel(tree); 7276var model = comp.GetSemanticModel(tree); 7392var model = comp.GetSemanticModel(tree); 7505var model = comp.GetSemanticModel(tree); 7582var model = comp.GetSemanticModel(tree); 7687var model = comp.GetSemanticModel(tree); 7793var model = comp.GetSemanticModel(tree); 7896var model = comp.GetSemanticModel(tree); 7968var model = comp.GetSemanticModel(tree); 8074var model = comp.GetSemanticModel(tree); 8179var model = comp.GetSemanticModel(tree); 8284var model = comp.GetSemanticModel(tree); 8393var model = comp.GetSemanticModel(tree); 8502var model = comp.GetSemanticModel(tree); 8612var model = comp.GetSemanticModel(tree); 8725var model = comp.GetSemanticModel(tree); 8794var model = comp.GetSemanticModel(tree); 8862var model = comp.GetSemanticModel(tree); 8924var model = comp.GetSemanticModel(tree); 9014var model = comp.GetSemanticModel(tree); 9105var model = comp.GetSemanticModel(tree); 9195var model = comp.GetSemanticModel(tree); 9251var model = comp.GetSemanticModel(tree); 9312var model = comp.GetSemanticModel(tree); 9433var model = comp.GetSemanticModel(tree); 9553var model = comp.GetSemanticModel(tree); 9667var model = comp.GetSemanticModel(tree); 9778var model = comp.GetSemanticModel(tree); 9889var model = comp.GetSemanticModel(tree); 10010var model = comp.GetSemanticModel(tree); 10138var model = comp.GetSemanticModel(tree); 10266var model = comp.GetSemanticModel(tree); 10420var model = comp.GetSemanticModel(tree); 10554var model = comp.GetSemanticModel(tree); 10702var model = comp.GetSemanticModel(tree); 10972var model = comp.GetSemanticModel(tree); 11101var model = comp.GetSemanticModel(tree); 11185var model = comp.GetSemanticModel(tree); 11263var model = comp.GetSemanticModel(tree); 11318var model = comp1.GetSemanticModel(tree); 11371var model = comp1.GetSemanticModel(tree); 11417var model = comp1.GetSemanticModel(tree); 11451var model = comp1.GetSemanticModel(tree); 11495var model = comp.GetSemanticModel(tree); 11536var model = comp1.GetSemanticModel(tree); 11585var model = comp.GetSemanticModel(tree); 11637var model = comp.GetSemanticModel(tree); 11681var model = comp1.GetSemanticModel(tree);
Semantics\ExpressionBodiedMemberTests.cs (16)
39var model = comp.GetSemanticModel(tree); 424var model = comp.GetSemanticModel(tree); 473var model = comp.GetSemanticModel(tree); 504var model = comp.GetSemanticModel(tree); 533var model = comp.GetSemanticModel(tree); 573var model = comp.GetSemanticModel(tree); 647var model = comp.GetSemanticModel(tree); 678var model = comp.GetSemanticModel(tree); 709var model = comp.GetSemanticModel(tree); 740var model = comp.GetSemanticModel(tree); 775var model = comp.GetSemanticModel(tree); 806var model = comp.GetSemanticModel(tree); 837var model = comp.GetSemanticModel(tree); 872var model = comp.GetSemanticModel(tree); 911var model = comp.GetSemanticModel(tree); 1019var model = comp.GetSemanticModel(tree);
Semantics\ForEachTests.cs (6)
2643var model = comp.GetSemanticModel(tree); 2695var model = comp.GetSemanticModel(tree); 3399var model = comp.GetSemanticModel(tree); 3841var model = comp.GetSemanticModel(tree); 3875var model = comp.GetSemanticModel(tree); 3938var model = compilation.GetSemanticModel(tree);
Semantics\FunctionPointerTests.cs (47)
199var model = comp.GetSemanticModel(tree); 208static void assertResult(SemanticModel model, ExpressionSyntax initializer1, Compilation comp) 291var model = comp.GetSemanticModel(tree); 349var model = comp.GetSemanticModel(tree); 400var model = comp.GetSemanticModel(tree); 452var model = comp.GetSemanticModel(tree); 500var model = comp.GetSemanticModel(tree); 598var model = comp.GetSemanticModel(tree); 837var model = comp.GetSemanticModel(tree); 880var model = comp.GetSemanticModel(tree); 899private static void VerifyDeclarationConversion(CSharpCompilation comp, SemanticModel model, VariableDeclaratorSyntax decl, ConversionKind expectedConversionKind, bool expectedImplicit, string expectedOriginalType, string expectedConvertedType, string expectedOperationTree) 940var model = comp.GetSemanticModel(tree); 976var model = comp.GetSemanticModel(tree); 1044var model = comp.GetSemanticModel(tree); 1124var model = comp.GetSemanticModel(tree); 1269var model = comp.GetSemanticModel(tree); 1364var model = comp.GetSemanticModel(tree); 1505var model = comp.GetSemanticModel(tree); 1562var model = comp.GetSemanticModel(tree); 1613var model = comp.GetSemanticModel(tree); 1661var model = comp.GetSemanticModel(tree); 1694var model = comp.GetSemanticModel(tree); 1727var model = comp.GetSemanticModel(tree); 1773var model = comp.GetSemanticModel(tree); 1821var model = comp.GetSemanticModel(tree); 1854var model = comp.GetSemanticModel(tree); 1887var model = comp.GetSemanticModel(tree); 1934var model = comp.GetSemanticModel(tree); 2053var model = comp.GetSemanticModel(tree); 2086var model = comp.GetSemanticModel(tree); 2223var model = comp.GetSemanticModel(tree); 2280var model = comp.GetSemanticModel(tree); 2353var model = comp.GetSemanticModel(tree); 2427var model = comp.GetSemanticModel(tree); 2495var model = comp.GetSemanticModel(tree); 2592var model = comp.GetSemanticModel(tree); 2665var model = comp.GetSemanticModel(tree); 3176var model = comp.GetSemanticModel(tree); 3295var model = comp.GetSemanticModel(tree); 3374var model = comp.GetSemanticModel(syntaxTree); 3431var model = comp.GetSemanticModel(syntaxTree); 3473var model = comp.GetSemanticModel(syntaxTree); 3526var model = comp.GetSemanticModel(syntaxTree); 3580var model = comp.GetSemanticModel(syntaxTree); 3675var model = comp.GetSemanticModel(syntaxTree); 3803var model = comp.GetSemanticModel(syntaxTree); 3948var model = comp.GetSemanticModel(syntaxTree);
Semantics\FuzzTests.cs (1)
52var model = compilation.GetSemanticModel(tree);
Semantics\GenericConstraintsTests.cs (5)
2876var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 3138var model = compilation.GetSemanticModel(tree); 3168var model = compilation.GetSemanticModel(tree); 3194var model = compilation.GetSemanticModel(tree); 3223var model = compilation.GetSemanticModel(tree);
Semantics\GlobalUsingDirectiveTests.cs (3)
3841var model = comp.GetSemanticModel(tree); 4244var model = comp.GetSemanticModel(tree); 4978var model = comp.GetSemanticModel(tree);
Semantics\ImplicitlyTypeArraysTests.cs (2)
65var model = comp.GetSemanticModel(tree); 91var model = comp.GetSemanticModel(tree);
Semantics\ImplicitObjectCreationTests.cs (28)
50var model = comp.GetSemanticModel(tree); 125var model = comp.GetSemanticModel(tree); 172var model = comp.GetSemanticModel(tree); 222var model = comp.GetSemanticModel(tree); 836var model = comp.GetSemanticModel(tree); 877var model = comp.GetSemanticModel(tree); 1699var model = comp.GetSemanticModel(tree); 1859var model = comp.GetSemanticModel(tree); 1889var model = comp.GetSemanticModel(tree); 1919var model = comp.GetSemanticModel(tree); 1971var model = comp.GetSemanticModel(tree); 2029var model = comp.GetSemanticModel(tree); 2064var model = comp.GetSemanticModel(tree); 2118var model = comp.GetSemanticModel(tree); 2210var model = comp.GetSemanticModel(tree); 2504var model = comp.GetSemanticModel(tree); 2555var model = comp.GetSemanticModel(tree); 2912var model = comp.GetSemanticModel(tree); 3205var model = comp.GetSemanticModel(tree); 4147var model = comp.GetSemanticModel(tree); 4174var model = comp.GetSemanticModel(tree); 4181bool success = model.TryGetSpeculativeSemanticModel(nodeLocation, modifiedNode, out var speculativeModel); 4520var semanticModel = compilation.GetSemanticModel(tree); 4563var semanticModel = compilation.GetSemanticModel(tree); 4600var model = comp.GetSemanticModel(tree); 4632var model = comp.GetSemanticModel(tree); 4664var model = comp.GetSemanticModel(tree); 4702var model = comp.GetSemanticModel(tree);
Semantics\IndexAndRangeTests.cs (9)
896var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 916var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 937var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 1120var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 1249var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 1282var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 1315var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 1339var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 1382var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true);
Semantics\InitOnlyMemberTests.cs (5)
2519var model = comp.GetSemanticModel(tree, ignoreAccessibility: true); 3138var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 3144SemanticModel speculativeModel; 3190var model = comp.GetSemanticModel(tree); 4141var model = comp.GetSemanticModel(tree);
Semantics\InteractiveSemanticModelTests.cs (2)
42var model = compilation.GetSemanticModel(tree); 359var model = compilation.GetSemanticModel(tree);
Semantics\InteractiveUsingTests.cs (4)
86var model = sub.GetSemanticModel(tree); 116var model = sub4.GetSemanticModel(tree); 583var model = comp.GetSemanticModel(tree); 593var model = comp.GetSemanticModel(tree);
Semantics\InterceptorsTests.cs (40)
45var model = comp.GetSemanticModel(tree); 216var model = comp.GetSemanticModel(source); 2022var model = comp.GetSemanticModel(source); 2325var model = comp.GetSemanticModel(source); 5271var model = comp.GetSemanticModel(tree); 6189var model = comp.GetSemanticModel(source); 6720var model = comp.GetSemanticModel(tree); 6769var model = comp.GetSemanticModel(tree); 6829var model = comp.GetSemanticModel(tree); 6876var model = comp.GetSemanticModel(tree); 6929var model = comp.GetSemanticModel(tree); 6978var model = comp.GetSemanticModel(tree); 7034var model = comp.GetSemanticModel(tree); 7082var model = comp.GetSemanticModel(tree); 7129var model = comp.GetSemanticModel(tree); 7173var model = comp.GetSemanticModel(tree); 7201var model = comp.GetSemanticModel(tree); 7260var model = comp.GetSemanticModel(tree); 7303var model = comp.GetSemanticModel(tree); 7335var model = comp.GetSemanticModel(source); 7385var model = comp.GetSemanticModel(tree); 7537var model = comp.GetSemanticModel(source); 7578var model = comp.GetSemanticModel(sourceTree1); 7624var model = comp.GetSemanticModel(source); 7670var model = comp.GetSemanticModel(source); 7721var model = comp.GetSemanticModel(tree); 7746var model = comp.GetSemanticModel(source); 7792var model = comp.GetSemanticModel(source); 7874var model = comp.GetSemanticModel(source); 7918var model = comp.GetSemanticModel(source); 7961var model = comp.GetSemanticModel(source); 8014var model = comp.GetSemanticModel(source); 8060var model = comp.GetSemanticModel(source); 8119var model = comp.GetSemanticModel(source); 8179var model = comp.GetSemanticModel(source); 8234var model = comp.GetSemanticModel(source); 8289var model = comp.GetSemanticModel(source); 8339var model = comp.GetSemanticModel(source); 8397var model = comp.GetSemanticModel(source); 8461var model = comp.GetSemanticModel(source);
Semantics\InterpolationTests.cs (5)
4599var model = comp.GetSemanticModel(tree); 4825var model = comp.GetSemanticModel(tree); 19476var model = comp.GetSemanticModel(tree); 19532var model = comp.GetSemanticModel(tree); 19596var model = comp.GetSemanticModel(tree);
Semantics\IteratorTests.cs (3)
561var model = comp.GetSemanticModel(tree); 711var model = comp.GetSemanticModel(tree); 749var model = comp.GetSemanticModel(tree);
Semantics\LambdaDiscardParametersTests.cs (8)
69var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 110private static void VerifyDiscardParameterSymbol(ParameterSyntax underscore, string expectedType, CodeAnalysis.NullableAnnotation expectedAnnotation, SemanticModel model) 385var model = comp.GetSemanticModel(tree); 418var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 447var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 481var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 512var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 567var model = comp.GetSemanticModel(tree, ignoreAccessibility: false);
Semantics\LambdaTests.cs (69)
838var model = comp.GetSemanticModel(tree); 938var model = compilation.GetSemanticModel(tree); 1030var model = compilation.GetSemanticModel(tree); 1084var model = compilation.GetSemanticModel(tree); 1119var model = compilation.GetSemanticModel(tree); 1175var model = comp.GetSemanticModel(tree); 1203var model = comp.GetSemanticModel(tree); 1235var model = comp.GetSemanticModel(tree); 1516var semanticModel = compilation.GetSemanticModel(tree); 1551var semanticModel = compilation.GetSemanticModel(tree); 1585var semanticModel = compilation.GetSemanticModel(tree); 1617var semanticModel = compilation.GetSemanticModel(tree); 1976var model = compilation.GetSemanticModel(tree); 2118var sm = compilation.GetSemanticModel(tree); 2164var sm = compilation.GetSemanticModel(tree); 2210var sm = compilation.GetSemanticModel(tree); 2256var sm = compilation.GetSemanticModel(tree); 2302var sm = compilation.GetSemanticModel(tree); 2332var sm = compilation.GetSemanticModel(tree); 2359var sm = compilation.GetSemanticModel(tree); 2413var sm = compilation.GetSemanticModel(tree); 2459var sm = compilation.GetSemanticModel(tree); 2505var sm = compilation.GetSemanticModel(tree); 2538var sm = compilation.GetSemanticModel(tree); 2571var sm = compilation.GetSemanticModel(tree); 2608var sm = compilation.GetSemanticModel(tree); 2660var sm = compilation.GetSemanticModel(tree); 2995var model = comp.GetSemanticModel(tree); 3037var model = comp.GetSemanticModel(tree); 3607var model = comp.GetSemanticModel(tree); 3888var model = comp.GetSemanticModel(tree); 3932var model = comp.GetSemanticModel(tree); 3972var model = comp.GetSemanticModel(tree); 4086var model = comp.GetSemanticModel(tree); 4115var model = comp.GetSemanticModel(tree); 4150var model = comp.GetSemanticModel(tree); 4178var model = comp.GetSemanticModel(tree); 4205var model = comp.GetSemanticModel(tree); 4780var model = comp.GetSemanticModel(tree); 4865var model = comp.GetSemanticModel(tree); 4920var model = comp.GetSemanticModel(tree); 4947var model = comp.GetSemanticModel(tree); 4975var model = comp.GetSemanticModel(tree); 5021var model = comp.GetSemanticModel(tree); 5627var model = comp.GetSemanticModel(tree); 6216private static LambdaSymbol GetLambdaSymbol(SemanticModel model, LambdaExpressionSyntax syntax) 6503var model = comp.GetSemanticModel(tree); 6813var model = comp.GetSemanticModel(tree); 6842var model = comp.GetSemanticModel(tree); 6888var model = comp.GetSemanticModel(tree); 7004var model = comp.GetSemanticModel(syntaxTree); 7097var model = comp.GetSemanticModel(syntaxTree); 7623var model = comp.GetSemanticModel(tree); 7997var model = comp.GetSemanticModel(tree); 8045var model = comp.GetSemanticModel(tree); 8069var model = comp.GetSemanticModel(tree); 8074Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(m2Syntax.Body.SpanStart, newMethod, out var speculativeModel)); 8105var model = comp.GetSemanticModel(tree); 8217var model = comp.GetSemanticModel(tree); 8347var model = comp.GetSemanticModel(tree); 8380var model = comp.GetSemanticModel(tree); 8848var model1 = comp.GetSemanticModel(tree1); 8863Assert.True(model1.TryGetSpeculativeSemanticModelForMethodBody(method1.Body.SpanStart, method2, out var model2)); 8899var semanticModel = compilation.GetSemanticModel(tree); 9007var semanticModel = compilation.GetSemanticModel(tree); 9036var semanticModel = compilation.GetSemanticModel(tree); 9063var semanticModel = compilation.GetSemanticModel(tree); 9093var semanticModel = compilation.GetSemanticModel(tree); 9120var semanticModel = compilation.GetSemanticModel(tree);
Semantics\LocalFunctionTests.cs (58)
339var model = comp.GetSemanticModel(tree, ignoreAccessibility: true); 387var model = comp.GetSemanticModel(tree); 434var model = comp.GetSemanticModel(tree, ignoreAccessibility: true); 440Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(mMethod.Body.SpanStart, mMethod, out var newModel)); 443static void validate(SemanticModel model, SyntaxTree tree) 485var model = comp.GetSemanticModel(tree); 533var model = comp.GetSemanticModel(tree); 610var model = comp.GetSemanticModel(tree); 663var model = comp.GetSemanticModel(tree); 717var model = comp.GetSemanticModel(tree); 797var model = comp.GetSemanticModel(tree); 844var model = comp.GetSemanticModel(tree); 963var model = comp.GetSemanticModel(tree); 1014var model = comp.GetSemanticModel(tree); 1052var model = comp.GetSemanticModel(tree); 1712var model = comp.GetSemanticModel(tree); 1759var model = comp.GetSemanticModel(tree); 1834var model = comp.GetSemanticModel(tree); 1919var model = comp.GetSemanticModel(tree); 1969var model = comp.GetSemanticModel(tree); 2364var model = comp.GetSemanticModel(tree); 2580var model = comp.GetSemanticModel(tree); 2878var model1 = comp.GetSemanticModel(tree1); 2893Assert.True(model1.TryGetSpeculativeSemanticModelForMethodBody(method1.Body.SpanStart, method2, out var model2)); 4992var model = compilation.GetSemanticModel(tree); 5030var model = compilation.GetSemanticModel(tree); 5267var model = compilation.GetSemanticModel(tree); 5408var model = comp.GetSemanticModel(tree); 6664var model = comp.GetSemanticModel(tree); 6685var model = comp.GetSemanticModel(tree); 6713var model = comp.GetSemanticModel(tree); 6749var model = comp.GetSemanticModel(tree); 6793var model = comp.GetSemanticModel(tree); 6840var model = comp.GetSemanticModel(tree); 7342var model = comp.GetSemanticModel(tree); 7402var model = comp.GetSemanticModel(tree); 7651var parentModel = comp.GetSemanticModel(tree); 7668static void VerifyTParameterSpeculation(SemanticModel parentModel, int localFuncPosition, AttributeSyntax attr1, bool found = true) 7670SemanticModel speculativeModel; 7736var parentModel = comp.GetSemanticModel(tree); 7801var parentModel = comp.GetSemanticModel(tree); 7875var parentModel = comp.GetSemanticModel(tree); 7943var model = comp.GetSemanticModel(tree); 8988var model = comp.GetSemanticModel(tree); 9041var model = comp.GetSemanticModel(tree); 9045Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(method.Body.SpanStart, method, out var speculativeModel)); 9083var model = comp.GetSemanticModel(tree); 9231var parentModel = comp.GetSemanticModel(tree); 9249static void VerifyParameterSpeculation(SemanticModel parentModel, int localFuncPosition, AttributeSyntax attr1, bool found = true) 9251SemanticModel speculativeModel; 9735var parentModel = comp.GetSemanticModel(tree); 9856var model = comp.GetSemanticModel(tree); 10053var parentModel = comp.GetSemanticModel(tree); 10476var model = comp.GetSemanticModel(tree); 10685var semanticModel = compilation.GetSemanticModel(tree); 10729var model = comp.GetSemanticModel(tree); 11046var semanticModel = comp.GetSemanticModel(syntaxTree); 11087var semanticModel = comp.GetSemanticModel(syntaxTree);
Semantics\LockTests.cs (7)
43var model = compilation.GetSemanticModel(tree); 487var model = compilation.GetSemanticModel(tree); 549var model = compilation.GetSemanticModel(tree); 573var model = compilation.GetSemanticModel(tree); 603var model = compilation.GetSemanticModel(tree); 627var model = compilation.GetSemanticModel(tree); 697var model = compilation.GetSemanticModel(tree);
Semantics\LookupPositionTests.cs (6)
2272var model = (Microsoft.CodeAnalysis.SemanticModel)(compilation.GetSemanticModel(tree)); 2300var model = compilation.GetSemanticModel(tree); 3065var model = GetModelAndKeyPositions(text, out keyPositions); 3089private static SemanticModel GetModelAndKeyPositions(string markedText, out int[] keyPositions) 3124private static void CheckSymbols(SemanticModel model, int keyPositionNum, int position, IEnumerable<string> expectedSymbols)
Semantics\LookupTests.cs (24)
29var model = compilation.GetSemanticModel(tree); 38var model = compilation.GetSemanticModel(tree); 426var model = comp.GetSemanticModel(tree); 582var model = comp.GetSemanticModel(tree); 622var model = compilation.GetSemanticModel(tree); 679var model = compilation.GetSemanticModel(tree); 1368var model = comp.GetSemanticModel(tree); 1500var model = compilation.GetSemanticModel(tree); 1561var model = compilation.GetSemanticModel(tree); 1593var model = compilation.GetSemanticModel(tree); 1641var model = compilation.GetSemanticModel(tree); 1642SemanticModel imodel = model; 1668var model = compilation.GetSemanticModel(tree); 1669SemanticModel imodel = model; 1723var model = comp.GetSemanticModel(tree); 1757var model = comp.GetSemanticModel(tree); 1788var model = comp.GetSemanticModel(tree); 1820var model = comp.GetSemanticModel(tree); 1981var model = comp.GetSemanticModel(tree); 2012var model = comp.GetSemanticModel(tree); 2042var model = comp.GetSemanticModel(tree); 2072var model = comp.GetSemanticModel(tree); 2098var model = comp.GetSemanticModel(tree); 2121var model = comp.GetSemanticModel(tree);
Semantics\MethodTypeInferenceTests.cs (10)
700var model = comp.GetSemanticModel(tree); 755var model = comp.GetSemanticModel(tree); 801var model = comp.GetSemanticModel(tree); 839private static void CheckDiscard(SemanticModel model, DiscardDesignationSyntax discard, string type) 849private static void CheckDiscard(SemanticModel model, IdentifierNameSyntax discard, string type) 1045var model = comp.GetSemanticModel(tree); 1075var model = comp.GetSemanticModel(tree); 1117var model = compilation.GetSemanticModel(tree); 1158var model = compilation.GetSemanticModel(tree); 1199var model = compilation.GetSemanticModel(tree);
Semantics\NameOfTests.cs (18)
685var model = compilation.GetSemanticModel(tree); 711var model = compilation.GetSemanticModel(tree); 746var model = compilation.GetSemanticModel(tree); 793var model = compilation.GetSemanticModel(tree); 830var model = compilation.GetSemanticModel(tree); 866var model = compilation.GetSemanticModel(tree); 912var model = compilation.GetSemanticModel(tree); 945var model = compilation.GetSemanticModel(tree); 985var model = comp.GetSemanticModel(tree); 1001Assert.True(model.TryGetSpeculativeSemanticModel(initializer.Position, initializer, out var model2)); 1057var model = comp.GetSemanticModel(tree); 1072Assert.True(model.TryGetSpeculativeSemanticModel(initializer.Position, initializer, out var model2)); 1139var model = comp.GetSemanticModel(tree); 1158Assert.True(model.TryGetSpeculativeSemanticModel(initializer.Position, initializer, out var model2)); 1220var model = comp.GetSemanticModel(tree); 1236Assert.True(model.TryGetSpeculativeSemanticModel(initializer.Position, initializer, out var model2)); 1422var model = compilation.GetSemanticModel(tree); 3040var semanticModel = compilation.GetSemanticModel(tree);
Semantics\NativeIntegerTests.cs (19)
1793var model = comp.GetSemanticModel(tree); 2350var model = comp.GetSemanticModel(tree); 2470var model = compB.GetSemanticModel(tree); 3640var model = comp.GetSemanticModel(tree); 4079var model = comp.GetSemanticModel(tree); 4122var model = comp.GetSemanticModel(tree); 6065var model = comp.GetSemanticModel(tree); 6113var model = comp.GetSemanticModel(tree); 9499var model = comp.GetSemanticModel(tree); 9734var model = comp.GetSemanticModel(tree); 10108var model = comp.GetSemanticModel(tree); 10335var model = comp.GetSemanticModel(tree); 12385var model = comp.GetSemanticModel(tree); 15325var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 15346var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 15369var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 15397var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 15420var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 15450var model = comp.GetSemanticModel(tree, ignoreAccessibility: false);
Semantics\NonTrailingNamedArgumentsTests.cs (15)
44var model = verifier.Compilation.GetSemanticModel(tree); 366var model = comp.GetSemanticModel(tree); 392var model = verifier.Compilation.GetSemanticModel(tree); 422var model = comp.GetSemanticModel(tree); 454var model = comp.GetSemanticModel(tree); 483var model = comp.GetSemanticModel(tree); 533var model = comp.GetSemanticModel(tree); 568var model = comp.GetSemanticModel(tree); 597var model = comp.GetSemanticModel(tree); 651var model = comp.GetSemanticModel(tree); 678var model = comp.GetSemanticModel(tree); 709var model = comp.GetSemanticModel(tree); 743var model = verifier.Compilation.GetSemanticModel(tree); 775var model = verifier.Compilation.GetSemanticModel(tree); 982var model = comp.GetSemanticModel(tree);
Semantics\NullableContextTests.cs (14)
65var model = comp.GetSemanticModel(syntaxTree); 98var model1 = comp.GetSemanticModel(syntaxTree1); 100var model2 = comp.GetSemanticModel(syntaxTree2); 349var model = comp.GetSemanticModel(syntaxTree); 388var model = comp.GetSemanticModel(syntaxTree); 423var model = comp.GetSemanticModel(syntaxTree); 1770var model = comp.GetSemanticModel(syntaxTree); 1840var model = comp.GetSemanticModel(syntaxTree); 1877var model = comp.GetSemanticModel(syntaxTree); 1926var model = comp.GetSemanticModel(syntaxTree); 1968var model = comp.GetSemanticModel(syntaxTree); 2008var model = comp.GetSemanticModel(syntaxTree); 2047var model = comp.GetSemanticModel(syntaxTree); 2227var model = comp.GetSemanticModel(syntaxTree);
Semantics\NullableReferenceTypesTests.cs (118)
1752var model = comp.GetSemanticModel(tree); 1786var model = comp.GetSemanticModel(tree); 1798private static void VerifyTypeInfo(SemanticModel model, ExpressionSyntax expression, string expectedType, string expectedConvertedType) 1839var model = comp.GetSemanticModel(tree); 1866var model = comp.GetSemanticModel(tree); 1891var model = comp.GetSemanticModel(tree); 1961var model = comp.GetSemanticModel(tree); 2274var model = comp.GetSemanticModel(tree); 2313var model = comp.GetSemanticModel(tree); 2346var model = comp.GetSemanticModel(tree); 2379var model = comp.GetSemanticModel(tree); 2478var model = comp.GetSemanticModel(tree); 3340var sm = compilation.GetSemanticModel(tree); 3699var model = comp.GetSemanticModel(tree); 4532var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 4568var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 4600var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 5177var model = comp.GetSemanticModel(syntaxTree); 10537var model = compilation.GetSemanticModel(tree); 13514var model = compilation.GetSemanticModel(tree); 35011var model = compilation.GetSemanticModel(tree); 35028var model = compilation.GetSemanticModel(tree); 56158var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56188var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56221var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56258var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56293var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56327var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56358var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56386var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56425var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56459var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56490var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56519var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56554var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56590var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56669var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 56701var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 59099var model = comp.GetSemanticModel(tree); 59133var model = comp.GetSemanticModel(tree); 59161var model = comp.GetSemanticModel(tree); 59193var model = comp.GetSemanticModel(tree); 59222var model = comp.GetSemanticModel(tree); 59255var model = comp.GetSemanticModel(tree); 59287var model = comp.GetSemanticModel(tree); 59320var model = comp.GetSemanticModel(tree); 59354var model = comp.GetSemanticModel(tree); 59380var model = comp.GetSemanticModel(tree); 59409var model = comp.GetSemanticModel(tree); 59438var model = comp.GetSemanticModel(tree); 62922var model = comp.GetSemanticModel(syntaxTree); 65971var model1 = comp1.GetSemanticModel(tree1); 65980Assert.True(model1.TryGetSpeculativeSemanticModel(function1.SpanStart, function2, out var model2)); 71357var model = comp.GetSemanticModel(tree); 71393var model = comp.GetSemanticModel(tree); 71434var model = comp.GetSemanticModel(tree); 71471var model = comp.GetSemanticModel(tree); 71508var model = comp.GetSemanticModel(tree); 71543var model = comp.GetSemanticModel(tree); 71576var model = comp.GetSemanticModel(tree); 71613var model = comp.GetSemanticModel(tree); 71887var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 71979var model = comp.GetSemanticModel(tree); 72026var model = comp.GetSemanticModel(tree); 72065var model = comp.GetSemanticModel(tree); 73866var model = comp.GetSemanticModel(tree); 81362var model = comp.GetSemanticModel(tree); 94406var model = comp.GetSemanticModel(syntaxTree); 97881var model = comp.GetSemanticModel(tree); 99210var model = comp.GetSemanticModel(tree); 111894var model = comp.GetSemanticModel(tree); 111948var model = comp.GetSemanticModel(tree); 113317var model = comp.GetSemanticModel(tree); 113718var model = comp.GetSemanticModel(tree); 113749var model = comp.GetSemanticModel(tree); 113927var model = comp.GetSemanticModel(tree); 114152var model = comp.GetSemanticModel(tree); 145499var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 145540var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 145580var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 145618var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 145656var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 145694var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 145727var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 145760var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 145799var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 146074var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 146105var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 146138var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 146422var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 146461var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 146501var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 146540var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 146574var model = comp.GetSemanticModel(tree); 146585out var speculativeModel)); 154983var model = comp.GetSemanticModel(tree); 155051var model = comp.GetSemanticModel(tree); 155062private static void VerifyVariableAnnotation(SemanticModel model, VariableDeclaratorSyntax syntax, string expectedDisplay, NullableAnnotation expectedAnnotation) 156179var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 156928var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 157763var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 157811var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158243var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158279var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158374var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158412var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158453var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158493var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158527var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158564var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158659var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158707var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158749var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158786var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 158997var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 160875var model = comp.GetSemanticModel(tree); 161425var model = comp.GetSemanticModel(syntaxTree); 161471var model = comp.GetSemanticModel(syntaxTree);
Semantics\NullCoalesceAssignmentTests.cs (5)
37var semanticModel = comp.GetSemanticModel(syntaxTree); 75var semanticModel = comp.GetSemanticModel(syntaxTree); 118var semanticModel = comp.GetSemanticModel(syntaxTree); 157var semanticModel = comp.GetSemanticModel(syntaxTree); 183var semanticModel = comp.GetSemanticModel(syntaxTree);
Semantics\NullConditionalAssignmentTests.cs (4)
2446var model = comp.GetSemanticModel(tree); 2480var model = comp.GetSemanticModel(tree); 2740var model = comp.GetSemanticModel(tree); 2834var model = comp.GetSemanticModel(tree);
Semantics\ObjectAndCollectionInitializerTests.cs (17)
3469var semanticModel = compilation.GetSemanticModel(tree); 3517var semanticModel = compilation.GetSemanticModel(tree); 3574var semanticModel = compilation.GetSemanticModel(tree); 3610var semanticModel = compilation.GetSemanticModel(tree); 3647var semanticModel = compilation.GetSemanticModel(tree); 3688var semanticModel = compilation.GetSemanticModel(tree); 3738var semanticModel = compilation.GetSemanticModel(tree); 3782var semanticModel = compilation.GetSemanticModel(tree); 3813var model = comp.GetSemanticModel(syntax); 3836var model = comp.GetSemanticModel(syntax); 3860var model = comp.GetSemanticModel(syntax); 3933var semanticModel = compilation.GetSemanticModel(tree); 4015var semanticModel = compilation.GetSemanticModel(tree); 4057var semanticModel = compilation.GetSemanticModel(tree); 4135var semanticModel = compilation.GetSemanticModel(tree); 4225var model = comp.GetSemanticModel(tree); 4279var model = comp.GetSemanticModel(tree);
Semantics\OperatorTests.cs (17)
45var semanticModel = compilation.GetSemanticModel(tree); 2983var model = compilation.GetSemanticModel(tree); 6937var model = comp.GetSemanticModel(tree); 7054var model = comp.GetSemanticModel(tree); 7209var model = comp.GetSemanticModel(tree); 7487var semanticModel = compilation.GetSemanticModel(tree); 7533SemanticModel semanticModel, 7703var semanticModel = compilation.GetSemanticModel(tree); 7856var semanticModel = compilation.GetSemanticModel(tree); 8016var semanticModel = compilation.GetSemanticModel(tree); 8072SemanticModel semanticModel, 8553var semanticModel = compilation.GetSemanticModel(tree); 8588var semanticModel = compilation.GetSemanticModel(tree); 8632var semanticModel = compilation.GetSemanticModel(tree); 8682var semanticModel = compilation.GetSemanticModel(tree); 8756var semanticModel = compilation.GetSemanticModel(tree); 12308var model = comp.GetSemanticModel(tree);
Semantics\OverloadResolutionPerfTests.cs (2)
981var model = comp.GetSemanticModel(tree); 1059var model = comp.GetSemanticModel(tree);
Semantics\OverloadResolutionTests.cs (9)
7147var model = comp.GetSemanticModel(tree); 7257var model = comp.GetSemanticModel(tree); 7431var model = comp.GetSemanticModel(tree); 7472var model = comp.GetSemanticModel(tree); 9066var model = compilation.GetSemanticModel(tree); 9414var model = comp.GetSemanticModel(tree); 11759var model = comp.GetSemanticModel(tree); 11808var model = comp.GetSemanticModel(tree); 11858var model = comp.GetSemanticModel(tree);
Semantics\QueryTests.cs (36)
1452var model = compilation.GetSemanticModel(tree); 1661var model = compilation.GetSemanticModel(tree); 1721var model = compilation.GetSemanticModel(tree); 1759var model = compilation.GetSemanticModel(tree); 2175var semanticModel = compilation.GetSemanticModel(tree); 2205var semanticModel = compilation.GetSemanticModel(tree); 2232var semanticModel = compilation.GetSemanticModel(tree); 2270var semanticModel = compilation.GetSemanticModel(tree); 2298var semanticModel = compilation.GetSemanticModel(tree); 2323var semanticModel = compilation.GetSemanticModel(tree); 2355var semanticModel = compilation.GetSemanticModel(tree); 2382var semanticModel = compilation.GetSemanticModel(tree); 2426var model = compilation.GetSemanticModel(tree); 2482var semanticModel = compilation.GetSemanticModel(tree); 2520var semanticModel = compilation.GetSemanticModel(tree); 2546var semanticModel = compilation.GetSemanticModel(tree); 2581var semanticModel = compilation.GetSemanticModel(tree); 2661var semanticModel = compilation.GetSemanticModel(tree); 2689var semanticModel = compilation.GetSemanticModel(tree); 2715var semanticModel = compilation.GetSemanticModel(tree); 2741var semanticModel = compilation.GetSemanticModel(tree); 2896var model = compilation.GetSemanticModel(tree); 2929var model = compilation.GetSemanticModel(tree); 3135var model = compilation.GetSemanticModel(tree); 3163var model = compilation.GetSemanticModel(tree); 3374var model = compilation.GetSemanticModel(tree); 3419var model = compilation.GetSemanticModel(tree); 3423SemanticModel speculativeModel; 3463var model = compilation.GetSemanticModel(tree); 3467SemanticModel speculativeModel; 3510var model = compilation.GetSemanticModel(tree); 3514SemanticModel speculativeModel; 3549var model = compilation.GetSemanticModel(tree); 3553SemanticModel speculativeModel; 3597var model = compilation.GetSemanticModel(tree); 3601SemanticModel speculativeModel;
Semantics\RawInterpolationTests_Handler.cs (2)
2900var model = comp.GetSemanticModel(tree); 3126var model = comp.GetSemanticModel(tree);
Semantics\ReadOnlyStructsTests.cs (1)
1267var semanticModel = comp.GetSemanticModel(testMethodSyntax.SyntaxTree);
Semantics\RecordStructTests.cs (20)
533var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 553var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 573var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 595var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 2378var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 2402var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 2664var model = comp.GetSemanticModel(tree); 2699var model = comp.GetSemanticModel(tree); 2733var model = comp.GetSemanticModel(tree); 2768var model = comp.GetSemanticModel(tree); 3318var model = comp.GetSemanticModel(tree); 3360var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 3408var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 3459var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 5920var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 5962var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 6996var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 7677var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 8882var model = comp.GetSemanticModel(tree, ignoreAccessibility: false); 10841var model = comp.GetSemanticModel(tree);
Semantics\RefEscapingTests.cs (3)
49var model = comp.GetSemanticModel(tree); 6363var model = compilation.GetSemanticModel(tree); 6463var model = compilation.GetSemanticModel(tree);
Semantics\RefExtensionMethodsTests.cs (4)
2146var model = comp.GetSemanticModel(tree); 2165var model = comp.GetSemanticModel(tree); 2184var model = comp.GetSemanticModel(tree); 2203var model = comp.GetSemanticModel(tree);
Semantics\RefFieldTests.cs (59)
11086var model = comp.GetSemanticModel(tree); 11160var model = comp.GetSemanticModel(tree); 11187static (NamedTypeSymbol, LambdaSymbol) getDelegateTypeAndLambda(SemanticModel model, VariableDeclaratorSyntax decl) 11282var model = comp.GetSemanticModel(tree); 11455var model = comp.GetSemanticModel(tree); 12047var model = comp.GetSemanticModel(tree); 12127var model = comp.GetSemanticModel(tree); 12196var model = comp.GetSemanticModel(tree); 12264var model = comp.GetSemanticModel(tree); 12446var model = comp.GetSemanticModel(tree); 12633var model = comp.GetSemanticModel(tree); 12859var model = comp.GetSemanticModel(tree); 13042var model = comp.GetSemanticModel(tree); 13217var model = comp.GetSemanticModel(tree); 13272var model = comp.GetSemanticModel(tree); 13331var model = comp.GetSemanticModel(tree); 13374var model = comp.GetSemanticModel(tree); 13403var model = comp.GetSemanticModel(tree); 13428var model = comp.GetSemanticModel(tree); 13448var model = comp.GetSemanticModel(tree); 13470var model = comp.GetSemanticModel(tree); 13505var model = comp.GetSemanticModel(tree); 13569var model = comp.GetSemanticModel(tree); 13645var model = comp.GetSemanticModel(tree); 13716var model = comp.GetSemanticModel(tree); 13780var model = comp.GetSemanticModel(tree); 14421var model = comp.GetSemanticModel(tree); 14463var model = comp.GetSemanticModel(tree); 14588var model = comp.GetSemanticModel(tree); 14664var model = comp.GetSemanticModel(tree); 14909var model = comp.GetSemanticModel(tree); 15117var model = comp.GetSemanticModel(tree); 15143var model = comp.GetSemanticModel(tree); 15198var model = comp.GetSemanticModel(tree); 16616var model = comp.GetSemanticModel(tree); 16657var model = comp.GetSemanticModel(tree); 16696var model = comp.GetSemanticModel(tree); 16792var model = comp.GetSemanticModel(tree); 16840var model = comp.GetSemanticModel(syntaxTree); 18012var model = comp.GetSemanticModel(tree); 23437var model = comp.GetSemanticModel(tree); 23505var model = comp.GetSemanticModel(tree); 24507var model = comp.GetSemanticModel(tree); 24543var model = comp.GetSemanticModel(tree); 24580var model = comp.GetSemanticModel(tree); 25347var model = comp.GetSemanticModel(tree); 25365static (NamedTypeSymbol, LambdaSymbol) getDelegateTypeAndLambda(SemanticModel model, VariableDeclaratorSyntax decl) 27402var model = comp.GetSemanticModel(tree); 27454var model = comp.GetSemanticModel(tree); 27506var model = comp.GetSemanticModel(tree); 27663var model = comp.GetSemanticModel(tree); 27753var model = comp.GetSemanticModel(tree); 27873var model = comp.GetSemanticModel(tree); 27974var model = comp.GetSemanticModel(tree); 28019var model = comp.GetSemanticModel(tree); 28079var model = comp.GetSemanticModel(tree); 28309var model = comp.GetSemanticModel(tree); 28357var model = comp.GetSemanticModel(tree); 29447var model = comp.GetSemanticModel(tree);
Semantics\RefLocalsAndReturnsTests.cs (10)
4749var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 4777var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 4805var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 4833var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 4861var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 4889var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 4923var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 5206var model = comp.GetSemanticModel(tree); 5250var model = comp.GetSemanticModel(tree); 5289var model = comp.GetSemanticModel(tree);
Semantics\ScriptSemanticsTests.cs (11)
237var model = compilation.GetSemanticModel(tree); 497var model = compilation.GetSemanticModel(tree); 509var model = submission.GetSemanticModel(submission.SyntaxTrees.Single()); 520var model = CreateCompilationWithMscorlib461(new[] { tree }).GetSemanticModel(tree, ignoreAccessibility: false); 536var model = CreateCompilationWithMscorlib461(new[] { tree }).GetSemanticModel(tree, ignoreAccessibility: false); 554var model = compilation.GetSemanticModel(tree); 590var model = compilation.GetSemanticModel(tree); 1182var semanticModel = compilation.GetSemanticModel(syntaxTree, true); 1276var semanticModel1 = compilation.GetSemanticModel(syntaxTree1, true); 1277var semanticModel2 = compilation.GetSemanticModel(syntaxTree2, true); 1309var semanticModel = compilation.GetSemanticModel(syntaxTree, true);
Semantics\SemanticErrorTests.cs (1)
3369var model = compilation.GetSemanticModel(tree);
Semantics\SimpleLambdaParametersWithModifiersTests.cs (43)
37var semanticModel = compilation.GetSemanticModel(tree); 64var semanticModel = compilation.GetSemanticModel(tree); 96var semanticModel = compilation.GetSemanticModel(tree); 126var semanticModel = compilation.GetSemanticModel(tree); 162var semanticModel = compilation.GetSemanticModel(tree); 197var semanticModel = compilation.GetSemanticModel(tree); 229var semanticModel = compilation.GetSemanticModel(tree); 257var semanticModel = compilation.GetSemanticModel(tree); 288var semanticModel = compilation.GetSemanticModel(tree); 322var semanticModel = compilation.GetSemanticModel(tree); 351var semanticModel = compilation.GetSemanticModel(tree); 382var semanticModel = compilation.GetSemanticModel(tree); 416var semanticModel = compilation.GetSemanticModel(tree); 448var semanticModel = compilation.GetSemanticModel(tree); 477var semanticModel = compilation.GetSemanticModel(tree); 509var semanticModel = compilation.GetSemanticModel(tree); 542var semanticModel = compilation.GetSemanticModel(tree); 575var semanticModel = compilation.GetSemanticModel(tree); 608var semanticModel = compilation.GetSemanticModel(tree); 637var semanticModel = compilation.GetSemanticModel(tree); 665var semanticModel = compilation.GetSemanticModel(tree); 697var semanticModel = compilation.GetSemanticModel(tree); 726var semanticModel = compilation.GetSemanticModel(tree); 755var semanticModel = compilation.GetSemanticModel(tree); 786var semanticModel = compilation.GetSemanticModel(tree); 820var semanticModel = compilation.GetSemanticModel(tree); 854var semanticModel = compilation.GetSemanticModel(tree); 886var semanticModel = compilation.GetSemanticModel(tree); 932var semanticModel = compilation.GetSemanticModel(tree); 960var semanticModel = compilation.GetSemanticModel(tree); 985var semanticModel = compilation.GetSemanticModel(tree); 1036var semanticModel = compilation.GetSemanticModel(tree); 1071var semanticModel = compilation.GetSemanticModel(tree); 1100var semanticModel = compilation.GetSemanticModel(tree); 1129var semanticModel = compilation.GetSemanticModel(tree); 1156var semanticModel = compilation.GetSemanticModel(tree); 1185var semanticModel = compilation.GetSemanticModel(tree); 1219var semanticModel = compilation.GetSemanticModel(tree); 1328var semanticModel = compilation.GetSemanticModel(tree); 1358var semanticModel = compilation.GetSemanticModel(tree); 1385var semanticModel = compilation.GetSemanticModel(tree); 1418var semanticModel = compilation.GetSemanticModel(tree); 1451var semanticModel = compilation.GetSemanticModel(tree);
Semantics\StackAllocInitializerTests.cs (9)
365var model = comp.GetSemanticModel(tree); 441var model = comp.GetSemanticModel(tree); 1043var model = comp.GetSemanticModel(tree); 1145var model = comp.GetSemanticModel(tree); 2357var model = comp.GetSemanticModel(tree); 2463var model = comp.GetSemanticModel(tree); 2563var model = comp.GetSemanticModel(tree); 2647var model = comp.GetSemanticModel(tree); 2717var model = comp.GetSemanticModel(tree);
Semantics\StackAllocSpanExpressionsTests.cs (2)
51var model = comp.GetSemanticModel(tree); 125var model = comp.GetSemanticModel(tree);
Semantics\StructConstructorTests.cs (3)
1049var model = comp.GetSemanticModel(tree); 1144var model = comp.GetSemanticModel(tree); 1241var model = comp.GetSemanticModel(tree);
Semantics\SuppressAccessibilityChecksTests.cs (9)
18private static SemanticModel GetSemanticModelWithIgnoreAccessibility() 53var semanticModel = GetSemanticModelWithIgnoreAccessibility(); 71var semanticModel = GetSemanticModelWithIgnoreAccessibility(); 86var semanticModel = GetSemanticModelWithIgnoreAccessibility(); 90SemanticModel speculativeSemanticModel; 121var model = comp.GetSemanticModel(tree, ignoreAccessibility: true); 167var semanticModel = compilationB.GetSemanticModel(syntaxTree, ignoreAccessibility: true); 213var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true); 219SemanticModel speculativeModel;
Semantics\SwitchTests.cs (1)
1153var semanticModel = comp.GetSemanticModel(syntaxTree);
Semantics\TargetTypedConditionalOperatorTests.cs (3)
342var model = comp.GetSemanticModel(tree); 667var model = comp.GetSemanticModel(tree); 688var model = comp.GetSemanticModel(tree);
Semantics\TargetTypedDefaultTests.cs (32)
41var model = comp.GetSemanticModel(tree); 141var model = comp.GetSemanticModel(tree); 193var model = comp.GetSemanticModel(tree); 241var model = comp.GetSemanticModel(tree); 278var model = comp.GetSemanticModel(tree); 323var model = comp.GetSemanticModel(tree); 517var model = comp.GetSemanticModel(tree); 563var model = comp.GetSemanticModel(tree); 606var model = comp.GetSemanticModel(tree); 664var model = comp.GetSemanticModel(tree); 745var model = comp.GetSemanticModel(tree); 834var model = comp.GetSemanticModel(tree); 863var model = comp.GetSemanticModel(tree); 1139var model = comp.GetSemanticModel(tree); 1254var model = comp.GetSemanticModel(tree); 1628var model = comp.GetSemanticModel(tree); 1733var model = comp.GetSemanticModel(tree); 1799var model = comp.GetSemanticModel(tree); 1870var model = comp.GetSemanticModel(tree); 1908var model = comp.GetSemanticModel(tree); 2087var model = comp.GetSemanticModel(tree); 2330var model = comp.GetSemanticModel(tree); 2411var model = comp.GetSemanticModel(tree); 2454var model = comp.GetSemanticModel(tree); 2480var model = comp.GetSemanticModel(tree); 3054var model = comp.GetSemanticModel(tree); 3341var model = comp.GetSemanticModel(tree); 3380var model = comp.GetSemanticModel(tree); 3511var model = comp.GetSemanticModel(tree); 3573var model = comp.GetSemanticModel(tree); 3670var model = comp.GetSemanticModel(tree); 3710var model = comp.GetSemanticModel(tree);
Semantics\TopLevelStatementsTests.cs (69)
190var model1 = comp.GetSemanticModel(tree1); 248static void verifyModelForGlobalStatements(SyntaxTree tree1, SemanticModel model1) 315var model1 = comp.GetSemanticModel(tree1); 353var model2 = comp.GetSemanticModel(tree2); 399static void verifyModelForGlobalStatements(SyntaxTree tree1, SemanticModel model1) 481var model1 = comp.GetSemanticModel(tree1); 500var model2 = comp.GetSemanticModel(tree2); 533var model1 = comp.GetSemanticModel(tree1); 573var model1 = comp.GetSemanticModel(tree1); 698var model = comp.GetSemanticModel(tree); 871var model1 = comp.GetSemanticModel(tree1); 877var model2 = comp.GetSemanticModel(tree2); 985var model1 = comp.GetSemanticModel(tree1); 1040var model1 = comp.GetSemanticModel(tree1); 1451var model2 = comp.GetSemanticModel(tree2); 1567var model1 = comp.GetSemanticModel(tree); 1570var model2 = comp.GetSemanticModel(tree); 1627var model1 = comp.GetSemanticModel(tree); 1634var model2 = comp.GetSemanticModel(tree); 1721var model1 = comp.GetSemanticModel(tree1); 1751var model = comp.GetSemanticModel(tree); 1796void verifyModel(ISymbol declSymbol, SemanticModel model, IdentifierNameSyntax nameRef) 1894var model1 = comp.GetSemanticModel(tree1); 1917var model2 = comp.GetSemanticModel(tree2); 1964void verifyModel(ISymbol declSymbol, SemanticModel model2, IdentifierNameSyntax nameRef) 2120var model1 = comp.GetSemanticModel(tree1); 2177void verifyModel(ISymbol declSymbol, SemanticModel model2, IdentifierNameSyntax nameRef) 2284var model1 = comp.GetSemanticModel(tree1); 2302var model2 = comp.GetSemanticModel(tree2); 2343void verifyModel(ISymbol declSymbol, SemanticModel model2, IdentifierNameSyntax nameRef) 2462var model1 = comp.GetSemanticModel(tree1); 2540void verifyModel(SemanticModel model2, IdentifierNameSyntax nameRef) 2954var model1 = comp.GetSemanticModel(tree1); 2977var model2 = comp.GetSemanticModel(tree2); 3977var model = comp.GetSemanticModel(tree); 4036void verifyModel(ISymbol declSymbol, SemanticModel model, IdentifierNameSyntax nameRef) 4126var model = comp.GetSemanticModel(tree); 4166void verifyModel(SemanticModel model, IdentifierNameSyntax nameRef) 4251var model = comp.GetSemanticModel(tree); 4546var model1 = comp.GetSemanticModel(tree1); 4552var model2 = comp.GetSemanticModel(tree2); 4610var model1 = comp.GetSemanticModel(tree1); 4659var model1 = comp.GetSemanticModel(tree1); 4929var model = comp.GetSemanticModel(tree); 4986var model1 = comp.GetSemanticModel(tree1); 4992var model2 = comp.GetSemanticModel(tree2); 5014var model = comp.GetSemanticModel(tree); 6120var model1 = comp.GetSemanticModel(tree1); 6176var semanticModel = comp.GetSemanticModel(syntaxTree); 6248var semanticModel = comp.GetSemanticModel(syntaxTree); 6325var semanticModel = comp.GetSemanticModel(syntaxTree); 6370var semanticModel = comp.GetSemanticModel(syntaxTree, ignoreAccessibility: true); 6415var semanticModel1 = comp.GetSemanticModel(syntaxTree1, ignoreAccessibility); 6466var semanticModel1 = comp.GetSemanticModel(syntaxTree1, ignoreAccessibility); 6472var semanticModel2 = comp.GetSemanticModel(syntaxTree2, ignoreAccessibility); 6528var model = context.SemanticModel; 6558var model = context.SemanticModel; 7023var model = context.SemanticModel; 7091var model = context.SemanticModel; 7156var model = context.SemanticModel; 7190var model = context.SemanticModel; 8713var model = comp.GetSemanticModel(tree); 8786var model = comp.GetSemanticModel(tree); 8808var model = comp.GetSemanticModel(tree); 8830var model = comp.GetSemanticModel(tree); 9814var model = compilation.GetSemanticModel(tree); 9839var model = compilation.GetSemanticModel(tree); 9843model.TryGetSpeculativeSemanticModel(root.DescendantNodes().Single(n => n is ExpressionStatementSyntax { Parent: GlobalStatementSyntax }).Span.End, nodeToSpeculate, out var speculativeModelInTopLevel); 9848model.TryGetSpeculativeSemanticModel(root.DescendantNodes().Single(n => n is ExpressionStatementSyntax { Parent: BlockSyntax }).Span.End, nodeToSpeculate, out var speculativeModelOutsideTopLevel);
Semantics\TryCatchTests.cs (1)
43var model = compilation.GetSemanticModel(tree);
Semantics\TypeOfTests.cs (1)
32var model = compilation.GetSemanticModel(tree);
Semantics\UnsafeTests.cs (31)
5199var model = compilation.GetSemanticModel(tree); 5381var model = compilation.GetSemanticModel(tree); 6301var model = comp.GetSemanticModel(tree); 6378var model = compilation.GetSemanticModel(tree); 7255var model = compilation.GetSemanticModel(tree); 7292var model = compilation.GetSemanticModel(tree); 7321var model = compilation.GetSemanticModel(tree); 7359var model = compilation.GetSemanticModel(tree); 7402var model = compilation.GetSemanticModel(tree); 7533var model = compilation.GetSemanticModel(tree); 7843var model = compilation.GetSemanticModel(tree); 7910var model = compilation.GetSemanticModel(tree); 8156var model = compilation.GetSemanticModel(tree); 8223var model = compilation.GetSemanticModel(tree); 8281var model = compilation.GetSemanticModel(tree); 8341var model = compilation.GetSemanticModel(tree); 8377var model = compilation.GetSemanticModel(tree); 8853var model = compilation.GetSemanticModel(tree); 8907var model = compilation.GetSemanticModel(tree); 9319var model = compilation.GetSemanticModel(tree); 10175var model = compilation.GetSemanticModel(tree); 10216var model = compilation.GetSemanticModel(tree); 10288var model = compilation.GetSemanticModel(tree); 10624var model = compilation.GetSemanticModel(tree); 10686var model = compilation.GetSemanticModel(tree); 10746var model = compilation.GetSemanticModel(tree); 11303var model = compilation.GetSemanticModel(tree); 11804var model = comp.GetSemanticModel(tree); 11835var model = comp.GetSemanticModel(tree); 11875var model = compilation.GetSemanticModel(tree); 11901var model = comp.GetSemanticModel(tree);
Semantics\UsingStatementTests.cs (7)
58var model = compilation.GetSemanticModel(tree); 1339var model = compilation.GetSemanticModel(tree); 1374var model = compilation.GetSemanticModel(tree); 1851var model = compilation.GetSemanticModel(tree); 1863var model = compilation.GetSemanticModel(tree); 1879var model = compilation.GetSemanticModel(tree); 1893var model = compilation.GetSemanticModel(tree);
Semantics\Utf8StringsLiteralsTests.cs (14)
2969var model = comp.GetSemanticModel(tree); 2997var model = comp.GetSemanticModel(tree); 3025var model = comp.GetSemanticModel(tree); 3053var model = comp.GetSemanticModel(tree); 3081var model = comp.GetSemanticModel(tree); 3109var model = comp.GetSemanticModel(tree); 3137var model = comp.GetSemanticModel(tree); 3165var model = comp.GetSemanticModel(tree); 3193var model = comp.GetSemanticModel(tree); 3221var model = comp.GetSemanticModel(tree); 3249var model = comp.GetSemanticModel(tree); 3277var model = comp.GetSemanticModel(tree); 3305var model = comp.GetSemanticModel(tree); 4079var model = comp.GetSemanticModel(tree);
Semantics\ValueTupleTests.cs (5)
666var model = comp.GetSemanticModel(tree); 706var model = comp.GetSemanticModel(tree); 747var model = comp.GetSemanticModel(tree); 789var model = comp.GetSemanticModel(tree); 829var model = comp.GetSemanticModel(tree);
SourceGeneration\GeneratorDriverTests.cs (1)
4336var model = context.SemanticModel;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1055)
Compilation\CompilationAPITests.cs (6)
882var bind = comp.GetSemanticModel(syntaxTree: t1); 1939var model2 = compilation.GetSemanticModel(tree2); 1953var model2 = compilation.GetSemanticModel(tree2); 2839var semanticModel = compilation.GetSemanticModel(syntaxTree); 2874var semanticModel = compilation.GetSemanticModel(syntaxTree); 2906var semanticModel = compilation.GetSemanticModel(syntaxTree);
Compilation\ForEachStatementInfoTests.cs (2)
114var model = comp.GetSemanticModel(tree); 181var model = comp.GetSemanticModel(tree);
Compilation\GetImportScopesTests.cs (13)
23var model = comp.GetSemanticModel(tree); 414var model = comp.GetSemanticModel(tree); 433var model = comp.GetSemanticModel(tree); 455var model = comp.GetSemanticModel(tree); 476var model = comp.GetSemanticModel(tree); 496var model = comp.GetSemanticModel(tree); 512var model = comp.GetSemanticModel(tree); 532var model = comp.GetSemanticModel(tree); 563var model = comp.GetSemanticModel(tree); 588var model = comp.GetSemanticModel(tree); 614var model = comp.GetSemanticModel(tree); 643var model = comp.GetSemanticModel(tree); 676var model = comp.GetSemanticModel(tree);
Compilation\GetSemanticInfoBrokenCodeTests.cs (18)
30var model = comp.GetSemanticModel(tree); 49var model = comp.GetSemanticModel(tree); 72var model = comp.GetSemanticModel(tree); 95var model = comp.GetSemanticModel(tree); 108var model = comp.GetSemanticModel(tree); 133var model = comp.GetSemanticModel(tree); 160var model = comp.GetSemanticModel(tree); 177var model = comp.GetSemanticModel(tree); 198var model = comp.GetSemanticModel(tree); 222var model = comp.GetSemanticModel(tree); 243var model = comp.GetSemanticModel(tree); 265var model = comp.GetSemanticModel(tree); 298var model = comp.GetSemanticModel(tree); 316var model = comp.GetSemanticModel(tree); 331var model = comp.GetSemanticModel(tree); 346var model = comp.GetSemanticModel(tree); 361var model = comp.GetSemanticModel(tree); 371private void VisitAllExpressions(SemanticModel model, SyntaxNode node)
Compilation\GetSemanticInfoTests.cs (138)
41var model = comp.GetSemanticModel(tree); 71var model = comp.GetSemanticModel(tree); 100var model = comp.GetSemanticModel(tree); 134var model = comp.GetSemanticModel(tree); 163var model = comp.GetSemanticModel(tree); 189var model = comp.GetSemanticModel(tree); 240var model = comp.GetSemanticModel(tree); 295var model = comp.GetSemanticModel(tree); 372var model = comp.GetSemanticModel(tree); 414var model = comp.GetSemanticModel(tree); 441var model = comp.GetSemanticModel(tree); 475var model = comp.GetSemanticModel(tree); 528var model = comp.GetSemanticModel(tree); 595var model = comp.GetSemanticModel(tree); 628var model = comp.GetSemanticModel(tree); 645private void CheckIsAssignableTo(SemanticModel model, ExpressionSyntax syntax) 842private void ConversionTestHelper(SemanticModel semanticModel, ExpressionSyntax expr, ConversionKind ept1, ConversionKind ept2) 869private void ConversionTestHelper(SemanticModel semanticModel, ExpressionSyntax expr, ITypeSymbol expsym, ConversionKind expkind) 976var model = compilation.GetSemanticModel(tree); 1000var model = compilation.GetSemanticModel(tree); 1023var model = comp.GetSemanticModel(tree); 1045var model = compilation.GetSemanticModel(tree); 1131var model = comp.GetSemanticModel(tree); 1162var model = comp.GetSemanticModel(tree); 1191var model = comp.GetSemanticModel(tree); 1215var model = comp.GetSemanticModel(tree); 1238var model = comp.GetSemanticModel(tree); 1264var model = comp.GetSemanticModel(tree); 1292var model = comp.GetSemanticModel(tree); 1320var model = comp.GetSemanticModel(tree); 1347var model = comp.GetSemanticModel(tree); 1374var model = comp.GetSemanticModel(tree); 1410var model = comp.GetSemanticModel(tree); 1448var model = comp.GetSemanticModel(tree); 1486var model = comp.GetSemanticModel(tree); 1522var model = comp.GetSemanticModel(tree); 1553var model = comp.GetSemanticModel(tree); 1575var model = comp.GetSemanticModel(tree); 1603var model = comp.GetSemanticModel(tree); 1628var model = comp.GetSemanticModel(tree); 1667var model = comp.GetSemanticModel(tree); 1699var model = comp.GetSemanticModel(tree); 1734var model = comp.GetSemanticModel(tree); 1769var model = comp.GetSemanticModel(tree); 1805var model = comp.GetSemanticModel(tree); 1841var model = comp.GetSemanticModel(tree); 1882var model = comp.GetSemanticModel(tree); 1911var model = comp.GetSemanticModel(tree); 1947var model = comp.GetSemanticModel(tree); 1983var model = comp.GetSemanticModel(tree); 2019var model = comp.GetSemanticModel(tree); 2054var model = comp.GetSemanticModel(tree); 2221var model = comp.GetSemanticModel(tree); 2324var model = comp.GetSemanticModel(tree); 2354var model = comp.GetSemanticModel(tree); 2390var model = comp.GetSemanticModel(tree); 2449var model = comp.GetSemanticModel(tree); 2477var model = comp.GetSemanticModel(tree); 2506var model = comp.GetSemanticModel(tree); 2535var model = comp.GetSemanticModel(tree); 2564var model = compilation.GetSemanticModel(tree); 2718var model = comp.GetSemanticModel(tree); 2789var model = comp.GetSemanticModel(tree); 2835var model = comp.GetSemanticModel(tree); 2865var model = comp.GetSemanticModel(tree); 2926var model = comp.GetSemanticModel(tree); 2958var model = comp.GetSemanticModel(tree); 3018var model = comp.GetSemanticModel(tree); 3050var model = comp.GetSemanticModel(tree); 3092var model = comp.GetSemanticModel(tree); 3124var model = comp.GetSemanticModel(tree); 3166var model = comp.GetSemanticModel(tree); 3198var model = comp.GetSemanticModel(tree); 3241var model = comp.GetSemanticModel(tree); 3271var model = comp.GetSemanticModel(tree); 3325var model = comp.GetSemanticModel(tree); 3391var model = comp.GetSemanticModel(tree); 3464var model = compilation.GetSemanticModel(tree); 3518var model = compilation.GetSemanticModel(tree); 3550var model = compilation.GetSemanticModel(tree); 3578var model = compilation.GetSemanticModel(tree); 3605var model = compilation.GetSemanticModel(tree); 3630var model = compilation.GetSemanticModel(tree); 3663var model = compilation.GetSemanticModel(tree); 3699var model = compilation.GetSemanticModel(tree); 3755var model = compilation.GetSemanticModel(tree); 3783var model = compilation.GetSemanticModel(tree); 3816var model = compilation.GetSemanticModel(tree); 3844var model = compilation.GetSemanticModel(tree); 3870var model = compilation.GetSemanticModel(tree); 3910var model = compilation.GetSemanticModel(tree); 3950var model = compilation.GetSemanticModel(tree); 3996var model = compilation.GetSemanticModel(tree); 4036var model = comp.GetSemanticModel(tree); 4113var model = comp.GetSemanticModel(tree); 4168var model = comp.GetSemanticModel(tree); 4209var model = compilation.GetSemanticModel(tree); 4239var model = compilation.GetSemanticModel(tree); 4269var model = compilation.GetSemanticModel(tree); 4290var model = compilation.GetSemanticModel(tree); 4320var model = compilation.GetSemanticModel(tree); 4353var model = compilation.GetSemanticModel(tree); 4374var model = compilation.GetSemanticModel(tree); 4398var model = compilation.GetSemanticModel(tree); 4434var model = compilation.GetSemanticModel(tree); 4488var model = compilation.GetSemanticModel(tree); 4533var model = compilation.GetSemanticModel(tree); 4587var model = compilation.GetSemanticModel(tree); 4639var model = compilation.GetSemanticModel(tree); 4672var model = comp.GetSemanticModel(tree); 4717var model = comp.GetSemanticModel(tree); 4750var model = comp.GetSemanticModel(tree); 4783var model = comp.GetSemanticModel(tree); 4826var model = comp.GetSemanticModel(tree); 4872var model = comp.GetSemanticModel(tree); 4879SemanticModel speculativeModel; 4908var model = comp.GetSemanticModel(tree); 5401var model = compilation.GetSemanticModel(tree); 5476var model = comp.GetSemanticModel(tree); 5519var model = comp.GetSemanticModel(tree); 5533var model = comp.GetSemanticModel(tree); 5580var model = comp.GetSemanticModel(tree); 5618var model = comp.GetSemanticModel(tree); 5665var model = comp.GetSemanticModel(tree); 5718var model = comp.GetSemanticModel(tree); 5781var model = comp.GetSemanticModel(tree2); 5820var model1 = comp.GetSemanticModel(tree1); 5821var model2 = comp.GetSemanticModel(tree2); 5822var model3 = comp.GetSemanticModel(tree3); 5864var model1 = comp.GetSemanticModel(tree1); 5865var model2 = comp.GetSemanticModel(tree2); 5866var model3 = comp.GetSemanticModel(tree3); 5912var model = comp.GetSemanticModel(tree); 5985var model = comp.GetSemanticModel(tree); 6009var model = compilation.GetSemanticModel(tree); 6044var model = comp.GetSemanticModel(tree); 6081var model = comp.GetSemanticModel(tree); 6135var semanticModel = comp.GetSemanticModel(tree);
Compilation\GetUnusedImportDirectivesTests.cs (3)
192var model = comp.GetSemanticModel(tree); 425var model = comp.GetSemanticModel(tree); 453var model = comp.GetSemanticModel(tree);
Compilation\IndexedProperties_BindingTests.cs (1)
138var model = comp.GetSemanticModel(tree);
Compilation\SemanticModelAPITests.cs (181)
41var model = comp.GetSemanticModel(tree); 49model.TryGetSpeculativeSemanticModelForMethodBody(indexerAccess.SpanStart, m2, out var speculativeModel); 108var model = comp.GetSemanticModel(tree); 135var model = comp.GetSemanticModel(tree); 176var model = comp.GetSemanticModel(tree); 203var model = comp.GetSemanticModel(tree); 235var model = comp.GetSemanticModel(tree); 252var model1 = comp.GetSemanticModel(tree); 253var model2 = comp.GetSemanticModel(tree); 272var model1 = comp1.GetSemanticModel(tree); 273var model2 = comp2.GetSemanticModel(tree); 291var model1 = comp.GetSemanticModel(tree); 292var model2 = comp.GetSemanticModel(tree); 311var model1 = comp1.GetSemanticModel(tree); 312var model2 = comp2.GetSemanticModel(tree); 330var model1 = comp.GetSemanticModel(tree); 331var model2 = comp.GetSemanticModel(tree); 349var model1 = comp.GetSemanticModel(tree); 350var model2 = comp.GetSemanticModel(tree); 371var model1 = comp1.GetSemanticModel(tree1); 372var model2 = comp2.GetSemanticModel(tree2); 392var model = comp.GetSemanticModel(tree); 419var model = comp.GetSemanticModel(tree); 535var model = comp.GetSemanticModel(tree); 561var model = comp.GetSemanticModel(tree); 587var model = comp.GetSemanticModel(tree); 610var model = comp.GetSemanticModel(tree); 645var model = compilation.GetSemanticModel(tree1); 676var model = compilation.GetSemanticModel(tree1); 705var model = compilation.GetSemanticModel(tree1); 727var model = comp.GetSemanticModel(tree); 753var model = comp.GetSemanticModel(tree); 815var model = comp.GetSemanticModel(tree); 923var model = comp.GetSemanticModel(tree); 962var model1 = comp.GetSemanticModel(tree1); 963var model2 = comp.GetSemanticModel(tree2); 1003var model1 = comp.GetSemanticModel(tree1); 1004var model2 = comp.GetSemanticModel(tree2); 1040var model = comp.GetSemanticModel(tree); 1071var model = comp.GetSemanticModel(tree); 1112var model = comp.GetSemanticModel(tree); 1156var model = comp.GetSemanticModel(tree); 1192var model = comp.GetSemanticModel(tree); 1230var model = comp.GetSemanticModel(tree); 1263var model = comp2.GetSemanticModel(tree); 1304var model = comp.GetSemanticModel(tree); 1336var model = comp.GetSemanticModel(tree); 1359var model = comp.GetSemanticModel(tree); 1388var model = comp.GetSemanticModel(tree); 1413var model = compilation.GetSemanticModel(tree); 1424SemanticModel speculativeModel; 1458var model = compilation.GetSemanticModel(tree); 1464SemanticModel speculativeModel; 1504var model = compilation.GetSemanticModel(tree); 1513SemanticModel speculativeModel; 1554var model = compilation.GetSemanticModel(tree); 1561SemanticModel speculativeModel; 1592var model = compilation.GetSemanticModel(tree); 1601SemanticModel speculativeModel; 1672var model = compilation.GetSemanticModel(tree); 1683SemanticModel speculativeModel; 1726var model = comp.GetSemanticModel(tree); 1778var model = compilation.GetSemanticModel(tree); 1780SemanticModel speculativeModel; 1829var model = compilation.GetSemanticModel(tree); 1834SemanticModel speculativeModel; 1879var model = compilation.GetSemanticModel(tree); 1881SemanticModel statModel; 1918var model = compilation.GetSemanticModel(tree); 1919SemanticModel statModel; 1955var model = compilation.GetSemanticModel(tree); 1957SemanticModel speculativeModel; 1992var model = compilation.GetSemanticModel(tree); 1994SemanticModel speculativeModel; 2019var model = comp.GetSemanticModel(tree); 2033SemanticModel speculativeModel; 2070var parentModel = comp.GetSemanticModel(tree); 2076SemanticModel speculativeModel; 2139var parentModel = comp.GetSemanticModel(tree); 2145SemanticModel speculativeModel; 2174var model = compilation.GetSemanticModel(tree); 2180SemanticModel speculativeModel; 2219var model = compilation.GetSemanticModel(tree); 2226SemanticModel speculativeModel; 2234SemanticModel newModel; 2259var model = compilation.GetSemanticModel(tree); 2263SemanticModel speculativeModel; 2308var model = comp.GetSemanticModel(tree); 2319SemanticModel speculativeModel; 2350var model = compilation.GetSemanticModel(tree); 2355SemanticModel speculativeModel; 2371var semanticModel = compilation.GetSemanticModel(compilation.SyntaxTrees[0]); 2384var semanticModel = compilation.GetSemanticModel(compilation.SyntaxTrees[0]); 2389private static void VerifySpeculativeSemanticModelForMethodBody(BlockSyntax blockStatement, SemanticModel speculativeModel) 2446var model = compilation.GetSemanticModel(tree); 2451SemanticModel speculativeModel; 2488var model = compilation.GetSemanticModel(tree); 2493SemanticModel speculativeModel; 2533var model = compilation.GetSemanticModel(tree); 2538SemanticModel speculativeModel; 2563var model = compilation.GetSemanticModel(tree); 2570SemanticModel speculativeModel; 2635var model = compilation.GetSemanticModel(tree); 2642SemanticModel speculativeModel; 2672var model = compilation.GetSemanticModel(tree); 2678SemanticModel speculativeModel; 2691SemanticModel model, 2702SemanticModel speculativeModel; 2763var model = compilation.GetSemanticModel(tree); 2778SemanticModel speculativeModel; 2798var model = compilation.GetSemanticModel(tree); 2813var model = compilation.GetSemanticModel(tree); 2833var model = compilation.GetSemanticModel(tree); 2840SemanticModel speculativeModel; 2864var model = compilation.GetSemanticModel(tree); 2893var model = compilation.GetSemanticModel(tree); 2897SemanticModel speculativeModel; 2931SemanticModel speculativeModel; 2971SemanticModel speculativeModel; 3016SemanticModel speculativeModel; 3093SemanticModel speculativeModel; 3122var model = comp.GetSemanticModel(tree); 3129Assert.True(model.TryGetSpeculativeSemanticModel(methodDeclLocation, returnStatement, out var speculativeModel)); 3156var model = comp.GetSemanticModel(tree); 3186var model = comp.GetSemanticModel(tree); 3191SemanticModel speculativeModel; 3221var model = comp.GetSemanticModel(tree); 3226SemanticModel speculativeModel; 3251var model = comp.GetSemanticModel(tree); 3256SemanticModel speculativeModel; 3288var model = comp.GetSemanticModel(tree); 3297SemanticModel speculativeModel; 3329var model = comp.GetSemanticModel(tree); 3338SemanticModel speculativeModel; 3370var model = comp.GetSemanticModel(tree); 3404var model = comp.GetSemanticModel(tree); 3414SemanticModel speculativeModel; 3446var model = comp.GetSemanticModel(tree); 3455SemanticModel speculativeModel; 3487var model = comp.GetSemanticModel(tree); 3496SemanticModel speculativeModel; 3528var model = comp.GetSemanticModel(tree); 3553var model = compilation.GetSemanticModel(tree); 3574var model = compilation.GetSemanticModel(tree); 3578SemanticModel model2; 3613var model = comp.GetSemanticModel(tree); 3618SemanticModel speculativeModel; 3643var semanticModel = compilation.GetSemanticModel(tree); 3779var model = comp.GetSemanticModel(tree); 3815var model = comp.GetSemanticModel(tree); 3820Assert.True(model.TryGetSpeculativeSemanticModel(localFunctionBody.Block!.Statements[0].SpanStart + 1, @return, out var specModel)); 3848var model = comp.GetSemanticModel(tree); 3875var model = comp.GetSemanticModel(tree); 3903var model = comp.GetSemanticModel(tree); 3934var model = comp.GetSemanticModel(tree); 4059var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4087var model = compilation.GetSemanticModel(tree); 4115var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4136var model = comp.GetSemanticModel(tree); 4173var model = comp.GetSemanticModel(tree); 4216var model = comp.GetSemanticModel(tree); 4240var model = comp.GetSemanticModel(tree); 4268var model = comp.GetSemanticModel(tree); 4306var model = comp.GetSemanticModel(tree); 4358var model = comp.GetSemanticModel(tree); 4401var semanticModel = compilation.GetSemanticModel(tree); 4456var model = comp.GetSemanticModel(syntaxTree); 4461Assert.True(model.TryGetSpeculativeSemanticModel(ifStatement.SpanStart, replacementIfStatement, out var specModel)); 4490var model = comp.GetSemanticModel(tree); 4505var model = comp.GetSemanticModel(tree); 4569var model = comp.GetSemanticModel(tree); 4657var model = compilation.GetSemanticModel(tree); 4676var model = compilation.GetSemanticModel(tree); 4693var model = compilation.GetSemanticModel(tree); 4708var model = compilation.GetSemanticModel(tree); 4724var model = compilation.GetSemanticModel(tree); 4740var model = compilation.GetSemanticModel(tree); 4759var model = compilation.GetSemanticModel(tree); 4775var model = compilation.GetSemanticModel(tree); 4790var model = compilation.GetSemanticModel(tree); 4802var model = compilation.GetSemanticModel(tree);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (164)
39var model = comp.GetSemanticModel(tree); 61var model = comp.GetSemanticModel(tree); 80var model = compilation.GetSemanticModel(tree); 105var model = compilation.GetSemanticModel(tree); 126var model = compilation.GetSemanticModel(tree); 148var model = compilation.GetSemanticModel(tree); 173var model = compilation.GetSemanticModel(tree); 191var model = compilation.GetSemanticModel(tree); 214var model = compilation.GetSemanticModel(tree); 237var model = compilation.GetSemanticModel(tree); 258var model = compilation.GetSemanticModel(tree); 279var model = compilation.GetSemanticModel(tree); 302var model = compilation.GetSemanticModel(tree); 382var model = compilation.GetSemanticModel(tree); 408var model = compilation.GetSemanticModel(tree); 430var model = compilation.GetSemanticModel(tree); 449var model = compilation.GetSemanticModel(tree); 471var model = compilation.GetSemanticModel(tree); 496var model = compilation.GetSemanticModel(tree); 518var model = compilation.GetSemanticModel(tree); 540var model = compilation.GetSemanticModel(tree); 569var model = compilation.GetSemanticModel(tree); 591var model = compilation.GetSemanticModel(tree); 644var model = compilation.GetSemanticModel(tree); 669var model = compilation.GetSemanticModel(tree); 688private void TestAnonymousTypePropertySymbol(SemanticModel model, SyntaxNode node, string name) 777var model = compilation.GetSemanticModel(tree); 799var model = compilation.GetSemanticModel(tree); 823var model = compilation.GetSemanticModel(tree); 839var model = compilation.GetSemanticModel(tree); 859var model = compilation.GetSemanticModel(tree); 883var model = compilation.GetSemanticModel(tree); 903var model = compilation.GetSemanticModel(tree); 936var model = compilation.GetSemanticModel(tree); 1006var model = compilation.GetSemanticModel(tree); 1032var model = compilation.GetSemanticModel(tree); 1057var model = compilation.GetSemanticModel(tree); 1086var model = compilation.GetSemanticModel(tree); 1122var model = compilation.GetSemanticModel(tree); 1176var model = compilation.GetSemanticModel(tree); 1208var model = compilation.GetSemanticModel(tree); 1244var model = compilation.GetSemanticModel(tree); 1278var model = compilation.GetSemanticModel(tree); 1328var model = compilation.GetSemanticModel(tree); 1378var model = compilation.GetSemanticModel(tree); 1431var model = compilation.GetSemanticModel(tree); 1480var model = compilation.GetSemanticModel(tree); 1528var model = compilation.GetSemanticModel(tree); 1556private static ITypeParameterSymbol LookupTypeParameterFromConstraintClause(SemanticModel model, TypeParameterConstraintClauseSyntax constraintSyntax, string name) 1591var model = compilation.GetSemanticModel(tree); 1625var model = compilation.GetSemanticModel(tree); 1663var model = compilation.GetSemanticModel(tree); 1707var model = compilation.GetSemanticModel(tree); 1811var model = compilation.GetSemanticModel(tree); 1867var model = compilation.GetSemanticModel(tree); 1933var model = compilation.GetSemanticModel(tree); 2004var model = compilation.GetSemanticModel(tree); 2048var model = compilation.GetSemanticModel(tree); 2078var model = compilation.GetSemanticModel(tree); 2165var model = compilation.GetSemanticModel(tree); 2254var model = compilation.GetSemanticModel(tree); 2290var model = compilation.GetSemanticModel(tree); 2327var model = compilation.GetSemanticModel(tree); 2363var model = compilation.GetSemanticModel(tree); 2400var model = compilation.GetSemanticModel(tree); 2429var model = compilation.GetSemanticModel(tree); 2461var model = compilation.GetSemanticModel(tree); 2499var model = compilation.GetSemanticModel(tree); 2536var model = compilation.GetSemanticModel(tree); 2565var model = compilation.GetSemanticModel(tree); 2595var model = compilation.GetSemanticModel(tree); 2620var model = compilation.GetSemanticModel(tree); 2643var model = compilation.GetSemanticModel(tree); 2676var model = compilation.GetSemanticModel(tree); 2703var model = compilation.GetSemanticModel(tree); 2761var model = compilation.GetSemanticModel(tree); 2784var model = compilation.GetSemanticModel(tree); 2811var model = compilation.GetSemanticModel(tree); 2840var model = compilation.GetSemanticModel(tree); 2905var model = compilation.GetSemanticModel(tree); 2935var model = compilation.GetSemanticModel(tree); 2967var model = compilation.GetSemanticModel(tree); 3016var model = compilation.GetSemanticModel(tree); 3043var model = compilation.GetSemanticModel(tree); 3073var model = compilation.GetSemanticModel(tree); 3109var model = comp.GetSemanticModel(tree); 3139var model = compilation.GetSemanticModel(tree); 3175var model = compilation.GetSemanticModel(tree); 3215var model = compilation.GetSemanticModel(tree); 3237var model = compilation.GetSemanticModel(tree); 3264var model = compilation.GetSemanticModel(tree); 3316var model = compilation.GetSemanticModel(tree); 3343var model = compilation.GetSemanticModel(tree); 3369var model = compilation.GetSemanticModel(tree); 3386var model = compilation.GetSemanticModel(tree); 3410var model = compilation.GetSemanticModel(tree); 3431var model = compilation.GetSemanticModel(tree); 3450var model = compilation.GetSemanticModel(tree); 3480var model = compilation.GetSemanticModel(tree); 3498var model = compilation.GetSemanticModel(tree); 3526var model = compilation.GetSemanticModel(tree); 3563var model = compilation.GetSemanticModel(tree); 3584var model = compilation.GetSemanticModel(tree); 3609var model = compilation.GetSemanticModel(tree); 3631var model = compilation.GetSemanticModel(tree); 3667var model = compilation.GetSemanticModel(tree); 3684var model = compilation.GetSemanticModel(tree); 3711var model = compilation.GetSemanticModel(tree); 3739var model = compilation.GetSemanticModel(tree); 3751var model2 = compilation.GetSemanticModel(tree2); 3788var model = compilation.GetSemanticModel(tree); 3806var model = compilation.GetSemanticModel(tree); 3825var model = compilation.GetSemanticModel(tree); 3846var semanticModel = compilation.GetSemanticModel(tree); 3874var model2 = compilation.GetSemanticModel(tree); 3900var model = comp.GetSemanticModel(tree); 3921var model = comp.GetSemanticModel(tree); 3967var model = c2.GetSemanticModel(tree2); 3997var model = compilation.GetSemanticModel(tree); 4086var model = compilation.GetSemanticModel(tree); 4125var model = comp.GetSemanticModel(tree); 4167var model = compilation.GetSemanticModel(tree); 4245var parentModel = compilation.GetSemanticModel(tree); 4251SemanticModel speculativeModel; 4414var model = compilation.GetSemanticModel(tree); 4438var model = compilation.GetSemanticModel(tree); 4469var model = compilation.GetSemanticModel(tree); 4500var model = compilation.GetSemanticModel(tree); 4534var model = compilation.GetSemanticModel(tree); 4576var model = compilation.GetSemanticModel(tree); 4603var model = compilation.GetSemanticModel(tree); 4652var model = compilation.GetSemanticModel(tree); 4692var model = compilation.GetSemanticModel(tree); 4707var model = compilation.GetSemanticModel(tree); 4722var model = compilation.GetSemanticModel(tree); 4744var model = compilation.GetSemanticModel(tree); 4770var model = compilation.GetSemanticModel(tree); 4798var model = compilation.GetSemanticModel(tree); 4821var model = compilation.GetSemanticModel(tree); 4844var model = compilation.GetSemanticModel(tree); 4867var model = compilation.GetSemanticModel(tree); 4890var model = compilation.GetSemanticModel(tree); 4913var model = compilation.GetSemanticModel(tree); 4936var model = compilation.GetSemanticModel(tree); 4959var model = compilation.GetSemanticModel(tree); 4994var model = compilation.GetSemanticModel(tree); 5040var model = compilation.GetSemanticModel(tree); 5089var model = compilation.GetSemanticModel(tree); 5112var model = compilation.GetSemanticModel(tree); 5129var model = compilation.GetSemanticModel(tree); 5171var model = compilation.GetSemanticModel(tree); 5204var model = comp.GetSemanticModel(tree); 5221var model = comp.GetSemanticModel(tree); 5242var model = comp.GetSemanticModel(tree); 5263var model = comp.GetSemanticModel(tree); 5301var model = comp.GetSemanticModel(tree); 5352var model = comp.GetSemanticModel(tree); 5396var model = comp.GetSemanticModel(tree); 5444var model = comp.GetSemanticModel(tree); 5487var model = comp.GetSemanticModel(tree); 5538var model = comp.GetSemanticModel(tree); 5582var model = comp.GetSemanticModel(tree); 5630var model = comp.GetSemanticModel(tree); 5643SemanticModel model,
Compilation\SemanticModelGetSemanticInfoTests.cs (22)
1113var model = compilation.GetSemanticModel(tree); 1662var model = compilation.GetSemanticModel(tree); 8266var semanticModel = compilation.GetSemanticModel(tree); 8431var semanticModel = compilation.GetSemanticModel(tree); 8455var semanticModel = compilation.GetSemanticModel(tree); 12123var model = comp.GetSemanticModel(tree); 14484var model = compilation.GetSemanticModel(tree); 14653var model = comp.GetSemanticModel(tree); 14736var model = compilation.GetSemanticModel(tree); 14786var model = compilation.GetSemanticModel(tree); 14882var model = compilation.GetSemanticModel(tree); 14993var model = compilation.GetSemanticModel(tree); 15053var model = compilation.GetSemanticModel(tree); 15371var semanticModel = compilation.GetSemanticModel(tree); 15432var model = compilation.GetSemanticModel(tree); 15459var model = compilation.GetSemanticModel(tree); 15496var model = compilation.GetSemanticModel(tree); 15537var model = compilation.GetSemanticModel(tree); 15579var model = compilation.GetSemanticModel(tree); 15620var model = compilation.GetSemanticModel(tree); 15655var model = compilation.GetSemanticModel(tree); 15690var model = compilation.GetSemanticModel(tree);
DocumentationComments\CrefTests.cs (92)
304var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 905var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 1001var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 1100var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 1814var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 2014var model = compilation.GetSemanticModel(crefSyntax.SyntaxTree); 2053var model = compilation.GetSemanticModel(crefSyntax.SyntaxTree); 2107var model = compilation.GetSemanticModel(crefSyntax.SyntaxTree); 2942var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 2964var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 2996var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3071var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3096var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3123var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3154var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3177var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3200var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3223var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3247var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3271var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3295var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3319var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3342var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3369var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4556var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4574var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4592var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4609var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4645var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4697var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4753var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4785var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4819var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4847var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4874var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4908var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4935var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4977var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5009var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5044var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5086var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5138var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5175var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5197var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5240var model = compilation.GetSemanticModel(tree); 5283var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5309var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5335var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5361var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5400var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5423var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5443var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5469var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5491var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5558var model = compilation.GetSemanticModel(tree); 5595var model = compilation.GetSemanticModel(tree); 5625var model = compilation.GetSemanticModel(tree); 5658var model = compilation.GetSemanticModel(tree); 5696var model = compilation.GetSemanticModel(tree); 5715var model = compilation.GetSemanticModel(tree); 5748var model = compilation.GetSemanticModel(tree); 5791var model = compilation.GetSemanticModel(tree); 5850var model = compilation.GetSemanticModel(cref.SyntaxTree); 5899var model = compilation.GetSemanticModel(cref.SyntaxTree); 5923var model = compilation.GetSemanticModel(cref.SyntaxTree); 5947var model = compilation.GetSemanticModel(cref.SyntaxTree); 5972var model = compilation.GetSemanticModel(cref.SyntaxTree); 5996var model = compilation.GetSemanticModel(cref.SyntaxTree); 6024var model = compilation.GetSemanticModel(cref.SyntaxTree); 6046var model = compilation.GetSemanticModel(typeParameterSyntax.SyntaxTree); 6070var model = compilation.GetSemanticModel(methodNameSyntax.SyntaxTree); 6102var model = compilation.GetSemanticModel(tree); 6137var model = compilation.GetSemanticModel(tree); 6180var model = compilation.GetSemanticModel(tree); 6208var model = compilation.GetSemanticModel(tree); 6238var model = compilation.GetSemanticModel(tree); 6276var model = compilation.GetSemanticModel(tree); 6288SemanticModel speculativeModel; 6335var model = compilation.GetSemanticModel(tree); 6422var model = comp.GetSemanticModel(tree); 6460var model = comp.GetSemanticModel(tree); 6493var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 6528var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 6555var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 6577var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 6600var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 6609private static ISymbol[] GetCrefOriginalDefinitions(SemanticModel model, IEnumerable<CrefSyntax> crefs) 6635var model = compilation.GetSemanticModel(tree); 6665var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 6708var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 6858var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 7027var model = comp.GetSemanticModel(comp.SyntaxTrees.Single());
DocumentationComments\DocumentationCommentIDTests.cs (4)
30var model = comp.GetSemanticModel(tree); 143var model = comp.GetSemanticModel(tree); 164var model = comp.GetSemanticModel(tree); 308var model = comp.GetSemanticModel(tree);
DocumentationComments\ParameterTests.cs (27)
34var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 57var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 81var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 105var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 134var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 159var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 184var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 205var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 226var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 247var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 272var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 298var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 326var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 349var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 373var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 404var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 431var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 458var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 485var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 512var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 539var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 566var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 594var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 643var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 690var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 742var model = compilation.GetSemanticModel(tree); 789var model = compilation.GetSemanticModel(tree);
SymbolDisplay\SymbolDisplayTests.cs (32)
3148var model = comp.GetSemanticModel(tree); 3705var model = comp.GetSemanticModel(tree); 5710var model = comp.GetSemanticModel(comp.SyntaxTrees.First()); 5736var model = comp.GetSemanticModel(tree); 6176var model = comp.GetSemanticModel(tree); 6723var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6766var semanticModel = comp.GetSemanticModel(srcTree); 6800var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6862var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6895var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6956var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6989var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7034var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7152var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7190var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7228var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7288var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7360var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7620var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7773var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7801var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 8025var model = compilation.GetSemanticModel(tree); 8117var model = compilation.GetSemanticModel(tree); 8177var model = compilation.GetSemanticModel(tree); 8209var model = compilation.GetSemanticModel(tree); 8512var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 8563var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 8598var model = comp.GetSemanticModel(tree); 8989var model = comp.GetSemanticModel(tree); 9045var model = comp.GetSemanticModel(tree); 9138var model = comp.GetSemanticModel(tree); 9264var model = compilation.GetSemanticModel(tree);
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
1023var semanticModel = compilation.GetSemanticModel(syntaxTree);
Symbols\AnonymousTypesSemanticsTests.cs (1)
2036public SemanticModel Model;
Symbols\AnonymousTypesSymbolTests.cs (3)
1476var model = compilation.GetSemanticModel(compilation.SyntaxTrees[0]); 1639var model = comp.GetSemanticModel(tree); 1680var model = comp.GetSemanticModel(tree);
Symbols\AssemblyAndNamespaceTests.cs (1)
332var model = compilation.GetSemanticModel(tree);
Symbols\CheckedUserDefinedOperatorsTests.cs (5)
7233var model = compilation1.GetSemanticModel(tree); 7305var model = compilation1.GetSemanticModel(tree); 7376var model = compilation1.GetSemanticModel(tree); 7449var model = compilation1.GetSemanticModel(tree); 7513var model = compilation1.GetSemanticModel(tree);
Symbols\ConversionTests.cs (15)
391var model = compilation.GetSemanticModel(tree); 453var model = comp.GetSemanticModel(tree); 484var model = comp.GetSemanticModel(tree); 519var model = comp.GetSemanticModel(tree); 555var model = comp.GetSemanticModel(tree); 591var model = comp.GetSemanticModel(tree); 625var model = comp.GetSemanticModel(tree); 660var model = comp.GetSemanticModel(tree); 685var model = comp.GetSemanticModel(tree); 716var model = comp.GetSemanticModel(tree); 742var model = comp.GetSemanticModel(tree); 765var model = comp.GetSemanticModel(tree); 2068var model = comp.GetSemanticModel(tree); 2138var model = comp.GetSemanticModel(tree); 2172var model = comp.GetSemanticModel(tree);
Symbols\CorLibrary\CorTypes.cs (2)
302var model = comp.GetSemanticModel(tree); 367var model = comp1.GetSemanticModel(tree);
Symbols\CovariantReturnTests.cs (2)
378var model = comp.GetSemanticModel(tree); 2620var model = vbComp.GetSemanticModel(vbTree);
Symbols\DestructorTests.cs (1)
405var model = compilation.GetSemanticModel(tree);
Symbols\EnumTests.cs (1)
352var model = comp.GetSemanticModel(tree);
Symbols\ExtensionMethodTests.cs (10)
2432var model = compilation.GetSemanticModel(tree); 2725var model = compilation.GetSemanticModel(tree); 2951var model = compilation.GetSemanticModel(tree); 3009var model = compilation.GetSemanticModel(tree); 3137var model = comp.GetSemanticModel(tree); 3776var model = compilation.GetSemanticModel(syntaxTree); 3864var model = compilation.GetSemanticModel(tree); 3911var model = compilation.GetSemanticModel(tree); 3956var model = compilation.GetSemanticModel(tree); 4006var model = compilation.GetSemanticModel(tree);
Symbols\FunctionPointerTypeSymbolTests.cs (16)
50var model = comp.GetSemanticModel(syntaxTree); 123var model = comp.GetSemanticModel(syntaxTree); 203var model = comp.GetSemanticModel(syntaxTree); 270var model = comp.GetSemanticModel(syntaxTree); 338var model = comp.GetSemanticModel(syntaxTree); 404var model = comp.GetSemanticModel(syntaxTree); 484var model = comp.GetSemanticModel(syntaxTree); 601var model = comp.GetSemanticModel(syntaxTree); 683var model = comp.GetSemanticModel(syntaxTree); 1146var model = comp.GetSemanticModel(syntaxTree); 1258var model = comp.GetSemanticModel(syntaxTree); 1316var model = compilation.GetSemanticModel(syntaxTree); 1419var model = comp.GetSemanticModel(syntaxTree); 1677var model = comp.GetSemanticModel(syntaxTree); 1788var model = comp.GetSemanticModel(syntaxTree); 1918var model = comp.GetSemanticModel(syntaxTree);
Symbols\GenericConstraintTests.cs (2)
7434var model = comp.GetSemanticModel(tree); 7459var model = comp.GetSemanticModel(tree);
Symbols\ImplicitClassTests.cs (2)
71var model = c.GetSemanticModel(tree); 114var model = comp.GetSemanticModel(tree);
Symbols\IndexerTests.cs (9)
1296var model = comp.GetSemanticModel(tree); 2235var model = comp.GetSemanticModel(tree); 2276var model = comp.GetSemanticModel(tree); 2318var model = comp.GetSemanticModel(tree); 2356var model = comp.GetSemanticModel(tree); 2530private static void CheckOverloadResolutionResults(SyntaxTree tree, SemanticModel model, params string[] expected) 2614var model = comp.GetSemanticModel(tree); 2701var model = comp.GetSemanticModel(tree); 2844var model = comp2.GetSemanticModel(tree);
Symbols\LocalFunctionTests.cs (8)
33var semanticModel = compilation.GetSemanticModel(tree); 54var semanticModel = compilation.GetSemanticModel(tree); 75var semanticModel = compilation.GetSemanticModel(tree); 98var semanticModel = compilation.GetSemanticModel(tree); 445var model = comp.GetSemanticModel(tree); 469var model = comp.GetSemanticModel(tree); 498var model = comp.GetSemanticModel(tree); 521var model = comp.GetSemanticModel(tree);
Symbols\LookupSymbolsInfoTests.cs (1)
94var model = compilation.GetSemanticModel(tree);
Symbols\Metadata\MetadataTypeTests.cs (1)
371var model = currComp.GetSemanticModel(newTree);
Symbols\MethodEqualityTests.cs (1)
206var model = comp.GetSemanticModel(tree);
Symbols\PartialPropertiesTests.cs (5)
5171var model = comp.GetSemanticModel(tree); 5226var model = comp.GetSemanticModel(tree); 5262var model = comp.GetSemanticModel(tree); 5309var model = comp.GetSemanticModel(tree); 5346var model = comp.GetSemanticModel(tree);
Symbols\RelaxedShiftOperatorTests.cs (6)
101var model = compilation1.GetSemanticModel(tree); 145var model = compilation1.GetSemanticModel(tree); 189var model = compilation1.GetSemanticModel(tree); 233var model = compilation1.GetSemanticModel(tree); 277var model = compilation1.GetSemanticModel(tree); 321var model = compilation1.GetSemanticModel(tree);
Symbols\RequiredMembersTests.cs (1)
7647var model = comp.GetSemanticModel(tree);
Symbols\Source\BaseClassTests.cs (3)
271var model = comp.GetSemanticModel(tree); 308var model = comp.GetSemanticModel(tree); 2031var model = comp.GetSemanticModel(tree);
Symbols\Source\DeclaringSyntaxNodeTests.cs (6)
44SemanticModel model = compilation.GetSemanticModel(tree); 137var model = comp.GetSemanticModel(tree); 152var model = comp.GetSemanticModel(tree); 259var model = comp.GetSemanticModel(tree); 302var model = comp.GetSemanticModel(tree); 327private void CheckAnonymousType(SemanticModel model, ILocalSymbol local, AnonymousObjectCreationExpressionSyntax anonObjectCreation)
Symbols\Source\DelegateTests.cs (3)
734var model = comp.GetSemanticModel(syntaxTree); 761var model = comp.GetSemanticModel(syntaxTree); 823var model = compilation.GetSemanticModel(tree);
Symbols\Source\EnumTests.cs (1)
956var model = compilation.GetSemanticModel(tree);
Symbols\Source\EventTests.cs (3)
303var semanticModel = compVerifier.Compilation.GetSemanticModel(compVerifier.Compilation.SyntaxTrees.Single()); 433var model = compilation.GetSemanticModel(tree); 479var model = compilation.GetSemanticModel(tree);
Symbols\Source\ExternAliasTests.cs (4)
354var model = comp.GetSemanticModel(tree); 406var model = comp3.GetSemanticModel(tree); 432var model = comp3.GetSemanticModel(tree); 476var model = comp.GetSemanticModel(tree);
Symbols\Source\FileModifierTests.cs (22)
1232var model = comp.GetSemanticModel(tree, ignoreAccessibility: true); 1366var model = comp.GetSemanticModel(tree, ignoreAccessibility: true); 1432var model = comp.GetSemanticModel(tree, ignoreAccessibility: true); 1490var model = comp.GetSemanticModel(tree, ignoreAccessibility: true); 1804var model = comp.GetSemanticModel(tree, ignoreAccessibility: true); 1879var model = comp.GetSemanticModel(tree, ignoreAccessibility: true); 2595var model = comp.GetSemanticModel(tree); 2635var model = comp.GetSemanticModel(tree); 3504var model = comp.GetSemanticModel(tree); 3555var model = comp.GetSemanticModel(tree); 3611var model = compilation.GetSemanticModel(tree); 3643var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 3713var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 3775var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 3778Assert.True(model.TryGetSpeculativeSemanticModel(position: body.OpenBraceToken.EndPosition, newBody, out var speculativeModel)); 3816var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false); 3819Assert.True(model.TryGetSpeculativeSemanticModel(position: body.OpenBraceToken.EndPosition, newBody, out var speculativeModel)); 3978var model = comp.GetSemanticModel(tree); 4122var model = comp.GetSemanticModel(tree); 4409var model = comp.GetSemanticModel(tree); 4453var model = comp.GetSemanticModel(tree); 4476var model = comp.GetSemanticModel(tree);
Symbols\Source\LocalTests.cs (1)
62var model = compilation.GetSemanticModel(tree);
Symbols\Source\MethodTests.cs (2)
2530var model = comp.GetSemanticModel(syntax); 2561var model = comp.GetSemanticModel(syntax);
Symbols\Source\NullablePublicAPITests.cs (128)
53var model = comp.GetSemanticModel(syntaxTree); 87var model = comp.GetSemanticModel(syntaxTree); 569var semanticModel = comp.GetSemanticModel(syntaxTree); 944var model = comp.GetSemanticModel(syntaxTree); 1001var model = comp.GetSemanticModel(syntaxTree); 1094var model = comp.GetSemanticModel(syntaxTree); 1121var model = comp.GetSemanticModel(syntaxTree); 1169Assert.True(syntaxContext.SemanticModel.TryGetSpeculativeSemanticModel(syntaxContext.Node.SpanStart, newSource, out var specModel)); 1209var model = comp.GetSemanticModel(syntaxTree); 1261var model = comp.GetSemanticModel(syntaxTree); 1359var model = comp.GetSemanticModel(syntaxTree); 1395Assert.True(model.TryGetSpeculativeSemanticModel(spanStart, newSource, out var speculativeModel)); 1439var model = comp.GetSemanticModel(syntaxTree); 1444Assert.True(model.TryGetSpeculativeSemanticModel(returnStatement.SpanStart, newSource, out var specModel)); 1511var model = comp.GetSemanticModel(syntaxTree); 1567var model = comp.GetSemanticModel(syntaxTree); 1624var model = comp.GetSemanticModel(syntaxTree); 1667var model = comp.GetSemanticModel(syntaxTree); 1710var model = comp.GetSemanticModel(syntaxTree); 1792var model = context.SemanticModel; 1849var model = comp.GetSemanticModel(syntaxTree); 1892var model = comp.GetSemanticModel(syntaxTree); 1937var model = comp.GetSemanticModel(syntaxTree); 1984var model = comp.GetSemanticModel(syntaxTree); 2045var model = comp.GetSemanticModel(syntaxTree); 2088var model = comp.GetSemanticModel(syntaxTree); 2131var model = comp.GetSemanticModel(syntaxTree); 2138Assert.True(model.TryGetSpeculativeSemanticModel(s2Assignment.SpanStart, newDeclaration, out var specModel)); 2174var model = comp.GetSemanticModel(syntaxTree); 2216var model = comp.GetSemanticModel(syntaxTree); 2246var model = comp.GetSemanticModel(syntaxTree); 2281var model = comp.GetSemanticModel(syntaxTree); 2325var model = comp.GetSemanticModel(syntaxTree); 2366var model = comp.GetSemanticModel(syntaxTree); 2411var model = comp.GetSemanticModel(syntaxTree); 2451var model = comp.GetSemanticModel(syntaxTree); 2499var model = comp.GetSemanticModel(syntaxTree); 2544var model = comp.GetSemanticModel(syntaxTree); 2593var model = comp.GetSemanticModel(syntaxTree); 2627var model = comp.GetSemanticModel(syntaxTree); 2661var model = comp.GetSemanticModel(syntaxTree); 2699var model = comp.GetSemanticModel(syntaxTree); 2735var model = comp.GetSemanticModel(syntaxTree); 2781var model = comp.GetSemanticModel(syntaxTree); 2824var model = comp.GetSemanticModel(syntaxTree); 2873var model = comp.GetSemanticModel(syntaxTree); 2914var model = comp.GetSemanticModel(syntaxTree); 2955var model = comp.GetSemanticModel(syntaxTree); 2997var model = comp.GetSemanticModel(syntaxTree); 3039var model = comp.GetSemanticModel(syntaxTree); 3099var model = comp.GetSemanticModel(syntaxTree); 3146var model = comp.GetSemanticModel(syntaxTree); 3191var model = comp.GetSemanticModel(syntaxTree); 3256var model = comp.GetSemanticModel(syntaxTree); 3308var model = comp.GetSemanticModel(syntaxTree); 3357var model = comp.GetSemanticModel(syntaxTree); 3404var model = comp.GetSemanticModel(syntaxTree); 3449var model = comp.GetSemanticModel(syntaxTree); 3486var model = comp.GetSemanticModel(syntaxTree); 3535var model = comp.GetSemanticModel(syntaxTree); 3596var model = comp.GetSemanticModel(syntaxTree); 3659var model = comp.GetSemanticModel(syntaxTree); 3696var model = comp.GetSemanticModel(tree); 3701Assert.True(model.TryGetSpeculativeSemanticModel(localFunctionBody.Body!.OpenBraceToken.SpanStart + 1, @return, out var specModel)); 3731var model = comp.GetSemanticModel(tree); 3736Assert.True(model.TryGetSpeculativeSemanticModel(localFunctionBody.Block!.OpenBraceToken.SpanStart + 1, @return, out var specModel)); 3767var model = comp.GetSemanticModel(syntaxTree); 3781Assert.True(model.TryGetSpeculativeSemanticModel(lambda.Body.SpanStart, newStatement, out var speculativeModel)); 3806var model = comp.GetSemanticModel(syntaxTree); 3852var model = comp.GetSemanticModel(syntaxTree); 3911var model = comp.GetSemanticModel(syntaxTree); 3973var model = comp.GetSemanticModel(syntaxTree); 4042var model = comp.GetSemanticModel(syntaxTree); 4063Assert.True(model.TryGetSpeculativeSemanticModel(localFunction.SpanStart, speculativeAttribute, out var speculativeModel)); 4109var model = comp.GetSemanticModel(syntaxTree); 4172var model = comp.GetSemanticModel(syntaxTree); 4206var model = comp.GetSemanticModel(syntaxTree); 4211Assert.True(model.TryGetSpeculativeSemanticModel(attributeUsage.SpanStart, newAttributeUsage, out var specModel)); 4238var model = comp.GetSemanticModel(syntaxTree); 4267var model = comp.GetSemanticModel(syntaxTree); 4301var model = comp.GetSemanticModel(syntaxTree); 4331var model = comp.GetSemanticModel(tree); 4361var model = comp.GetSemanticModel(tree); 4365Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, statement, out var speculativeModel)); 4389var model = comp.GetSemanticModel(tree); 4393Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, statement, out var speculativeModel)); 4417var model = comp.GetSemanticModel(tree); 4423Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, statement, out var speculativeModel)); 4447var model = comp.GetSemanticModel(tree); 4453Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, statement, out var speculativeModel)); 4477var model = comp.GetSemanticModel(tree); 4483Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, statement, out var speculativeModel)); 4507var model = comp.GetSemanticModel(tree); 4515Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(type.SpanStart, methodDeclaration, out var speculativeModel)); 4539var model = comp.GetSemanticModel(tree); 4548Assert.True(model.TryGetSpeculativeSemanticModelForMethodBody(type.SpanStart, methodDeclaration, out var speculativeModel)); 4572var model = comp.GetSemanticModel(tree); 4576Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, arrow, out var speculativeModel)); 4600var model = comp.GetSemanticModel(tree); 4606Assert.True(model.TryGetSpeculativeSemanticModel(type.SpanStart, arrow, out var speculativeModel)); 4633var model = comp.GetSemanticModel(tree); 4637Assert.True(model.TryGetSpeculativeSemanticModel(initializer.SpanStart, newInitializer, out var speculativeModel)); 4664var model = comp.GetSemanticModel(tree); 4670Assert.True(model.TryGetSpeculativeSemanticModel(initializer.SpanStart, newInitializer, out var speculativeModel)); 4695var model = comp.GetSemanticModel(tree); 4725var model = comp.GetSemanticModel(tree); 4776var model = comp.GetSemanticModel(syntaxTree); 4811var model = comp.GetSemanticModel(tree); 4845var model = context.SemanticModel; 4897var model = comp.GetSemanticModel(tree); 4909Assert.True(model.TryGetSpeculativeSemanticModel(spanStart, newBody, out var speculativeModel)); 4931var model = comp.GetSemanticModel(tree); 4962var model = comp.GetSemanticModel(tree); 5005var model = comp.GetSemanticModel(tree); 5044var model = comp.GetSemanticModel(tree); 5064var model = comp.GetSemanticModel(tree); 5098var model = comp.GetSemanticModel(tree); 5130var model = comp.GetSemanticModel(tree); 5158var model = comp.GetSemanticModel(tree); 5193var model = comp.GetSemanticModel(tree, options); 5228var model = comp.GetSemanticModel(tree, options); 5249var model = comp.GetSemanticModel(tree); 5272var model = comp.GetSemanticModel(tree); 5304var model = comp.GetSemanticModel(tree); 5327var model = comp.GetSemanticModel(tree); 5349var model = comp.GetSemanticModel(tree); 5394var model = comp.GetSemanticModel(tree); 5451var model = comp.GetSemanticModel(tree);
Symbols\Source\UpdatedContainingSymbolAndNullableAnntotationTests.cs (1)
35var model = comp.GetSemanticModel(syntaxTree);
Symbols\Source\UsingAliasTests.cs (22)
46var model = comp.GetSemanticModel(tree); 103var model = comp.GetSemanticModel(tree); 163var model = comp.GetSemanticModel(tree); 218var model = comp.GetSemanticModel(tree); 273var model = comp.GetSemanticModel(tree); 310var model = comp.GetSemanticModel(tree); 356var model = comp.GetSemanticModel(tree); 387var model = comp.GetSemanticModel(tree); 408var model = comp.GetSemanticModel(tree); 427var model = comp.GetSemanticModel(tree); 446var model = comp.GetSemanticModel(tree); 465var model = comp.GetSemanticModel(tree); 484var model = comp.GetSemanticModel(tree); 505var model = comp.GetSemanticModel(tree); 544var model = comp.GetSemanticModel(syntaxTree); 564var model = comp.GetSemanticModel(syntaxTree); 583var model = comp.GetSemanticModel(syntaxTree); 603var model = comp.GetSemanticModel(syntaxTree); 627var model = comp.GetSemanticModel(syntaxTree); 650var model = comp.GetSemanticModel(syntaxTree); 701var model = compilation.GetSemanticModel(tree); 744var model = compilation.GetSemanticModel(tree);
Symbols\StaticAbstractMembersInInterfacesTests.cs (26)
8434var model = compilation1.GetSemanticModel(tree); 9022var model = compilation1.GetSemanticModel(tree); 9337var model = compilation1.GetSemanticModel(tree); 9736var model = compilation1.GetSemanticModel(tree); 10733var model = compilation1.GetSemanticModel(tree); 10926var model = compilation1.GetSemanticModel(tree); 11116var model = compilation1.GetSemanticModel(tree); 11310var model = compilation1.GetSemanticModel(tree); 11564var model = compilation1.GetSemanticModel(tree); 11941var model = compilation1.GetSemanticModel(tree); 12120var model = compilation1.GetSemanticModel(tree); 13161var model = compilation1.GetSemanticModel(tree); 13247var model = compilation1.GetSemanticModel(tree); 13369var model = compilation1.GetSemanticModel(tree); 14070var model = compilation1.GetSemanticModel(tree); 14695var model = compilation1.GetSemanticModel(tree); 15101var model = compilation1.GetSemanticModel(tree); 15369var model = compilation1.GetSemanticModel(tree); 20097var model = compilation1.GetSemanticModel(tree); 20180var model = compilation1.GetSemanticModel(tree); 20272var model = compilation1.GetSemanticModel(tree); 20361var model = compilation1.GetSemanticModel(tree); 29310var model = compilation1.GetSemanticModel(tree); 30817var model = compilation1.GetSemanticModel(tree); 31008var model = compilation1.GetSemanticModel(tree); 31474var model = compilation1.GetSemanticModel(tree);
Symbols\SymbolEqualityTests.cs (19)
39var model = comp.GetSemanticModel(tree); 82var model = comp.GetSemanticModel(tree); 122var model = comp.GetSemanticModel(tree); 163var model = comp.GetSemanticModel(tree); 414var model = comp.GetSemanticModel(syntaxTree); 452var model = comp.GetSemanticModel(syntaxTree); 483var model = comp.GetSemanticModel(syntaxTree); 526var model = comp.GetSemanticModel(syntaxTree); 557var model = comp.GetSemanticModel(syntaxTree); 593var model = comp.GetSemanticModel(syntaxTree); 628var model = comp.GetSemanticModel(syntaxTree); 677var model = comp.GetSemanticModel(syntaxTree); 729var model = comp.GetSemanticModel(syntaxTree); 779var model = comp.GetSemanticModel(syntaxTree); 830var model = comp.GetSemanticModel(syntaxTree); 891var model = comp.GetSemanticModel(syntaxTree); 936var semanticModel1 = comp.GetSemanticModel(syntaxTree); 937var semanticModel2 = comp.GetSemanticModel(syntaxTree); 960var model = comp.GetSemanticModel(syntaxTree);
Symbols\SymbolExtensionTests.cs (5)
102var model = compilation.GetSemanticModel(tree); 120var model = compilation.GetSemanticModel(tree); 138var model = compilation.GetSemanticModel(tree); 157var model = compilation.GetSemanticModel(tree); 251var model = compilation.GetSemanticModel(tree);
Symbols\TypeTests.cs (3)
1677var model = comp.GetSemanticModel(tree); 1761var model = comp.GetSemanticModel(tree); 1852var model = compilation.GetSemanticModel(tree);
Symbols\UnsignedRightShiftTests.cs (9)
122var model = compilation1.GetSemanticModel(tree); 625var model = compilation1.GetSemanticModel(tree); 1175var model = compilation1.GetSemanticModel(tree); 1583var model = compilation1.GetSemanticModel(tree); 1982var model = compilation1.GetSemanticModel(tree); 2234var model = compilation1.GetSemanticModel(tree); 2376var model = compilation1.GetSemanticModel(tree); 2510var model = compilation1.GetSemanticModel(tree); 2607var model = compilation1.GetSemanticModel(tree);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Syntax\FieldAndValueKeywordTests.cs (1)
1566var model = comp.GetSemanticModel(syntaxTree);
Syntax\LambdaUtilitiesTests.cs (1)
45var model = compilation.GetSemanticModel(tree, ignoreAccessibility: false);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (21)
CompilationTestUtils.cs (6)
226public static SemanticInfoSummary GetSemanticInfoSummary(this SemanticModel semanticModel, SyntaxNode node) 299public static SemanticInfoSummary GetSpeculativeSemanticInfoSummary(this SemanticModel semanticModel, int position, SyntaxNode node, SpeculativeBindingOption bindingOption) 341public static List<string> LookupNames(this SemanticModel model, int position, INamespaceOrTypeSymbol container = null, bool namespacesAndTypesOnly = false, bool useBaseReferenceAccessibility = false) 353internal static TypeInfo GetTypeInfoAndVerifyIOperation(this SemanticModel model, SyntaxNode expression) 392static IOperation getOperation(SemanticModel model, SyntaxNode expression) 463var model = compilation.GetSemanticModel(tree);
CSharpTestBase.cs (8)
2181public Tuple<TNode, SemanticModel> GetBindingNodeAndModel<TNode>(CSharpCompilation compilation, int treeIndex = 0) where TNode : SyntaxNode 2185return new Tuple<TNode, SemanticModel>(node, compilation.GetSemanticModel(compilation.SyntaxTrees[treeIndex])); 2188public Tuple<TNode, SemanticModel> GetBindingNodeAndModel<TNode>(Compilation compilation, int treeIndex = 0) where TNode : SyntaxNode 2193public Tuple<IList<TNode>, SemanticModel> GetBindingNodesAndModel<TNode>(CSharpCompilation compilation, int treeIndex = 0, int which = -1) where TNode : SyntaxNode 2196return new Tuple<IList<TNode>, SemanticModel>(nodes, compilation.GetSemanticModel(compilation.SyntaxTrees[treeIndex])); 2600var model = compilation.GetSemanticModel(tree); 2650protected static void VerifyOperationTreeForNode(CSharpCompilation compilation, SemanticModel model, SyntaxNode syntaxNode, string expectedOperationTree) 2673var model = compilation.GetSemanticModel(syntaxNode.SyntaxTree);
FunctionPointerUtilities.cs (3)
136SemanticModel model, 236static void verifyNestedFunctionPointerSyntaxSemanticInfo(SemanticModel model, IFunctionPointerTypeSymbol ptrType, SeparatedSyntaxList<FunctionPointerParameterSyntax> paramSyntaxes) 252static void assertEqualSemanticInformation(SemanticModel model, TypeSyntax typeSyntax, ITypeSymbol signatureType)
SemanticModelTestBase.cs (4)
98var model = compilation.GetSemanticModel(tree); 129var model = compilation.GetSemanticModel(tree); 139var model = compilation.GetSemanticModel(tree); 155var model = compilation.GetSemanticModel(tree);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
CodeGen\WinMdEventTests.cs (1)
670var model = comp.GetSemanticModel(tree);
CodeGen\WinRTCollectionTests.cs (1)
7422var model = comp.GetSemanticModel(tree);
Microsoft.CodeAnalysis.CSharp.Workspaces (312)
CaseCorrection\CSharpCaseCorrectionService.cs (1)
27SemanticModel? semanticModel,
Classification\SyntaxClassification\DiscardSyntaxClassifier.cs (1)
23SemanticModel semanticModel,
Classification\SyntaxClassification\DocCommentCodeBlockClassifier.cs (2)
36SemanticModel semanticModel, 102SemanticModel semanticModel,
Classification\SyntaxClassification\FunctionPointerUnmanagedCallingConventionClassifier.cs (1)
23SemanticModel semanticModel,
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
26SemanticModel semanticModel, 46SemanticModel semanticModel,
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.cs (1)
29SemanticModel semanticModel,
Classification\SyntaxClassification\SyntaxTokenClassifier.cs (1)
29SemanticModel semanticModel,
Classification\SyntaxClassification\UsingDirectiveSyntaxClassifier.cs (2)
21SemanticModel semanticModel, 36SemanticModel semanticModel,
EmbeddedLanguages\CSharpTestEmbeddedLanguageUtilities.cs (2)
18Host.SolutionServices solutionServices, SemanticModel semanticModel, 27var semanticModeWithTestFile = compilationWithTestFile.GetSemanticModel(testFileTree);
ExternalAccess\Pythia\Api\PythiaSymbolExtensions.cs (1)
35public static bool IsAwaitableNonDynamic(this ISymbol? symbol, SemanticModel semanticModel, int position)
Recommendations\CSharpRecommendationServiceRunner.cs (6)
310var semanticModel = _context.SemanticModel; 337var semanticModel = _context.SemanticModel; 595var semanticModel = _context.SemanticModel; 723var semanticModel = _context.SemanticModel; 905var semanticModel = _context.SemanticModel; 925private ITypeSymbol? GetContainerForUnnamedSymbols(SemanticModel semanticModel, ExpressionSyntax originalExpression)
Rename\CSharpRenameRewriterLanguageService.cs (5)
56private readonly SemanticModel _semanticModel; 104private SemanticModel? _speculativeModel; 996SemanticModel semanticModel, 1190public static SemanticModel? GetSemanticModelForNode(SyntaxNode node, SemanticModel originalSemanticModel)
Simplification\CSharpSimplificationService.cs (5)
52public override SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken) 77public override SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken) 169protected override SemanticModel GetSpeculativeSemanticModel(ref SyntaxNode nodeToSpeculate, SemanticModel originalSemanticModel, SyntaxNode originalNode) 185protected override void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken)
Simplification\CSharpSimplificationService.Expander.cs (5)
46private readonly SemanticModel _semanticModel; 53SemanticModel semanticModel, 98var speculativeSemanticModel = speculativeAnalyzer.SpeculativeSemanticModel; 779private static bool IsInvocationWithDynamicArguments(SimpleNameSyntax originalSimpleName, SemanticModel semanticModel) 1013private bool IsTypeOfUnboundGenericType(SemanticModel semanticModel, TypeOfExpressionSyntax typeOfExpression)
Simplification\Reducers\AbstractCSharpReducer.AbstractReductionRewriter.cs (4)
26protected SemanticModel? SemanticModel { get; private set; } 125Func<TNode, SemanticModel, CSharpSimplifierOptions, CancellationToken, SyntaxNode> simplifier) 158protected SyntaxToken SimplifyToken(SyntaxToken token, Func<SyntaxToken, SemanticModel, CSharpSimplifierOptions, CancellationToken, SyntaxToken> simplifier) 187public SyntaxNodeOrToken VisitNodeOrToken(SyntaxNodeOrToken nodeOrToken, SemanticModel semanticModel, bool simplifyAllDescendants)
Simplification\Reducers\CSharpCastReducer.cs (2)
29private static readonly Func<CastExpressionSyntax, SemanticModel, SimplifierOptions, CancellationToken, ExpressionSyntax> s_simplifyCast = SimplifyCast; 31private static ExpressionSyntax SimplifyCast(CastExpressionSyntax node, SemanticModel semanticModel, SimplifierOptions options, CancellationToken cancellationToken)
Simplification\Reducers\CSharpDefaultExpressionReducer.Rewriter.cs (2)
25private readonly Func<DefaultExpressionSyntax, SemanticModel, CSharpSimplifierOptions, CancellationToken, SyntaxNode> _simplifyDefaultExpression; 29SemanticModel semanticModel,
Simplification\Reducers\CSharpEscapingReducer.cs (2)
23private static readonly Func<SyntaxToken, SemanticModel, CSharpSimplifierOptions, CancellationToken, SyntaxToken> s_simplifyIdentifierToken = SimplifyIdentifierToken; 34SemanticModel semanticModel,
Simplification\Reducers\CSharpExtensionMethodReducer.cs (3)
23private static readonly Func<InvocationExpressionSyntax, SemanticModel, CSharpSimplifierOptions, CancellationToken, SyntaxNode> s_simplifyExtensionMethod = SimplifyExtensionMethod; 34SemanticModel semanticModel, 53private static InvocationExpressionSyntax TryReduceExtensionMethod(InvocationExpressionSyntax node, SemanticModel semanticModel, InvocationExpressionSyntax rewrittenNode, SimpleNameSyntax expressionName)
Simplification\Reducers\CSharpInferredMemberNameReducer.Rewriter.cs (4)
27private readonly Func<ArgumentSyntax, SemanticModel, SimplifierOptions, CancellationToken, ArgumentSyntax> s_simplifyTupleName; 29private ArgumentSyntax SimplifyTupleName(ArgumentSyntax node, SemanticModel semanticModel, SimplifierOptions options, CancellationToken cancellationToken) 39private static readonly Func<AnonymousObjectMemberDeclaratorSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyAnonymousTypeMemberName = SimplifyAnonymousTypeMemberName; 41private static SyntaxNode SimplifyAnonymousTypeMemberName(AnonymousObjectMemberDeclaratorSyntax node, SemanticModel semanticModel, SimplifierOptions options, CancellationToken canellationToken)
Simplification\Reducers\CSharpMiscellaneousReducer.cs (7)
25private static readonly Func<ParameterSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyParameter = SimplifyParameter; 36SemanticModel semanticModel, 69SemanticModel semanticModel, 83private static readonly Func<ParenthesizedLambdaExpressionSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyParenthesizedLambdaExpression = SimplifyParenthesizedLambdaExpression; 87SemanticModel semanticModel, 111private static readonly Func<BlockSyntax, SemanticModel, CSharpSimplifierOptions, CancellationToken, SyntaxNode> s_simplifyBlock = SimplifyBlock; 115SemanticModel semanticModel,
Simplification\Reducers\CSharpNameReducer.cs (2)
20private static readonly Func<SyntaxNode, SemanticModel, CSharpSimplifierOptions, CancellationToken, SyntaxNode> s_simplifyName = SimplifyName; 31SemanticModel semanticModel,
Simplification\Reducers\CSharpNullableAnnotationReducer.cs (2)
21private static readonly Func<NullableTypeSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyNullableType = SimplifyNullableType; 32SemanticModel semanticModel,
Simplification\Reducers\CSharpParenthesizedExpressionReducer.cs (2)
21private static readonly Func<ParenthesizedExpressionSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyParentheses = SimplifyParentheses; 32SemanticModel semanticModel,
Simplification\Reducers\CSharpParenthesizedPatternReducer.cs (2)
23private static readonly Func<ParenthesizedPatternSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyParentheses = SimplifyParentheses; 34SemanticModel semanticModel,
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (15)
30private static readonly ConditionalWeakTable<SemanticModel, StrongBox<bool>> s_modelToHasUsingAliasesMap = new(); 37protected static SyntaxToken? TryGetPredefinedKeywordToken(SemanticModel semanticModel, SpecialType specialType) 73ExpressionSyntax node, SemanticModel semanticModel, 85var originalModel = semanticModel.GetOriginalSemanticModel(); 196private static bool HasUsingAliases(SemanticModel semanticModel, CancellationToken cancellationToken) 211private static bool ComputeHasUsingAliases(SemanticModel model, CancellationToken cancellationToken) 257private static bool ValidateAliasForTarget(IAliasSymbol aliasReplacement, SemanticModel semanticModel, ExpressionSyntax node, ISymbol symbol) 310private static IAliasSymbol GetAliasForSymbol(INamespaceOrTypeSymbol symbol, SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken) 312var originalSemanticModel = semanticModel.GetOriginalSemanticModel(); 333private static int? GetNamespaceIdForAliasSearch(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 360private static SyntaxNode GetStartNodeForNamespaceId(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 365var originalSemanticMode = semanticModel.GetOriginalSemanticModel(); 379protected static bool InsideNameOfExpression(ExpressionSyntax expression, SemanticModel semanticModel) 393protected static bool PreferPredefinedTypeKeywordInMemberAccess(ExpressionSyntax expression, CSharpSimplifierOptions options, SemanticModel semanticModel) 403ExpressionSyntax expression, ExpressionSyntax simplifiedNode, SemanticModel semanticModel)
Simplification\Simplifiers\ExpressionSimplifier.cs (10)
32SemanticModel semanticModel, 65SemanticModel semanticModel, 88SemanticModel semanticModel, 222SemanticModel semanticModel, 259SemanticModel semanticModel, 273SemanticModel semanticModel, 316SemanticModel semanticModel, 367SemanticModel semanticModel, MemberAccessExpressionSyntax memberAccess, CancellationToken cancellationToken) 391private static bool AccessMethodWithDynamicArgumentInsideStructConstructor(MemberAccessExpressionSyntax memberAccess, SemanticModel semanticModel) 408SemanticModel semanticModel,
Simplification\Simplifiers\MemberAccessExpressionSimplifier.cs (1)
31SemanticModel semanticModel, MemberAccessExpressionSyntax memberAccessExpression, CancellationToken cancellationToken)
Simplification\Simplifiers\NameSimplifier.cs (10)
35SemanticModel semanticModel, 371SemanticModel semanticModel, CancellationToken cancellationToken) 401private static bool CanSimplifyNullable(INamedTypeSymbol type, NameSyntax name, SemanticModel semanticModel) 460SemanticModel semanticModel, 579NameSyntax name, TypeSyntax reducedName, SemanticModel semanticModel) 614private static bool CanReplaceWithReducedName(NameSyntax name, TypeSyntax reducedName, SemanticModel semanticModel, CancellationToken cancellationToken) 677private static bool IsNonReducableQualifiedNameInUsingDirective(SemanticModel model, NameSyntax name) 685private static bool IsQualifiedNameInUsingDirective(SemanticModel model, NameSyntax name) 714private static bool IsInScriptClass(SemanticModel model, NameSyntax name) 730private static bool PreferPredefinedTypeKeywordInDeclarations(NameSyntax name, CSharpSimplifierOptions options, SemanticModel semanticModel)
Simplification\Simplifiers\QualifiedCrefSimplifier.cs (3)
26SemanticModel semanticModel, 71QualifiedCrefSyntax crefSyntax, SemanticModel semanticModel, 78QualifiedCrefSyntax crefSyntax, SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (2)
32SemanticModel semanticModel, 119SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ArgumentSyntaxExtensions.cs (1)
40SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\AttributeArgumentSyntaxExtensions.cs (1)
24SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (3)
22SemanticModel semanticModel, 38DefaultExpressionSyntax defaultExpression, SemanticModel semanticModel, CancellationToken cancellationToken) 83DefaultExpressionSyntax defaultExpression, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (5)
321SemanticModel semanticModel, 424[NotNullWhen(true)] this ExpressionSyntax? expression, SemanticModel semanticModel, CancellationToken cancellationToken) 454[NotNullWhen(true)] this ExpressionSyntax? expression, SemanticModel semanticModel, CancellationToken cancellationToken) 465this ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken) 908SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (3)
20this ParenthesizedExpressionSyntax node, SemanticModel semanticModel, CancellationToken cancellationToken) 342SemanticModel semanticModel, CancellationToken cancellationToken) 409ParenthesizedExpressionSyntax node, ExpressionSyntax parentExpression, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (18)
23this SemanticModel semanticModel, 40this SemanticModel semanticModel, 103this SemanticModel semanticModel, 128public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token) 161public static ISet<INamespaceSymbol> GetUsingNamespacesInScope(this SemanticModel semanticModel, SyntaxNode location) 184this SemanticModel semanticModel, 318this SemanticModel semanticModel, 352this SemanticModel semanticModel, ExpressionSyntax expression, 429SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 459public static INamedTypeSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, BaseTypeDeclarationSyntax syntax, CancellationToken cancellationToken) 465public static IMethodSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, ConstructorDeclarationSyntax syntax, CancellationToken cancellationToken) 471public static IMethodSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, LocalFunctionStatementSyntax syntax, CancellationToken cancellationToken) 477public static IParameterSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, ParameterSyntax syntax, CancellationToken cancellationToken) 483public static IPropertySymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, PropertyDeclarationSyntax syntax, CancellationToken cancellationToken) 489public static IMethodSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, BaseMethodDeclarationSyntax syntax, CancellationToken cancellationToken) 495public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, VariableDeclaratorSyntax syntax, CancellationToken cancellationToken) 501public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SingleVariableDesignationSyntax syntax, CancellationToken cancellationToken) 511public static bool UnifiesNativeIntegers(this SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
788SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
26public static bool IsTypeInferred(this TypeSyntax typeSyntax, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\VariableDeclaratorExtensions.cs (1)
23public static bool IsTypeInferred(this VariableDeclaratorSyntax variable, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
24SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (33)
41public bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 44public bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 47public bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 50public bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 53public bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 56public bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken) 59public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 118SemanticModel oldSemanticModel, 121[NotNullWhen(true)] out SemanticModel? speculativeModel) 125var model = oldSemanticModel; 135public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken) 137var original = model.GetOriginalSemanticModel(); 176public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode node) 190public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 193public IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 204public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 216public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 252public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 262public IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 265public IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 269public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 272public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 277public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 290static ImmutableArray<ISymbol> GetCallingConventionSymbols(SemanticModel model, FunctionPointerUnmanagedCallingConventionSyntax syntax) 299/// cref="ModelExtensions.GetSymbolInfo(SemanticModel, SyntaxNode, CancellationToken)"/>, but sometimes employs 303private ImmutableArray<ISymbol> GetSymbolInfo(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 390public bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 398var semanticModel = compilation.GetSemanticModel(syntaxReference.SyntaxTree); 414public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken) 417public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 420public IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node) 429private static IPreprocessingSymbol? CreatePreprocessingSymbol(SemanticModel model, SyntaxToken identifier) 496var semanticModel = await generatedDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
501public bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (39)
46public static bool IsUnnecessaryCast(ExpressionSyntax cast, SemanticModel semanticModel, CancellationToken cancellationToken) 54public static bool IsUnnecessaryAsCast(BinaryExpressionSyntax cast, SemanticModel semanticModel, CancellationToken cancellationToken) 61public static bool IsUnnecessaryCast(CastExpressionSyntax cast, SemanticModel semanticModel, CancellationToken cancellationToken) 122SemanticModel semanticModel, 154SemanticModel semanticModel, 179SemanticModel originalSemanticModel, CancellationToken cancellationToken) 250SemanticModel originalSemanticModel, IDelegateCreationOperation originalDelegateCreationOperation, 290SemanticModel originalSemanticModel, IConversionOperation originalConversionOperation, 618SemanticModel originalSemanticModel, 682ExpressionSyntax castNode, ExpressionSyntax castedExpressionNode, SemanticModel semanticModel, CancellationToken cancellationToken) 769ExpressionSyntax rewrittenExpression, SemanticModel rewrittenSemanticModel, 836ExpressionSyntax castNode, SemanticModel originalSemanticModel, 837ExpressionSyntax rewrittenExpression, SemanticModel rewrittenSemanticModel, CancellationToken cancellationToken) 861ExpressionSyntax castNode, SemanticModel originalSemanticModel, 862ExpressionSyntax rewrittenExpression, SemanticModel rewrittenSemanticModel, CancellationToken cancellationToken) 891SemanticModel originalSemanticModel, 893SemanticModel rewrittenSemanticModel, 1041SemanticModel semanticModel, 1117SemanticModel semanticModel, 1176SemanticModel semanticModel, CancellationToken cancellationToken) 1243private static bool IsFieldOrArrayElement(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 1250ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken) 1264SemanticModel originalSemanticModel, SemanticModel rewrittenSemanticModel, 1317SemanticModel originalSemanticModel, SemanticModel rewrittenSemanticModel, 1350SemanticModel originalSemanticModel, SemanticModel rewrittenSemanticModel) 1381SemanticModel originalSemanticModel, 1382SemanticModel rewrittenSemanticModel, 1490SemanticModel originalSemanticModel, 1491SemanticModel rewrittenSemanticModel, 1530SemanticModel semanticModel, 1568MemberAccessExpressionSyntax memberAccessExpression, SemanticModel semanticModel, 1624SemanticModel originalSemanticModel, SemanticModel rewrittenSemanticModel, 1646private static (SemanticModel? rewrittenSemanticModel, ExpressionSyntax? rewrittenExpression) GetSemanticModelWithCastRemoved( 1649SemanticModel originalSemanticModel, 1655var rewrittenSemanticModel = analyzer.SpeculativeSemanticModel;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (17)
58SemanticModel semanticModel, 104protected override void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate) 113protected override SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel) 116public static SemanticModel CreateSpeculativeSemanticModelForNode(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel) 123public static SemanticModel CreateSpeculativeSemanticModelForNode(SyntaxNode nodeToSpeculate, SemanticModel semanticModel, int position, bool isInNamespaceOrTypeContext) 134SemanticModel speculativeModel; 654protected override bool IsForEachTypeInferred(CommonForEachStatementSyntax forEachStatement, SemanticModel semanticModel) 813protected override bool ConversionsAreCompatible(SemanticModel originalModel, ExpressionSyntax originalExpression, SemanticModel newModel, ExpressionSyntax newExpression) 877protected override bool ForEachConversionsAreCompatible(SemanticModel originalModel, CommonForEachStatementSyntax originalForEach, SemanticModel newModel, CommonForEachStatementSyntax newForEach) 886SemanticModel model, 934protected override Conversion ClassifyConversion(SemanticModel model, ExpressionSyntax expression, ITypeSymbol targetType) 937protected override Conversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (6)
35TypeSyntax typeName, SemanticModel semanticModel, 54TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 57SyntaxToken identifier, TypeSyntax typeName, ExpressionSyntax initializer, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 59internal TypeSyntax? FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 92protected virtual bool ShouldAnalyzeForEachStatement(ForEachStatementSyntax forEachStatement, SemanticModel semanticModel, CancellationToken cancellationToken) 95protected virtual bool ShouldAnalyzeDeclarationExpression(DeclarationExpressionSyntax declaration, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (4)
36SyntaxNode declaration, SemanticModel semanticModel, 80private static bool IsTypeApparentInDeclaration(VariableDeclarationSyntax variableDeclaration, SemanticModel semanticModel, UseVarPreference stylePreferences, CancellationToken cancellationToken) 107private static bool IsPredefinedTypeInDeclaration(SyntaxNode declarationStatement, SemanticModel semanticModel) 146private static bool IsInferredPredefinedType(SyntaxNode declarationStatement, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (5)
47protected override bool ShouldAnalyzeForEachStatement(ForEachStatementSyntax forEachStatement, SemanticModel semanticModel, CancellationToken cancellationToken) 60TypeSyntax typeName, SemanticModel semanticModel, 114protected override bool ShouldAnalyzeDeclarationExpression(DeclarationExpressionSyntax declaration, SemanticModel semanticModel, CancellationToken cancellationToken) 137SemanticModel semanticModel, 149private static bool ContainsAnonymousType(TypeSyntax typeName, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (8)
30TypeSyntax typeName, SemanticModel semanticModel, 58protected override bool ShouldAnalyzeForEachStatement(ForEachStatementSyntax forEachStatement, SemanticModel semanticModel, CancellationToken cancellationToken) 69protected override bool ShouldAnalyzeDeclarationExpression(DeclarationExpressionSyntax declaration, SemanticModel semanticModel, CancellationToken cancellationToken) 92TypeSyntax typeName, SemanticModel semanticModel, 152SemanticModel semanticModel, 182var newSemanticModel = semanticModel.Compilation.ReplaceSyntaxTree(tree, newTree).GetSemanticModel(newTree); 191private static bool IsSafeToSwitchToVarWithoutNeedingSpeculation(DeclarationExpressionSyntax declarationExpression, SemanticModel semanticModel, CancellationToken cancellationToken) 243SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (5)
28protected override INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model) 42SemanticModel model, 52private static INamespaceSymbol? GetExplicitNamespaceSymbol(ExpressionSyntax fullName, ExpressionSyntax namespacePart, SemanticModel model) 79private readonly SemanticModel _model; 100SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (3)
51SemanticModel semanticModel, 180public static CSharpSyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 184Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContextService.cs (1)
18public SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
685public static bool IsNumericTypeContext(this SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (9)
618SemanticModel? semanticModel = null) 719this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, SemanticModel? semanticModel = null) 964SemanticModel? semanticModelOpt = null) 1714SemanticModel? semanticModelOpt = null) 2000public static bool IsInstanceContext(this SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken) 2169SemanticModel? semanticModel = null) 2742public static bool IsNameOfContext(this SyntaxTree syntaxTree, int position, SemanticModel? semanticModelOpt = null, CancellationToken cancellationToken = default) 2810SemanticModel semanticModel, 3016public static bool IsEnumTypeMemberAccessContext(this SyntaxTree syntaxTree, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
101SemanticModel semanticModel, 130var speculativeSemanticModel = specAnalyzer.SpeculativeSemanticModel; 164SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\InternalExtensions.cs (2)
15SemanticModel semanticModel, 21public static ITypeSymbol DetermineParameterType(ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
110public static async Task<ISymbol?> FindApplicableAliasAsync(this ITypeSymbol type, int position, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (7)
22public static INamespaceSymbol GetDeclaredSymbol(this SemanticModel semanticModel, BaseNamespaceDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default) 36this SemanticModel semanticModel, 45this SemanticModel semanticModel, 54this SemanticModel semanticModel, 77this SemanticModel semanticModel, 99this SemanticModel semanticModel, ArgumentSyntax argument, CancellationToken cancellationToken) 112this SemanticModel semanticModel, AttributeArgumentSyntax argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
70public static IEnumerable<BaseTypeSyntax> GetAllBaseListTypes(this TypeDeclarationSyntax typeNode, SemanticModel model, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
16public static bool IsPotentialTypeName([NotNullWhen(true)] this TypeSyntax? typeSyntax, SemanticModel? semanticModelOpt, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
61var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
41var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (13)
36protected override IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, CancellationToken cancellationToken) 67public bool IsExpressionContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 75public bool IsStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 81public bool IsTypeContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 84public bool IsNamespaceContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 87public bool IsNamespaceDeclarationNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 90public bool IsTypeDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 96public bool IsMemberDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 102public bool IsGlobalStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 105public bool IsLabelContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 108public bool IsAttributeNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 111public CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination) 116public IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.cs (1)
21protected override AbstractTypeInferrer CreateTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
30SemanticModel semanticModel, 2053var currentSemanticModel = SemanticModel; 2054var originalSemanticModel = currentSemanticModel.GetOriginalSemanticModel();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\SemanticModelReuse\CSharpSemanticModelReuseLanguageService.cs (3)
54protected override SemanticModel? TryGetSpeculativeSemanticModelWorker(SemanticModel previousSemanticModel, SyntaxNode previousBodyNode, SyntaxNode currentBodyNode) 59previousSemanticModel.TryGetSpeculativeSemanticModelForMethodBody(previousBaseMethod.Body.SpanStart, currentBaseMethod, out var speculativeModel))
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
CodeGeneration\AddImportsTests.cs (1)
45var model = await doc.GetSemanticModelAsync();
CodeGeneration\SyntaxGeneratorTests.cs (2)
5681var semanticModel = compilation.GetSemanticModel(tree); 5714var semanticModel = compilation.GetSemanticModel(compilation.SyntaxTrees.Single());
Microsoft.CodeAnalysis.EditorFeatures (7)
Navigation\AbstractDefinitionLocationService.cs (4)
55var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false); 61Document document, SemanticModel semanticModel) 74Document document, SemanticModel semanticModel) 287var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Peek\PeekableItemSource.cs (1)
93var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
212var semanticModel = await documentWithOriginalName.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (1)
187var semanticModel = await document.ReuseExistingSpeculativeModelAsync(token.Parent, _cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (7)
ChangeSignature\AddedParameterOrExistingIndex.cs (1)
64var semanticModel = document.GetRequiredSemanticModelAsync(CancellationToken.None).AsTask().Result;
Completion\AbstractArgumentProviderTests`1.cs (2)
65var semanticModel = await document.GetRequiredSemanticModelAsync(CancellationToken.None); 75private IParameterSymbol GetParameterSymbolInfo(Workspace workspace, SemanticModel semanticModel, SyntaxNode root, int position, CancellationToken cancellationToken)
Semantics\SpeculationAnalyzerTestsBase.cs (2)
42var initialModel = initialCompilation.GetSemanticModel(initialTree); 67protected abstract bool ReplacementChangesSemantics(SyntaxNode initialNode, SyntaxNode replacementNode, SemanticModel initialModel);
TypeInferrer\TypeInferrerTestBase.cs (2)
40/// Specifies the test is going to call into <see cref="ITypeInferenceService.InferTypes(SemanticModel, SyntaxNode, string, System.Threading.CancellationToken)"/>. 45/// Specifies the test is going to call into <see cref="ITypeInferenceService.InferTypes(SemanticModel, int, string, System.Threading.CancellationToken)"/>.
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (41)
CodeGeneration\CodeGenerationTests.cs (35)
58Func<SemanticModel, ITypeSymbol> type = null, 104ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default, 138Func<SemanticModel, ImmutableArray<IMethodSymbol>> getExplicitInterfaces = null, 140ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default, 183ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default, 226ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default, 268Func<SemanticModel, IParameterSymbol> fromType, 324ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters, 345ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default, 376ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default, 378Func<SemanticModel, ImmutableArray<IEventSymbol>> getExplicitInterfaceImplementations = null, 420ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters = default, 513ImmutableArray<Func<SemanticModel, ISymbol>> members = default, 587Func<SemanticModel, ITypeSymbol> getType = null, 588ImmutableArray<Func<SemanticModel, ISymbol>> getNewMembers = default, 649var semanticModel = await testContext.Solution 672internal static Func<SemanticModel, IParameterSymbol> Parameter(Type type, string name, bool hasDefaultValue = false, object defaultValue = null, bool isParams = false) 679internal static Func<SemanticModel, IParameterSymbol> Parameter(string typeFullName, string parameterName, bool hasDefaultValue = false, object defaultValue = null, bool isParams = false, int typeArrayRank = 0) 695internal static ImmutableArray<Func<SemanticModel, IParameterSymbol>> Parameters(params ReadOnlySpan<Func<SemanticModel, IParameterSymbol>> p) 698internal static ImmutableArray<Func<SemanticModel, ISymbol>> Members(params ReadOnlySpan<Func<SemanticModel, ISymbol>> m) 701internal static Func<SemanticModel, ITypeSymbol> CreateArrayType(Type type, int rank = 1) 704private static ImmutableArray<IParameterSymbol> GetParameterSymbols(ImmutableArray<Func<SemanticModel, IParameterSymbol>> parameters, TestContext context) 710Func<SemanticModel, ImmutableArray<IMethodSymbol>> explicitInterface, TestContext context) 715private static ImmutableArray<ISymbol> GetSymbols(ImmutableArray<Func<SemanticModel, ISymbol>> members, TestContext context) 722private static Func<SemanticModel, ISymbol> CreateEnumField(string name, object value) 729internal static Func<SemanticModel, ISymbol> CreateField(Accessibility accessibility, Editing.DeclarationModifiers modifiers, Type type, string name) 736private static Func<SemanticModel, INamedTypeSymbol> GetTypeSymbol(Type type) 739private static Func<SemanticModel, INamedTypeSymbol> GetTypeSymbol(string typeMetadataName) 860public SemanticModel SemanticModel; 875SemanticModel semanticModel) 893var semanticModel = await workspace.CurrentSolution.Projects.Single().Documents.Single().GetSemanticModelAsync(); 912public IEnumerable<ISymbol> GetAnnotatedDeclaredSymbols(string key, SemanticModel semanticModel) 921public static T GetSelectedSymbol<T>(TextSpan selection, SemanticModel semanticModel)
CodeGeneration\CodeGenerationTests.VisualBasic.cs (1)
349static ImmutableArray<IEventSymbol> GetExplicitInterfaceEvent(SemanticModel semanticModel)
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
318var semanticModel = await document.GetRequiredSemanticModelAsync(CancellationToken.None);
StackTraceExplorer\StackTraceExplorerTests.cs (1)
49var semanticModel = await doc.GetRequiredSemanticModelAsync(CancellationToken.None);
SymbolFinder\SymbolFinderTests.cs (1)
650var semanticModel = await csDoc.GetSemanticModelAsync();
SymbolKey\SymbolKeyCrossLanguageTests.cs (1)
44var semanticModel = await csDocument.GetRequiredSemanticModelAsync(CancellationToken.None);
Utilities\SymbolEquivalenceComparerTests.cs (1)
2004var model = compilation.GetSemanticModel(invocation.SyntaxTree);
Microsoft.CodeAnalysis.Extensions.Package (1)
Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (6)
EmbeddedLanguages\AspNetCoreCSharpRouteSyntaxDetector.cs (1)
36SemanticModel semanticModel,
EmbeddedLanguages\BraceMatching\IAspNetCoreEmbeddedLanguageBraceMatcher.cs (1)
13AspNetCoreBraceMatchingResult? FindBraces(SemanticModel semanticModel, SyntaxToken token, int position, CancellationToken cancellationToken);
EmbeddedLanguages\Classification\AspNetCoreEmbeddedLanguageClassificationContext.cs (1)
25public SemanticModel SemanticModel => _context.SemanticModel;
EmbeddedLanguages\DocumentHighlighting\IEmbeddedLanguageDocumentHighlighter.cs (1)
18SemanticModel semanticModel,
Internal\EmbeddedLanguages\AspNetCoreEmbeddedLanguageBraceMatcher.cs (1)
29SemanticModel semanticModel,
Internal\EmbeddedLanguages\AspNetCoreEmbeddedLanguageDocumentHighlighter.cs (1)
31SemanticModel semanticModel,
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (1)
RazorClassifierAccessor.cs (1)
18var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.ExternalAccess.Xaml (1)
Internal\DescriptionService.cs (1)
60var semanticModel = await codeDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Features (656)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (3)
44var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 82var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 116var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
AddImport\AbstractAddImportFeatureService.cs (10)
52protected abstract ISet<INamespaceSymbol> GetImportNamespacesInScope(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 53protected abstract ITypeSymbol GetDeconstructInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 54protected abstract ITypeSymbol GetQueryClauseInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 60SyntaxNode node, SemanticModel semanticModel, [NotNullWhen(true)] out SyntaxNode? objectCreationExpression); 63protected abstract (string description, bool hasExistingImport) GetDescription(Document document, AddImportPlacementOptions options, INamespaceOrTypeSymbol symbol, SemanticModel semanticModel, SyntaxNode root, CancellationToken cancellationToken); 107var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 135SemanticModel semanticModel, 547var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 606private static ITypeSymbol? GetAwaitInfo(SemanticModel semanticModel, ISyntaxFacts syntaxFactsService, SyntaxNode node) 618private static ITypeSymbol? GetCollectionExpressionType(SemanticModel semanticModel, ISyntaxFacts syntaxFactsService, SyntaxNode node)
AddImport\References\MetadataSymbolReference.cs (1)
38SemanticModel semanticModel, CancellationToken cancellationToken)
AddImport\References\ProjectSymbolReference.cs (1)
84SemanticModel semanticModel, CancellationToken cancellationToken)
AddImport\References\SymbolReference.cs (2)
78var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 125SemanticModel semanticModel, CancellationToken cancellationToken)
AddImport\SymbolReferenceFinder.cs (2)
32private readonly SemanticModel _semanticModel; 52SemanticModel semanticModel,
BraceMatching\AbstractEmbeddedLanguageBraceMatcher.cs (1)
40var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
BraceMatching\IEmbeddedLanguageBraceMatcher.cs (1)
14SemanticModel semanticModel,
ChangeSignature\AbstractChangeSignatureService.cs (3)
926var semanticModel = document.SemanticModel; 1043protected static bool IsParamsArrayExpandedHelper(ISymbol symbol, int argumentCount, bool lastArgumentIsNamed, SemanticModel semanticModel, SyntaxNode lastArgumentExpression, CancellationToken cancellationToken) 1071protected static int GetParameterIndexFromInvocationArgument(SyntaxNode argument, Document document, SemanticModel semanticModel, CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (1)
284var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (1)
203var model = await _document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
CodeLens\CodeLensReferencesService.cs (5)
54var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 112var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 345private static ISymbol GetEnclosingMethod(SemanticModel semanticModel, Location location, CancellationToken cancellationToken) 381var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 408var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
CodeLens\ICodeLensDisplayInfoService.cs (1)
19string GetDisplayName(SemanticModel semanticModel, SyntaxNode node);
CodeRefactorings\AddAwait\AbstractAddAwaitCodeRefactoringProvider.cs (2)
42var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 71SemanticModel model, ISyntaxFactsService syntaxFacts, SyntaxNode node, CancellationToken cancellationToken)
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (3)
142var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 328var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 372var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Completion\ArgumentContext.cs (2)
15SemanticModel semanticModel, 26public SemanticModel SemanticModel { get; } = semanticModel ?? throw new ArgumentNullException(nameof(semanticModel));
Completion\CommonCompletionUtilities.cs (3)
86SolutionServices workspaceServices, SemanticModel semanticModel, int position, ISymbol symbol, int overloadCount, SymbolDescriptionOptions options, SupportedPlatformData? supportedPlatforms, CancellationToken cancellationToken) 151SolutionServices workspaceServices, SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SupportedPlatformData? supportedPlatforms, CancellationToken cancellationToken) 174List<TaggedText> textContentBuilder, ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter, CancellationToken cancellationToken)
Completion\CompletionService.cs (2)
217var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 248var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionService_GetCompletions.cs (1)
71var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractAwaitCompletionProvider.cs (4)
60protected abstract TextChange? GetReturnTypeChange(SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken); 64protected abstract ITypeSymbol? GetTypeSymbolOfExpression(SemanticModel semanticModel, SyntaxNode potentialAwaitableExpression, CancellationToken cancellationToken); 194var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 263var semanticModel = syntaxContext.SemanticModel;
Completion\Providers\AbstractContextVariableArgumentProvider.cs (1)
20protected abstract bool IsInstanceContext(SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken);
Completion\Providers\AbstractCrefCompletionProvider.cs (1)
45protected abstract Task<(SyntaxToken, SemanticModel?, ImmutableArray<ISymbol>)> GetSymbolsAsync(
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (2)
121var semanticModel = await document.ReuseExistingSpeculativeModelAsync(attributeNode, cancellationToken).ConfigureAwait(false); 235var semanticModel = await document.ReuseExistingSpeculativeModelAsync(constructorArgument, cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
127var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (2)
18protected abstract (ITypeSymbol type, Location location, bool isObjectInitializer)? GetInitializedType(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken); 28var semanticModel = await document.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
63SemanticModel semanticModel,
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (3)
56var semanticModel = await Document.ReuseExistingSpeculativeModelAsync(startToken.Parent, CancellationToken).ConfigureAwait(false); 70ISymbol symbol, SemanticModel semanticModel, 89SemanticModel semanticModel,
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (4)
33protected abstract string GetDisplayText(IMethodSymbol method, SemanticModel semanticModel, int position); 62var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 81var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 102private CompletionItem CreateItem(IMethodSymbol method, int line, TextSpan span, SemanticModel semanticModel, DeclarationModifiers modifiers, SyntaxToken token)
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (2)
40var semanticModel = await document.ReuseExistingSpeculativeModelAsync(node, cancellationToken).ConfigureAwait(false); 88var semanticModel = context.SemanticModel;
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (1)
93SemanticModel semanticModel,
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
66var semanticModel = syntaxContext.SemanticModel;
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (1)
95SemanticModel? semanticModel,
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (2)
32private readonly SemanticModel _originatingSemanticModel; 44SemanticModel semanticModel,
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
144var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\SymbolCompletionItem.cs (2)
208var semanticModel = await contextDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 395CompletionItem item, ImmutableArray<ISymbol> symbols, Document document, SemanticModel semanticModel, SymbolDescriptionOptions options, CancellationToken cancellationToken)
Completion\Utilities.cs (1)
55var semanticModel = await document.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false);
ConvertAnonymousType\AbstractConvertAnonymousTypeCodeRefactoringProvider.cs (1)
29var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (5)
88var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 154var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 194var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 248var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 377SemanticModel semanticModel, string className,
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (3)
44var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 77SemanticModel semanticModel, 112var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
43var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
48var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (8)
45SemanticModel model, ForEachInfo info, SyntaxEditor editor, CancellationToken cancellationToken); 68var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 86ISemanticFactsService semanticFacts, SemanticModel model, SyntaxNode location, string baseName, CancellationToken cancellationToken) 90SemanticModel model, SyntaxGenerator generator, 150ISemanticFactsService semanticFact, SemanticModel model, 193SemanticModel model, ILocalSymbol foreachVariable, IOperation foreachCollection, 393private bool CheckIfForEachVariableIsWrittenInside(SemanticModel semanticModel, ISymbol foreachVariable, TForEachStatement foreachStatement) 418var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (2)
75var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 323var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
51public abstract bool CanImplicitlyConvert(SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol targetType);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (3)
43var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 73SemanticModel semanticModel, 247var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ConvertLinq\AbstractConvertLinqQueryToForEachProvider.cs (2)
24SemanticModel semanticModel, 42var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (5)
31TForEachStatement forEachStatement, SemanticModel semanticModel, bool convertLocalDeclarations); 38SemanticModel semanticModel, 63IConverter<TForEachStatement, TStatement> converter, SemanticModel semanticModel, SyntaxNode root); 86var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 163SemanticModel semanticModel,
ConvertLinq\ConvertForEachToLinqQuery\ForEachInfo.cs (2)
11SemanticModel semanticModel, 20public SemanticModel SemanticModel { get; } = semanticModel;
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (1)
47var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (4)
39var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 133var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 269SemanticModel semanticModel, 286SemanticModel semanticModel, CancellationToken cancellationToken)
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (5)
54SemanticModel semanticModel, 130var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 277var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 315var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 328SemanticModel semanticModel,
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (9)
206var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 273var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 366var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 525var semanticModel = await startingDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 641var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 754var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 802var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 854SemanticModel model, SyntaxGenerator generator, 922SemanticModel semanticModel, bool isRecord, string className,
Copilot\ICopilotChangeAnalysisService.cs (1)
99var semanticModel = await newDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Debugging\AbstractDataTipInfoGetter.cs (1)
29var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false);
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
304var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Diagnostics\AbstractAnalyzerDriverService.cs (2)
15SemanticModel model, TextSpan span, CancellationToken cancellationToken) 22protected abstract void ComputeDeclarationsInSpan(SemanticModel model, TextSpan span, ArrayBuilder<DeclarationInfo> infos, CancellationToken cancellationToken);
Diagnostics\IAnalyzerDriverService.cs (1)
19ImmutableArray<DeclarationInfo> ComputeDeclarationsInSpan(SemanticModel model, TextSpan span, CancellationToken cancellationToken);
Diagnostics\Service\DiagnosticAnalyzerService_CoreAnalyze.cs (2)
125var model = await ((Document)documentAnalysisScope.TextDocument).GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 198var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Diagnostics\Service\DocumentAnalysisExecutor.cs (1)
294var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (5)
82internal SemanticModel SemanticModel { get; set; } 289public ImmutableArray<TaggedText> Format(string rawXmlText, ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat format, CancellationToken cancellationToken) 458private static (string target, string hint)? GetNavigationTarget(XElement element, SemanticModel semanticModel, int position, SymbolDisplayFormat format) 507string crefValue, int position, SemanticModel semanticModel, SymbolDisplayFormat format = null, SymbolDisplayPartKind kind = SymbolDisplayPartKind.Text) 530string crefValue, ISymbol typeResolutionSymbol, int position, SemanticModel semanticModel, SymbolDisplayFormat format)
DocumentationComments\IDocumentationCommentFormattingService.cs (1)
14ImmutableArray<TaggedText> Format(string? rawXmlText, ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat format, CancellationToken cancellationToken);
DocumentHighlighting\AbstractDocumentHighlightsService.cs (2)
68var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false); 95Document document, SemanticModel semanticModel, int position, HighlightingOptions options, CancellationToken cancellationToken)
DocumentHighlighting\IEmbeddedLanguageDocumentHighlighter.cs (1)
17SemanticModel semanticModel,
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (8)
445internal abstract IMethodSymbol GetLambdaExpressionSymbol(SemanticModel model, SyntaxNode lambdaExpression, CancellationToken cancellationToken); 447internal abstract bool QueryClauseLambdasTypeEquivalent(SemanticModel oldModel, SyntaxNode oldNode, SemanticModel newModel, SyntaxNode newNode, CancellationToken cancellationToken); 2071SemanticModel oldModel, 2073SemanticModel newModel, 6362SemanticModel model, 6420protected abstract ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode declaration, CancellationToken cancellationToken); 6422protected ISymbol GetRequiredDeclaredSymbol(SemanticModel model, SyntaxNode declaration, CancellationToken cancellationToken)
EditAndContinue\AbstractSimpleMemberBody.cs (1)
37public override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model)
EditAndContinue\DeclarationBody.cs (1)
64public abstract ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model);
EditAndContinue\DocumentSemanticModel.cs (4)
12/// <see cref="SemanticModel"/> for the document, or null if the document has been deleted. 15public readonly SemanticModel? Model; 20public DocumentSemanticModel(SemanticModel model) 38public SemanticModel RequiredModel
EmbeddedLanguages\AbstractEmbeddedLanguageFeatureService.cs (1)
109SemanticModel semanticModel,
EmbeddedLanguages\AbstractLanguageDetector.cs (7)
30protected abstract bool IsArgumentToWellKnownAPI(SyntaxToken token, SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken, out TOptions options); 37protected abstract bool TryGetOptions(SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out TOptions options); 40protected virtual bool IsEmbeddedLanguageInterpolatedStringTextToken(SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken) 52SemanticModel semanticModel, 97private bool IsEmbeddedLanguageStringLiteralToken(SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken, out TOptions options) 109SemanticModel semanticModel, 223public TTree? TryParseString(SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken)
EmbeddedLanguages\Classification\AbstractEmbeddedLanguageClassificationService.cs (4)
42SemanticModel semanticModel; 52SolutionServices services, Project? project, SemanticModel semanticModel, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 69SemanticModel semanticModel, 78private readonly SemanticModel _semanticModel = semanticModel;
EmbeddedLanguages\Classification\EmbeddedLanguageClassifierContext.cs (2)
34public SemanticModel SemanticModel { get; } 44SemanticModel semanticModel,
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeEmbeddedLanguage.cs (1)
34var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (3)
40protected override bool TryGetOptions(SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out DateAndTimeOptions options) 54protected override bool IsEmbeddedLanguageInterpolatedStringTextToken(SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken) 70SemanticModel semanticModel,
EmbeddedLanguages\EmbeddedLanguageDetector.cs (12)
33SemanticModel semanticModel, 47SemanticModel semanticModel, 60SemanticModel semanticModel, 155SemanticModel semanticModel, 207SemanticModel semanticModel, 278SemanticModel semanticModel, 334SemanticModel semanticModel, 361SemanticModel semanticModel, 385SemanticModel semanticModel, 439SemanticModel semanticModel, 455SemanticModel semanticModel, 469SemanticModel semanticModel,
EmbeddedLanguages\Json\LanguageServices\JsonBraceMatcher.cs (1)
37SemanticModel semanticModel,
EmbeddedLanguages\Json\LanguageServices\JsonClassifier.cs (1)
49var semanticModel = context.SemanticModel;
EmbeddedLanguages\Json\LanguageServices\JsonLanguageDetector.cs (5)
62/// <inheritdoc cref="TryParseString(SyntaxToken, SemanticModel, bool, CancellationToken)"/> 69public JsonTree? TryParseString(SyntaxToken token, SemanticModel semanticModel, bool includeProbableStrings, CancellationToken cancellationToken) 128SemanticModel semanticModel, 160SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out JsonOptions options) 205SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken)
EmbeddedLanguages\RegularExpressions\LanguageServices\AbstractRegexDiagnosticAnalyzer.cs (1)
42var semanticModel = context.SemanticModel;
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexBraceMatcher.cs (1)
40SemanticModel semanticModel,
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexClassifier.cs (1)
51var semanticModel = context.SemanticModel;
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexDocumentHighlighter.cs (1)
35Document document, SemanticModel semanticModel, SyntaxToken token, int position, HighlightingOptions options, CancellationToken cancellationToken)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedLanguage.cs (1)
39var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (4)
76SemanticModel semanticModel, 146SemanticModel semanticModel, 168SemanticModel semanticModel, 185SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out RegexOptions options)
EncapsulateField\AbstractEncapsulateFieldService.cs (2)
150var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 185var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ExternalAccess\Pythia\Api\PythiaDocumentationCommentFormatting.cs (1)
13public static IEnumerable<TaggedText> GetDocumentationParts(ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter, CancellationToken cancellationToken)
ExternalAccess\Pythia\Api\PythiaSymbolSorting.cs (1)
16SemanticModel semanticModel,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (1)
105if (!document.TryGetSemanticModel(out var model) ||
ExtractClass\AbstractExtractClassRefactoringProvider.cs (2)
61var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 121var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ExtractClass\ExtractClassWithDialogCodeAction.cs (2)
164var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 216var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ExtractInterface\AbstractExtractInterfaceService.cs (1)
91var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ExtractMethod\Extensions.cs (2)
12public static ITypeSymbol? GetLambdaOrAnonymousMethodReturnType(this SemanticModel binding, SyntaxNode node) 38public static T ResolveType<T>(this SemanticModel semanticModel, T symbol) where T : class, ITypeSymbol
ExtractMethod\MethodExtractor.Analyzer.cs (3)
34protected SemanticModel SemanticModel => SemanticDocument.SemanticModel; 71var model = this.SemanticModel; 287var semanticModel = this.SemanticModel;
ExtractMethod\MethodExtractor.cs (2)
207var semanticModel = OriginalSelectionResult.SemanticDocument.SemanticModel; 223SemanticModel semanticModel, ITypeSymbol type)
ExtractMethod\SelectionResult.cs (1)
198var semanticModel = this.SemanticDocument.SemanticModel;
ExtractMethod\UniqueNameGenerator.cs (2)
11private readonly SemanticModel _semanticModel; 13public UniqueNameGenerator(SemanticModel semanticModel)
FindUsages\AbstractFindUsagesService_FindReferences.cs (1)
203var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
FullyQualify\AbstractFullyQualifyService.cs (6)
86var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 120SemanticModel semanticModel, 152SemanticModel semanticModel, 183SemanticModel semanticModel, 228SemanticModel semanticModel, int arity, bool inAttributeContext, 287private static bool HasAccessibleTypes(INamespaceSymbol @namespace, SemanticModel model, CancellationToken cancellationToken)
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (2)
58var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 137var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.ConstructorDelegatingCodeAction.cs (1)
43var semanticModel = await _document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (1)
208var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.FieldDelegatingCodeAction.cs (1)
46var semanticModel = await _document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (1)
54var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (1)
101var semanticModel = await _document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (4)
86var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 135SemanticModel semanticModel, INamedTypeSymbol containingType, 261var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 304var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
GenerateFromMembers\GenerateFromMembersHelpers.cs (1)
33var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
GenerateOverrides\GenerateOverridesCodeRefactoringProvider.cs (1)
46var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
GenerateType\AbstractGenerateTypeService.cs (10)
40protected abstract ImmutableArray<ITypeParameterSymbol> GetTypeParameters(State state, SemanticModel semanticModel, CancellationToken cancellationToken); 41protected abstract Accessibility GetAccessibility(State state, SemanticModel semanticModel, bool intoNamespace, CancellationToken cancellationToken); 42protected abstract IList<ParameterName> GenerateParameterNames(SemanticModel semanticModel, IList<TArgumentSyntax> arguments, CancellationToken cancellationToken); 44protected abstract INamedTypeSymbol DetermineTypeToGenerateIn(SemanticModel semanticModel, TSimpleNameSyntax simpleName, CancellationToken cancellationToken); 45protected abstract ITypeSymbol DetermineArgumentType(SemanticModel semanticModel, TArgumentSyntax argument, CancellationToken cancellationToken); 50protected abstract bool IsInValueTypeConstraintContext(SemanticModel semanticModel, TExpressionSyntax expression, CancellationToken cancellationToken); 182SemanticModel semanticModel, 234SemanticModel semanticModel, 260SemanticModel semanticModel, 274var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
279var newSemanticModel = await newDocument.GetSemanticModelAsync(_cancellationToken).ConfigureAwait(false);
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (1)
331internal abstract bool TryGenerateProperty(TSimpleNameSyntax propertyName, SemanticModel semanticModel, ITypeInferenceService typeInference, CancellationToken cancellationToken, out IPropertySymbol property);
GenerateType\AbstractGenerateTypeService.State.cs (4)
120var semanticModel = semanticDocument.SemanticModel; 261private bool GenerateStruct(TService service, SemanticModel semanticModel, CancellationToken cancellationToken) 336SemanticModel semanticModel, 375SemanticModel semanticModel,
GoToDefinition\AbstractGoToDefinitionSymbolService.cs (3)
20protected abstract int? GetTargetPositionIfControlFlow(SemanticModel semanticModel, SyntaxToken token); 23Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 65Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
GoToDefinition\IGoToDefinitionSymbolService.cs (2)
15Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken); 22Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (2)
86var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 179var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (13)
79var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 108var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 194var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 223private static (TParameterSyntax?, IParameterSymbol?) GetParameterAtOrdinal(int index, IReadOnlyList<TParameterSyntax> parameterNodes, SemanticModel semanticModel, CancellationToken cancellationToken) 236ISyntaxFactsService syntaxFacts, SemanticModel semanticModel, 338private bool ParameterValidForNullCheck(Document document, IParameterSymbol parameter, SemanticModel semanticModel, 602Func<SemanticModel, SyntaxGenerator, TStatementSyntax> generateCheck, 605var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 639var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 691private TStatementSyntax CreateNullCheckStatement(SemanticModel semanticModel, SyntaxGenerator generator, IParameterSymbol parameter, TSimplifierOptions options) 792SemanticModel semanticModel, 838SemanticModel semanticModel, 910var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
385var currentSemanticModel = await currentDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (4)
72var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 130SemanticModel semanticModel, 141SyntaxNode functionDeclaration, SemanticModel semanticModel, ISyntaxFactsService syntaxFacts, 181SemanticModel semanticModel,
InlineHints\AbstractInlineParameterNameHintsService.cs (2)
26SemanticModel semanticModel, 59var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
InlineHints\AbstractInlineTypeHintsService.cs (3)
23SemanticModel semanticModel, SyntaxNode node, 52var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 108SemanticModel semanticModel,
InlineHints\InlineHintHelpers.cs (1)
26var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (4)
93var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 374var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 424SemanticModel semanticModel, 570SemanticModel semanticModel,
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (5)
53var callerSemanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 55var calleeSemanticModel = await calleeDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 352SemanticModel callerSemanticModel, 353SemanticModel calleeSemanticModel, 389SemanticModel semanticModel,
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (2)
162var callerSemanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 485var semanticModel = await calleeDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
InlineTemporary\AbstractInlineTemporaryCodeRefactoringProvider.cs (1)
29var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (2)
67var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 205var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (10)
66var semanticModel = await _originalDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 91var semanticModel = await _originalDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 222var invocationSemanticModel = await currentDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 304SyntaxNode GenerateNewArgumentListSyntaxForTrampoline(Compilation compilation, SemanticModel invocationSemanticModel, 346var semanticModel = await _originalDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 486var invocationSemanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 581private bool ShouldArgumentBeNamed(Compilation compilation, SemanticModel semanticModel, 609SemanticModel invocationSemanticModel, CancellationToken cancellationToken) 672var originalSemanticModel = await _originalDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 679private bool NodeMatchesExpression(SemanticModel originalSemanticModel, TExpressionSyntax currentNode, CancellationToken cancellationToken)
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (6)
67var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 153var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 217var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false); 317SemanticModel semanticModel, 346SemanticModel semanticModel, 433SemanticModel semanticModel,
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (3)
42var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 85var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 129var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
IntroduceVariable\AbstractIntroduceVariableService.cs (8)
265var semanticModel = semanticDocument.SemanticModel; 283var semanticModel = semanticDocument.SemanticModel; 302var originalSemanticModel = originalDocument.SemanticModel; 303var currentSemanticModel = currentDocument.SemanticModel; 314SemanticModel originalSemanticModel, 315SemanticModel currentSemanticModel, 380var semanticModel = document.SemanticModel; 410var semanticModel = document.SemanticModel;
InvertConditional\AbstractInvertConditionalCodeRefactoringProvider.cs (1)
46var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (5)
159var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 215SemanticModel semanticModel, 403var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 425SemanticModel semanticModel, 449SemanticModel semanticModel,
InvertLogical\AbstractInvertLogicalCodeRefactoringProvider.cs (2)
102var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 117var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (4)
24protected abstract ImmutableArray<SymbolDisplayPart> GetNormalAnonymousTypeParts(INamedTypeSymbol anonymousType, SemanticModel semanticModel, int position); 26public ImmutableArray<SymbolDisplayPart> GetAnonymousTypeParts(INamedTypeSymbol anonymousType, SemanticModel semanticModel, int position) 33SemanticModel semanticModel, 65SemanticModel semanticModel,
LanguageServices\AnonymousTypeDisplayService\IStructuralTypeDisplayService.cs (2)
15SemanticModel semanticModel, 20SemanticModel semanticModel,
LanguageServices\AnonymousTypeDisplayService\StructuralTypeDisplayInfo.cs (3)
23public IList<SymbolDisplayPart> ReplaceStructuralTypes(IList<SymbolDisplayPart> parts, SemanticModel semanticModel, int position) 29SemanticModel semanticModel, 42SemanticModel semanticModel,
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (6)
81private readonly SemanticModel _semanticModel; 92SemanticModel semanticModel, 112protected abstract ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat format); 120protected SemanticModel GetSemanticModel(SyntaxTree tree) 127var model = _semanticModel.GetOriginalSemanticModel(); 318var semanticModel = GetSemanticModel(syntax.SyntaxTree);
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.cs (3)
19protected abstract AbstractSymbolDescriptionBuilder CreateDescriptionBuilder(SemanticModel semanticModel, int position, SymbolDescriptionOptions options, CancellationToken cancellationToken); 21public Task<ImmutableArray<SymbolDisplayPart>> ToDescriptionPartsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups, CancellationToken cancellationToken) 31SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken)
LanguageServices\SymbolDisplayService\ISymbolDisplayService.cs (4)
15Task<ImmutableArray<SymbolDisplayPart>> ToDescriptionPartsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default); 16Task<IDictionary<SymbolDescriptionGroups, ImmutableArray<TaggedText>>> ToDescriptionGroupsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken = default); 23public Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ISymbol symbol, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default) 26public async Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (2)
101public string ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null) 104public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null)
MetadataAsSource\AbstractMetadataAsSourceService.cs (1)
28var newSemanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (2)
125public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 128public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)
MoveStaticMembers\AbstractMoveStaticMembersRefactoringProvider.cs (1)
36var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (5)
114var destSemanticModel = await newDoc.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 134var semanticModel = await sourceDoc.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 218var semanticModel = await sourceDoc.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 226var newTypeSemanticModel = await newTypeDoc.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 406var semanticModel = await sourceDoc.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
MoveToNamespace\AbstractMoveToNamespaceService.cs (1)
188var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
58var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (1)
109var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Navigation\AbstractNavigableItemsService.cs (1)
46var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Organizing\Organizers\AbstractSyntaxNodeOrganizer.cs (1)
16public SyntaxNode OrganizeNode(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
Organizing\Organizers\ISyntaxOrganizer.cs (1)
21SyntaxNode OrganizeNode(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken = default);
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (1)
42var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
PreferFrameworkType\PreferFrameworkTypeDiagnosticAnalyzerBase.cs (2)
42protected abstract bool IsIdentifierNameReplaceableWithFrameworkType(SemanticModel semanticModel, TIdentifierNameSyntax node); 50var semanticModel = context.SemanticModel;
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (1)
38var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
QuickInfo\AbstractEmbeddedLanguageQuickInfoProvider.cs (2)
34var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 70SemanticModel semanticModel,
QuickInfo\CommonQuickInfoContext.cs (2)
13SemanticModel semanticModel, 19public readonly SemanticModel SemanticModel = semanticModel;
QuickInfo\CommonSemanticQuickInfoProvider.cs (11)
33var semanticModel = await context.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 63var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 89var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 100var linkedModel = await linkedDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 142SemanticModel linkedModel, 158SemanticModel semanticModel, 191protected virtual string? GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) => null; 194SolutionServices services, SemanticModel semanticModel, ISymbol symbol, SyntaxToken token, CancellationToken cancellationToken) 309SolutionServices services, SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 342SolutionServices services, SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 370private ImmutableArray<ISymbol> GetSymbolsFromToken(SyntaxToken token, SolutionServices services, SemanticModel semanticModel, CancellationToken cancellationToken)
QuickInfo\IEmbeddedLanguageQuickInfoProvider.cs (1)
17SemanticModel semanticModel,
QuickInfo\QuickInfoUtilities.cs (2)
21public static Task<QuickInfoItem> CreateQuickInfoItemAsync(SolutionServices services, SemanticModel semanticModel, TextSpan span, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken) 26SemanticModel semanticModel,
RelatedDocuments\AbstractRelatedDocumentsService.cs (1)
74var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Rename\IRenameIssuesService.cs (1)
13SemanticModel semantic, ISymbol symbol, SyntaxToken triggerToken, [NotNullWhen(true)] out string? langError);
Rename\SymbolicRenameInfo.cs (1)
141var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (3)
200var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 225var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 264SemanticModel semanticModel,
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (3)
60var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 116CodeRefactoringContext context, SemanticModel semanticModel, SyntaxToken token, TextSpan replacementSpan, CancellationToken cancellationToken) 132private static ISymbol? GetEnclosingSymbol(SemanticModel semanticModel, int position, CancellationToken cancellationToken)
ReplaceMethodWithProperty\IReplaceMethodWithPropertyService.cs (1)
23SyntaxEditor editor, SemanticModel semanticModel,
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (3)
53var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 159var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 360var semanticModel = await updatedDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (3)
61var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 77private readonly SemanticModel _semanticModel; 93SemanticModel semanticModel,
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (3)
49var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 82var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 352var semanticModel = await updatedDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Shared\Extensions\ISymbolExtensions_2.cs (2)
183public static ImmutableArray<TaggedText> GetDocumentationParts(this ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter, CancellationToken cancellationToken) 233this ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter)
Shared\Extensions\ISymbolExtensions_Sorting.cs (3)
23SemanticModel semanticModel, 32SemanticModel semanticModel, 132SemanticModel semanticModel,
Shared\Utilities\ExtractTypeHelpers.cs (1)
65var newSemanticModel = await newDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
SignatureHelp\AbstractSignatureHelpProvider.cs (6)
135SemanticModel semanticModel, 153SemanticModel semanticModel, 170SemanticModel semanticModel, 232SemanticModel semanticModel, 260var semanticModel = await document.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false); 286var relatedSemanticModel = await relatedDocument.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false);
SignatureHelp\CommonSignatureHelpUtilities.cs (1)
153var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
SimplifyThisOrMe\AbstractSimplifyThisOrMeDiagnosticAnalyzer.cs (1)
55var semanticModel = context.SemanticModel;
SimplifyTypeNames\AbstractSimplifyTypeNamesCodeFixProvider.cs (4)
40SyntaxNode root, SemanticModel model, TextSpan span, 77var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 96var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 114private bool CanSimplifyTypeNameExpression(SemanticModel model, SyntaxNode node, TSimplifierOptions options, TextSpan span, out string diagnosticId, CancellationToken cancellationToken)
Snippets\SnippetContext.cs (1)
34public SemanticModel SemanticModel => SyntaxContext.SemanticModel;
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Snippets\SnippetProviders\AbstractInlineStatementSnippetProvider.cs (3)
47var semanticModel = context.SemanticModel; 61var semanticModel = await document.ReuseExistingSpeculativeModelAsync(position, cancellationToken).ConfigureAwait(false); 95SemanticModel semanticModel,
Snippets\SnippetProviders\AbstractUsingSnippetProvider.cs (1)
20var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
65SemanticModel semanticModel = null;
SplitOrMergeIfStatements\Consecutive\AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (1)
219var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (1)
150var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
SplitOrMergeIfStatements\Nested\AbstractMergeNestedIfStatementsCodeRefactoringProvider.cs (1)
221var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (2)
40protected abstract (CommonConversion conversion, ITypeSymbol? collectionElementType) GetForEachInfo(SemanticModel semanticModel, TForEachStatementSyntax node); 52var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
93private bool IsFixSupported(SemanticModel semanticModel, TNamespaceSyntax namespaceDeclaration, CancellationToken cancellationToken) 170protected bool ContainsPartialTypeWithMultipleDeclarations(TNamespaceSyntax namespaceDeclaration, SemanticModel semanticModel)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (2)
32protected abstract bool IsUnnecessaryCast(SemanticModel model, TCastExpression node, CancellationToken cancellationToken); 56private Diagnostic? TryRemoveCastExpression(SemanticModel model, TCastExpression node, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
44TParenthesizedExpressionSyntax parenthesizedExpression, SemanticModel semanticModel, CancellationToken cancellationToken,
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (1)
73public void AnalyzeAssemblyOrModuleAttribute(SyntaxNode attributeSyntax, SemanticModel model, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (3)
85SemanticModel semanticModel, 392SemanticModel semanticModel, 734SemanticModel semanticModel,
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
44SemanticModel model,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
686SemanticModel? lazyModel = null;
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (2)
51protected abstract CommonConversion GetConversion(SemanticModel semanticModel, TExpressionSyntax node, CancellationToken cancellationToken); 72var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (2)
244private static bool IsType<T>(INamedTypeSymbol type, SemanticModel semanticModel) 247private static INamedTypeSymbol? FindType<T>(SemanticModel semanticModel)
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (3)
67SemanticModel model, SyntaxNode node, TSimplifierOptions options, 101public bool TrySimplify(SemanticModel model, SyntaxNode node, [NotNullWhen(true)] out Diagnostic? diagnostic, TSimplifierOptions options, AnalyzerOptions analyzerOptions, CancellationToken cancellationToken) 122internal static Diagnostic CreateDiagnostic(SemanticModel model, TSimplifierOptions options, AnalyzerOptions analyzerOptions, TextSpan issueSpan, string diagnosticId, bool inDeclaration)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (9)
88protected abstract TExpression? GetSetterExpression(SemanticModel semanticModel, IMethodSymbol setMethod, CancellationToken cancellationToken); 91SemanticModel semanticModel, IMethodSymbol accessor, HashSet<string> fieldNames, HashSet<IFieldSymbol> result, CancellationToken cancellationToken); 94HashSet<string> fieldNames, ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty, SemanticModel semanticModel, SyntaxNode codeBlock, CancellationToken cancellationToken); 224SemanticModel semanticModel, 256SemanticModel semanticModel, 275SemanticModel semanticModel, IMethodSymbol setMethod, HashSet<string> fieldNames, CancellationToken cancellationToken) 291SemanticModel semanticModel, 333var semanticModel = context.SemanticModel; 499SemanticModel semanticModel,
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
53var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (2)
43protected abstract bool IsTargetTyped(SemanticModel semanticModel, TConditionalExpressionSyntax conditional, System.Threading.CancellationToken cancellationToken); 102var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (2)
38protected abstract bool IsTargetTyped(SemanticModel semanticModel, TConditionalExpressionSyntax conditional, System.Threading.CancellationToken cancellationToken); 100var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs (4)
47protected SemanticModel SemanticModel => this.State.SemanticModel; 93SemanticModel semanticModel, 113SemanticModel semanticModel, 142SemanticModel semanticModel,
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
70SemanticModel semanticModel,
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (2)
80SemanticModel semanticModel, 129var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\IUpdateExpressionSyntaxHelper.cs (1)
15void GetPartsOfForeachStatement(SemanticModel semanticModel, TStatementSyntax statement, out SyntaxToken awaitKeyword, out SyntaxToken identifier, out TExpressionSyntax expression, out IEnumerable<TStatementSyntax> statements, out bool needsCast);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (3)
24SemanticModel semanticModel, 39public readonly SemanticModel SemanticModel = semanticModel; 363SemanticModel semanticModel, TStatementSyntax foreachStatement)
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
138var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (3)
41ISyntaxFacts syntaxFacts, SyntaxNode expr, SemanticModel semanticModel, CancellationToken cancellationToken) 47ISyntaxFacts syntaxFacts, SyntaxNode expr, SemanticModel semanticModel, 99SyntaxNode expr, SemanticModel semanticModel, bool isTopLevel, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
55var semanticModel = ifOperation.SemanticModel;
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (2)
60var semanticModel = context.SemanticModel; 148private static ITypeParameterSymbol? GetGenericParameterSymbol(ISyntaxFacts syntaxFacts, SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (6)
114SemanticModel semanticModel, 154SemanticModel semanticModel, 255SemanticModel semanticModel, 310SemanticModel semanticModel, 388SemanticModel semanticModel, 413ISyntaxFacts syntaxFacts, SemanticModel semanticModel, TExpressionSyntax node, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
58SemanticModel semanticModel,
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
95var semanticModel = context.SemanticModel;
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (1)
50SemanticModel semanticModel,
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (3)
79var semanticModel = context.Operation.SemanticModel; 138private static bool ValueIsAccessed(SemanticModel semanticModel, IConditionalOperation ifOperation, IBlockOperation containingBlock, ISymbol localOrParameter, IExpressionStatementOperation expressionStatement, IAssignmentOperation assignmentExpression) 269SemanticModel semanticModel, IThrowOperation throwOperation,
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
181SemanticModel semanticModel, 191SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (2)
90var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 100Document document, SemanticModel semanticModel, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (7)
48Document document, SemanticModel semanticModel, SyntaxNode root, 60Document document, SemanticModel semanticModel, SyntaxNode root, 72var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 116SemanticModel semanticModel, 159protected virtual (SyntaxNode finalTarget, SyntaxNode finalReplacement) Cast(SemanticModel semanticModel, TExpressionSyntax targetNode, ITypeSymbol conversionType) 162private static string GetSubItemName(SemanticModel semanticModel, int position, ITypeSymbol conversionType) 171SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (4)
27protected abstract SymbolInfo GetSpeculativeSymbolInfo(SemanticModel semanticModel, TArgumentListSyntax newArgumentList); 40SemanticModel semanticModel, 110SemanticModel semanticModel, 204private bool IsInvocationExpressionWithNewArgumentsApplicable(SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\AddExplicitCast\InheritanceDistanceComparer.cs (2)
33internal sealed class InheritanceDistanceComparer<TExpressionSyntax>(SemanticModel semanticModel) 37private readonly SemanticModel _semanticModel = semanticModel;
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (9)
47protected abstract ITypeSymbol GetArgumentType(SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken); 57SemanticModel semanticModel, 71var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 126SemanticModel semanticModel, 147SemanticModel semanticModel, 195SemanticModel semanticModel, 405var semanticModel = await invocationDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 423var semanticModel = await invocationDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 433SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
41var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (3)
18protected abstract Task<string> GetDescriptionAsync(Diagnostic diagnostic, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken); 19protected abstract Task<(SyntaxTree syntaxTree, SyntaxNode root)?> GetRootInOtherSyntaxTreeAsync(SyntaxNode node, SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken); 54var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ConvertTypeOfToNameOf\AbstractConvertTypeOfToNameOfCodeFixProvider.cs (3)
22protected abstract SyntaxNode GetSymbolTypeExpression(SemanticModel model, TMemberAccessExpressionSyntax node, CancellationToken cancellationToken); 38var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 52SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (3)
22protected abstract ITypeSymbol GetForEachElementType(SemanticModel semanticModel, TForEachStatementSyntax forEachStatement); 45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 56SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (5)
39protected abstract ITypeSymbol GetArgumentType(SemanticModel semanticModel, Argument<TExpressionSyntax> argument, CancellationToken cancellationToken); 40protected abstract string GenerateNameForExpression(SemanticModel semanticModel, TExpressionSyntax expression, CancellationToken cancellationToken); 44protected abstract IMethodSymbol? GetCurrentConstructor(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 45protected abstract IMethodSymbol? GetDelegatedConstructor(SemanticModel semanticModel, IMethodSymbol constructor, CancellationToken cancellationToken); 157protected string GenerateNameForArgument(SemanticModel semanticModel, Argument<TExpressionSyntax> argument, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (4)
279var semanticModel = _document.SemanticModel; 285private static ITypeSymbol FixType(ITypeSymbol typeSymbol, SemanticModel semanticModel, IEnumerable<ITypeParameterSymbol> allTypeParameters) 464var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 482var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (2)
41var semanticModel = document.SemanticModel; 82SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.State.cs (1)
91var semanticModel = semanticDocument.SemanticModel;
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (2)
91var semanticModel = semanticDocument.SemanticModel; 172SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.cs (1)
21public abstract ImmutableArray<IParameterSymbol> TryMakeParameters(SemanticModel semanticModel, SyntaxNode target, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.State.cs (1)
58var semanticModel = document.SemanticModel;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.cs (1)
26protected abstract ITypeSymbol? DetermineReturnTypeForSimpleNameOrMemberAccessExpression(ITypeInferenceService typeInferenceService, SemanticModel semanticModel, TExpressionSyntax expression, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (2)
102var semanticModel = document.SemanticModel; 151var semanticModel = semanticDocument.SemanticModel;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (2)
25protected abstract bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel); 26protected abstract bool AreSpecialOptionsActive(SemanticModel semanticModel);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
30protected abstract bool TryConvertToLocalDeclaration(ITypeSymbol type, SyntaxToken identifierToken, SemanticModel semanticModel, CancellationToken cancellationToken, out SyntaxNode newRoot);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
46var semanticModel = await _document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (3)
206var semanticModel = _document.SemanticModel; 262var semanticModel = _document.SemanticModel; 391private static IMethodSymbol FindContainingMethodSymbol(int position, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
43var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.cs (3)
37protected abstract bool TryInitializeState(Document document, SemanticModel model, SyntaxNode interfaceNode, CancellationToken cancellationToken, 63var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 80var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.State.cs (3)
19SemanticModel model) 31public SemanticModel Model { get; } = model; 45SemanticModel model,
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
75var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (4)
50var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 91private static IMethodSymbol? GetMethodSymbol(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 119var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 180var semanticModel = await newDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (3)
57var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 88var semanticModel = await newDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 126var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
28var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
73var model = await document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (3)
45Document document, SyntaxEditor editor, SemanticModel semanticModel, 143var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 153SyntaxEditor editor, SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
24Document document, SyntaxEditor editor, SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
31Document document, SyntaxEditor editor, SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (4)
40var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 58var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 93private static IMethodSymbol? GetMethodSymbol(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 155private static ControlFlowAnalysis? GetControlFlowAnalysis(SyntaxGenerator generator, SemanticModel semanticModel, SyntaxNode node)
src\Analyzers\Core\CodeFixes\RemoveRedundantEquality\RemoveRedundantEqualityCodeFixProvider.cs (1)
41var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs (1)
24TParenthesizedExpressionSyntax current, SemanticModel semanticModel, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
48var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (8)
121protected virtual SyntaxNode? TryUpdateParentOfUpdatedNode(SyntaxNode parent, SyntaxNode newNameNode, SyntaxEditor editor, ISyntaxFacts syntaxFacts, SemanticModel semanticModel) => null; 301var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 348SemanticModel semanticModel, 385SemanticModel semanticModel, 444SemanticModel semanticModel, 918var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 930SemanticModel semanticModel, 935private readonly SemanticModel _semanticModel = semanticModel;
src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (1)
59SyntaxNode SimplifyConditional(SemanticModel semanticModel, Diagnostic diagnostic, SyntaxNode expr)
src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (1)
50var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
35var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (4)
301var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 374var fieldSemanticModel = await fieldDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 379var propertySemanticModel = await propertyDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 480AsyncLazy<SemanticModel> lazySemanticModel,
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (2)
28SemanticModel semanticModel, SyntaxNode expressionToCoalesce, 36var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (1)
40var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (2)
41var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 57SyntaxEditor editor, SemanticModel semanticModel, INamedTypeSymbol? expressionTypeOpt,
src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (1)
75var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (1)
92var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
67var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
54var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (4)
106var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 164var semanticModel = await document.GetRequiredSemanticModelAsync(CancellationToken.None).ConfigureAwait(false); 296SemanticModel semanticModel, TIfStatementSyntax ifStatement, CancellationToken cancellationToken) 308SemanticModel semanticModel, TConditionalExpressionSyntax conditionalExpression, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
71var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (1)
46var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (5)
17internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, ArrayBuilder<SyntaxNode>? executableCodeBlocks, CancellationToken cancellationToken) 36internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken) 41internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, SyntaxNode executableCodeBlock, CancellationToken cancellationToken) 52internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken, params SyntaxNode[] executableCodeBlocks) 63private static ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken)
Testing\AbstractTestMethodFinder.cs (1)
50public bool IsMatch(SemanticModel semanticModel, SyntaxNode node, string fullyQualifiedTestName, CancellationToken cancellationToken)
Testing\ITestMethodFinder.cs (1)
30bool IsMatch(SemanticModel model, SyntaxNode node, string fullyQualifiedTestName, CancellationToken cancellationToken);
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (2)
55var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 183protected abstract bool IsImplicitIndexOrRangeIndexer(ImmutableArray<IParameterSymbol> parameters, TBaseArgumentSyntax argument, SemanticModel semanticModel);
ValueTracking\SerializableValueTrackedItem.cs (1)
46var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ValueTracking\ValueTracker.cs (5)
140var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 210var semanticModel = await sourceDoc.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 260var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 297var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 329var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ValueTracking\ValueTracker.FindReferencesProgress.cs (4)
83var semanticModel = await location.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 109var semanticModel = await location.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 157var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 183var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ValueTracking\ValueTracker.OperationCollector.cs (1)
74var semanticModel = operation.SemanticModel;
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\EditAndContinueTestVerifier.cs (2)
185var oldModel = oldDocument.GetSemanticModelAsync().Result; 186var newModel = newDocument.GetSemanticModelAsync().Result;
Snippets\AbstractSnippetProviderTests.cs (2)
64var semanticModel = await document.GetRequiredSemanticModelAsync(CancellationToken.None); 141var semanticModel = await document.GetRequiredSemanticModelAsync(CancellationToken.None);
Microsoft.CodeAnalysis.Features.UnitTests (3)
FindUsages\DefinitionItemFactoryTests.cs (3)
1452var model = compilation.GetSemanticModel(tree); 1518var model = compilation.GetSemanticModel(tree); 1589var model = compilation.GetSemanticModel(tree);
Microsoft.CodeAnalysis.LanguageServer (1)
Testing\TestDiscoverer.cs (1)
97var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken);
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\Definitions\AbstractGoToDefinitionHandler.cs (1)
78var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (271)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (4)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 34internal SemanticModel GetSemanticModel(SyntaxNode node)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (3)
74var model = context.GetSemanticModel(declSyntax); 182SemanticModel model = context.GetSemanticModel(declSyntax); 243var model = context.GetSemanticModel(node);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
458var semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
57var model = compilation.GetSemanticModel(receiverSyntax.SyntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
22/// <see cref="SemanticModel"/> is needed, use <see cref="SemanticSpanAnalysis"/> or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
23SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (7)
14public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 18SemanticModel semanticModel1, 19SemanticModel semanticModel2, 48SemanticModel semanticModel1, 49SemanticModel semanticModel2, 129SemanticModel semanticModel1, 130SemanticModel semanticModel2,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
33public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 36public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 39public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 42public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 45public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 54public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66public static TSymbol? GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 88public static INamedTypeSymbol? GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 91public static INamespaceSymbol? GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 94public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel) 108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 137public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 168private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 219this SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
66SemanticModel? semanticModel, 68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (3)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 23public ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken) 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
15ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken); 18SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (25)
51bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 58bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 59bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 72bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 77ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken); 79ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 80SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 82IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 84ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 92IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 93IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 100bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 107bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 109string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 120IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (3)
17SemanticModel semanticModel) 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
386bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
44var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
53var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
87TryGetSemanticModel(compilation, syntaxTree, out var semanticModel)) 116[NotNullWhen(true)] out SemanticModel? semanticModel) 185TryGetSemanticModel(reader.Compilation, firstSourceTree, out var semanticModel)) 255SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
50private SemanticModel? _lazySpeculativeSemanticModel; 75SemanticModel semanticModel, 96protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 102protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 103protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType); 104protected abstract bool ConversionsAreCompatible(SemanticModel model1, TExpressionSyntax expression1, SemanticModel model2, TExpressionSyntax expression2); 109protected abstract bool IsForEachTypeInferred(TForEachStatementSyntax forEachStatement, SemanticModel semanticModel); 110protected abstract bool ForEachConversionsAreCompatible(SemanticModel originalModel, TForEachStatementSyntax originalForEach, SemanticModel newModel, TForEachStatementSyntax newForEach); 112SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType, out ImmutableArray<ILocalSymbol> localVariables); 155public SemanticModel OriginalSemanticModel { get; } 190public SemanticModel SpeculativeSemanticModel 224protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 977SemanticModel speculativeSemanticModel) 1031private bool IsReceiverNonUniquePossibleValueTypeParam(TExpressionSyntax invocation, SemanticModel semanticModel) 1049private static bool IsReceiverUniqueInstance(TExpressionSyntax receiver, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
26SemanticModel semanticModel, 47public static void AddAliasSymbols(SemanticModel semanticModel, int namespaceId, IEnumerable<IAliasSymbol> aliasSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (4)
11/// <see cref="SemanticModel.SyntaxTree"/> that <see cref="OriginalSemanticModel"/> points at. 17/// cref="SemanticModel.SyntaxTree"/> that <see cref="SpeculativeSemanticModel"/> points at. 24SemanticModel OriginalSemanticModel { get; } 30SemanticModel SpeculativeSemanticModel { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
199public string ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null) 202public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (2)
65public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 68public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
73protected abstract INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model); 78SemanticModel model, 94SemanticModel model, 121var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 183var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 259private static bool IsInsideNamespace(SyntaxNode node, INamespaceSymbol symbol, SemanticModel model, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
12SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14SemanticModel semanticModel, 48public SemanticModel SemanticModel { get; } = semanticModel;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (6)
33public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 35if (document.TryGetSemanticModel(out var semanticModel)) 111public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 128public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 153public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 178var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeInferenceServiceExtensions.cs (11)
15public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 18public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 21public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 24public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 29SemanticModel semanticModel, 39SemanticModel semanticModel, 47private static INamedTypeSymbol? GetFirstDelegateType(SemanticModel semanticModel, ImmutableArray<ITypeSymbol> types) 55SemanticModel semanticModel, 67SemanticModel semanticModel, 85SemanticModel semanticModel, 97SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (13)
30Func<SemanticModel, TType, TNode, bool> canReplace, 31Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 53Func<SemanticModel, TType, TNode, bool> canReplace, 54Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 75Func<SemanticModel, TNode, bool> canReplace, 76Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 97Func<SemanticModel, TType, TNode, bool> canReplace, 98Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 119Func<SemanticModel, TNode, bool> canReplace, 120Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 155Func<SemanticModel, TType, TNode, bool> canReplace, 156Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 172var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (4)
338SemanticModel semanticModel, 389SemanticModel semanticModel, 451SemanticModel semanticModel, 461this SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, string identifierName)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
62SemanticModel semanticModel, 454SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (7)
37SemanticModel semanticModel, 47SemanticModel semanticModel, 58SemanticModel semanticModel, 140SemanticModel semanticModel, 232SemanticModel semanticModel, 258private static SyntaxNode GetNegationOfIsPatternExpression(SyntaxNode isExpression, SyntaxGenerator generator, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, CancellationToken cancellationToken) 471SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
38SemanticModel semanticModel, 119var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 208var semanticModel = compilation.GetSemanticModel(group.Key);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
82var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
27var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 34var currentModel = await current.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (31)
39SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 47SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 55SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 63SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 71SemanticModel semanticModel, 95protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, CancellationToken cancellationToken) 179public bool IsWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 182public bool IsOnlyWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 185public bool IsInOutContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 188public bool IsInRefContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 191public bool IsInInContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 194public bool CanReplaceWithRValue(SemanticModel semanticModel, SyntaxNode? expression, CancellationToken cancellationToken) 197public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 203public bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel) 206public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken) 209public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement) 212public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 215public IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 218public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 221public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 227public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 230public IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 233public IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 236public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 239public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 242public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 245public bool IsInsideNameOfExpression(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 251public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, INamedTypeSymbol? expressionTypeOpt, CancellationToken cancellationToken) 254public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 257public IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (17)
15bool IsExpressionContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 16bool IsStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 17bool IsTypeContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 18bool IsNamespaceContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 19bool IsNamespaceDeclarationNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 20bool IsTypeDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 21bool IsMemberDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 22bool IsGlobalStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 23bool IsLabelContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 24bool IsAttributeNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 27SemanticModel semanticModel, SyntaxNode location, 31SemanticModel semanticModel, SyntaxNode location, 34SyntaxToken GenerateUniqueName(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, string baseName, 38SemanticModel semanticModel, SyntaxNode location, 42SemanticModel semanticModel, SyntaxNode location, 47CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination); 49IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
18protected readonly SemanticModel SemanticModel; 26protected AbstractTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (8)
13protected abstract AbstractTypeInferrer CreateTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken); 16SemanticModel semanticModel, ImmutableArray<ITypeSymbol> result, string? nameOpt) 27SemanticModel semanticModel, ImmutableArray<TypeInferenceInfo> result, string? nameOpt) 42SemanticModel semanticModel, string name) 80SemanticModel semanticModel, int position, 91SemanticModel semanticModel, SyntaxNode expression, 102SemanticModel semanticModel, int position, 110SemanticModel semanticModel, SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\ITypeInferenceService.cs (4)
27ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken); 28ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 30ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 31ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (4)
34protected abstract SemanticModel? TryGetSpeculativeSemanticModelWorker(SemanticModel previousSemanticModel, SyntaxNode previousBodyNode, SyntaxNode currentBodyNode); 49public async Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseLanguageService.cs (2)
36Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseWorkspaceService.cs (1)
21ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (10)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 20public readonly SemanticModel PreviousNonSpeculativeSemanticModel = previousNonSpeculativeSemanticModel; 23/// The current semantic model we retrieved <see cref="SemanticModel"/> for the <see cref="BodyNode"/>. Could 26public readonly SemanticModel CurrentSemanticModel = currentSemanticModel; 34/// The top level version of the project when we retrieved <see cref="SemanticModel"/>. As long as this is the 94public async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 131var semanticModel = info.CurrentSemanticModel; 157var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 202var semanticModel = await reuseService.TryGetSpeculativeSemanticModelAsync(reuseInfo.PreviousNonSpeculativeSemanticModel, bodyNode, cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractReducer.IExpressionRewriter.cs (1)
16SyntaxNodeOrToken VisitNodeOrToken(SyntaxNodeOrToken nodeOrTokenToReduce, SemanticModel semanticModel, bool simplifyAllDescendants);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (9)
41protected abstract SemanticModel GetSpeculativeSemanticModel(ref SyntaxNode nodeToSpeculate, SemanticModel originalSemanticModel, SyntaxNode originalNode); 51public abstract SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken); 52public abstract SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken); 69var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 165var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 191var semanticModelForReduce = semanticModel; 291var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
18SemanticModel semanticModel, 26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (2)
63public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 99public static bool IsNamespaceOrTypeOrThisParameter(SyntaxNode expression, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (2)
24SemanticModel semanticModel, TMemberAccessExpressionSyntax memberAccessExpression, CancellationToken cancellationToken); 34SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractSimplifier.cs (1)
18SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (2)
25SemanticModel semanticModel, 53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 16public readonly SemanticModel SemanticModel = semanticModel; 22var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.PublicApiAnalyzers (106)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (4)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 34internal SemanticModel GetSemanticModel(SyntaxNode node)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (3)
74var model = context.GetSemanticModel(declSyntax); 182SemanticModel model = context.GetSemanticModel(declSyntax); 243var model = context.GetSemanticModel(node);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
458var semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
57var model = compilation.GetSemanticModel(receiverSyntax.SyntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
22/// <see cref="SemanticModel"/> is needed, use <see cref="SemanticSpanAnalysis"/> or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
23SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (7)
14public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 18SemanticModel semanticModel1, 19SemanticModel semanticModel2, 48SemanticModel semanticModel1, 49SemanticModel semanticModel2, 129SemanticModel semanticModel1, 130SemanticModel semanticModel2,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
33public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 36public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 39public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 42public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 45public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 54public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66public static TSymbol? GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 88public static INamedTypeSymbol? GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 91public static INamespaceSymbol? GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 94public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel) 108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 137public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 168private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 219this SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
66SemanticModel? semanticModel, 68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (3)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 23public ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken) 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
15ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken); 18SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (25)
51bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 58bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 59bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 72bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 77ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken); 79ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 80SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 82IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 84ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 92IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 93IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 100bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 107bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 109string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 120IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (3)
17SemanticModel semanticModel) 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
386bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
44var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
53var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
87TryGetSemanticModel(compilation, syntaxTree, out var semanticModel)) 116[NotNullWhen(true)] out SemanticModel? semanticModel) 185TryGetSemanticModel(reader.Compilation, firstSourceTree, out var semanticModel)) 255SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
50private SemanticModel? _lazySpeculativeSemanticModel; 75SemanticModel semanticModel, 96protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 102protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 103protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType); 104protected abstract bool ConversionsAreCompatible(SemanticModel model1, TExpressionSyntax expression1, SemanticModel model2, TExpressionSyntax expression2); 109protected abstract bool IsForEachTypeInferred(TForEachStatementSyntax forEachStatement, SemanticModel semanticModel); 110protected abstract bool ForEachConversionsAreCompatible(SemanticModel originalModel, TForEachStatementSyntax originalForEach, SemanticModel newModel, TForEachStatementSyntax newForEach); 112SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType, out ImmutableArray<ILocalSymbol> localVariables); 155public SemanticModel OriginalSemanticModel { get; } 190public SemanticModel SpeculativeSemanticModel 224protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 977SemanticModel speculativeSemanticModel) 1031private bool IsReceiverNonUniquePossibleValueTypeParam(TExpressionSyntax invocation, SemanticModel semanticModel) 1049private static bool IsReceiverUniqueInstance(TExpressionSyntax receiver, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
26SemanticModel semanticModel, 47public static void AddAliasSymbols(SemanticModel semanticModel, int namespaceId, IEnumerable<IAliasSymbol> aliasSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (4)
11/// <see cref="SemanticModel.SyntaxTree"/> that <see cref="OriginalSemanticModel"/> points at. 17/// cref="SemanticModel.SyntaxTree"/> that <see cref="SpeculativeSemanticModel"/> points at. 24SemanticModel OriginalSemanticModel { get; } 30SemanticModel SpeculativeSemanticModel { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (3)
AnnotatePublicApiFix.cs (1)
140SemanticModel? semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
DeclarePublicApiFix.cs (1)
272SemanticModel? semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (1)
472public static SyntaxNode FirstUnusedIdentifierName(this SyntaxGenerator generator, SemanticModel semanticModel, int position, string baseName, int maxTries = int.MaxValue)
Microsoft.CodeAnalysis.ResxSourceGenerator (106)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (4)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 34internal SemanticModel GetSemanticModel(SyntaxNode node)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (3)
74var model = context.GetSemanticModel(declSyntax); 182SemanticModel model = context.GetSemanticModel(declSyntax); 243var model = context.GetSemanticModel(node);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
458var semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
57var model = compilation.GetSemanticModel(receiverSyntax.SyntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
22/// <see cref="SemanticModel"/> is needed, use <see cref="SemanticSpanAnalysis"/> or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
23SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (7)
14public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 18SemanticModel semanticModel1, 19SemanticModel semanticModel2, 48SemanticModel semanticModel1, 49SemanticModel semanticModel2, 129SemanticModel semanticModel1, 130SemanticModel semanticModel2,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
33public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 36public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 39public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 42public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 45public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 54public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66public static TSymbol? GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 88public static INamedTypeSymbol? GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 91public static INamespaceSymbol? GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 94public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel) 108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 137public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 168private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 219this SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
66SemanticModel? semanticModel, 68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (3)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 23public ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken) 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
15ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken); 18SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (25)
51bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 58bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 59bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 72bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 77ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken); 79ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 80SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 82IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 84ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 92IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 93IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 100bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 107bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 109string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 120IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (3)
17SemanticModel semanticModel) 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
386bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
44var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
53var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
87TryGetSemanticModel(compilation, syntaxTree, out var semanticModel)) 116[NotNullWhen(true)] out SemanticModel? semanticModel) 185TryGetSemanticModel(reader.Compilation, firstSourceTree, out var semanticModel)) 255SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
50private SemanticModel? _lazySpeculativeSemanticModel; 75SemanticModel semanticModel, 96protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 102protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 103protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType); 104protected abstract bool ConversionsAreCompatible(SemanticModel model1, TExpressionSyntax expression1, SemanticModel model2, TExpressionSyntax expression2); 109protected abstract bool IsForEachTypeInferred(TForEachStatementSyntax forEachStatement, SemanticModel semanticModel); 110protected abstract bool ForEachConversionsAreCompatible(SemanticModel originalModel, TForEachStatementSyntax originalForEach, SemanticModel newModel, TForEachStatementSyntax newForEach); 112SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType, out ImmutableArray<ILocalSymbol> localVariables); 155public SemanticModel OriginalSemanticModel { get; } 190public SemanticModel SpeculativeSemanticModel 224protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 977SemanticModel speculativeSemanticModel) 1031private bool IsReceiverNonUniquePossibleValueTypeParam(TExpressionSyntax invocation, SemanticModel semanticModel) 1049private static bool IsReceiverUniqueInstance(TExpressionSyntax receiver, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
26SemanticModel semanticModel, 47public static void AddAliasSymbols(SemanticModel semanticModel, int namespaceId, IEnumerable<IAliasSymbol> aliasSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (4)
11/// <see cref="SemanticModel.SyntaxTree"/> that <see cref="OriginalSemanticModel"/> points at. 17/// cref="SemanticModel.SyntaxTree"/> that <see cref="SpeculativeSemanticModel"/> points at. 24SemanticModel OriginalSemanticModel { get; } 30SemanticModel SpeculativeSemanticModel { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
Microsoft.CodeAnalysis.Test.Utilities (18)
CommonTestBase.cs (6)
576internal static void VerifyParentOperations(SemanticModel model) 594private static Dictionary<IOperation, IOperation?> GetParentOperationsMap(SemanticModel model) 626private static void CollectTopOperations(SemanticModel model, SyntaxNode node, HashSet<IOperation> topOperations) 645internal static void VerifyClone(SemanticModel model) 679var semanticModel = ((Operation)root).OwningSemanticModel; 695SemanticModel semanticModel, HashSet<IOperation> set, SyntaxNode node)
Compilation\CompilationExtensions.cs (3)
194SemanticModel model = compilation.GetSemanticModel(node.SyntaxTree); 207SemanticModel model = compilation.GetSemanticModel(tree); 293var semanticModel = compilation.GetSemanticModel(tree);
Compilation\ControlFlowGraphVerifier.cs (2)
28public static (ControlFlowGraph graph, ISymbol associatedSymbol) GetControlFlowGraph(SyntaxNode syntaxNode, SemanticModel model) 349var model = compilation.GetSemanticModel(graph.OriginalOperation.Syntax.SyntaxTree);
Compilation\SemanticModelExtensions.cs (2)
13public static void VerifyOperationTree(this SemanticModel model, SyntaxNode node, string expectedOperationTree) 20public static void AppendOperationTree(this SemanticModel model, SyntaxNode node, StringBuilder actualTextBuilder, int initialIndent = 0)
Compilation\TestOperationVisitor.cs (1)
796private static void CheckOperators(SemanticModel semanticModel, SyntaxNode syntax)
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
2986public readonly List<SemanticModel> AnalyzedSemanticModels = new();
Diagnostics\DiagnosticsHelper.cs (1)
33public static void VerifyDiagnostics(SemanticModel model, string source, string pattern, params string[] expectedDiagnosticIds)
Diagnostics\OperationTestAnalyzer.cs (2)
2140var model = syntaxContext.SemanticModel; 2152var model = syntaxContext.SemanticModel;
Microsoft.CodeAnalysis.UnitTests (4)
Diagnostics\OperationTests.cs (1)
276var model = compilation.GetSemanticModel(tree, ignoreAccessibility: true);
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (2)
1346var model = compilation.GetSemanticModel(syntaxTree); 1395private static ISymbol GetSymbolAtPosition(SemanticModel model, int pos)
Symbols\DocumentationCommentIdTests.cs (1)
175var semanticModel = comp.GetSemanticModel(tree);
Microsoft.CodeAnalysis.VisualBasic (120)
Binding\MemberSemanticModel.vb (2)
69Public NotOverridable Overrides ReadOnly Property ParentModel As SemanticModel 77Friend NotOverridable Overrides ReadOnly Property ContainingPublicModelOrSelf As SemanticModel
Compilation\PublicSemanticModel.vb (2)
8''' Instances of this <see cref="SemanticModel"/> can be exposed to external consumers. 15Friend NotOverridable Overrides ReadOnly Property ContainingPublicModelOrSelf As SemanticModel
Compilation\SemanticModel.vb (8)
2154Public Function TryGetSpeculativeSemanticModelForMethodBody(position As Integer, method As MethodBlockBaseSyntax, <Out> ByRef speculativeModel As SemanticModel) As Boolean 2184Public Function TryGetSpeculativeSemanticModel(position As Integer, rangeArgument As RangeArgumentSyntax, <Out> ByRef speculativeModel As SemanticModel) As Boolean 2213Public Function TryGetSpeculativeSemanticModel(position As Integer, statement As ExecutableStatementSyntax, <Out> ByRef speculativeModel As SemanticModel) As Boolean 2243Public Function TryGetSpeculativeSemanticModel(position As Integer, initializer As EqualsValueSyntax, <Out> ByRef speculativeModel As SemanticModel) As Boolean 2272Public Function TryGetSpeculativeSemanticModel(position As Integer, attribute As AttributeSyntax, <Out> ByRef speculativeModel As SemanticModel) As Boolean 2304Public Function TryGetSpeculativeSemanticModel(position As Integer, type As TypeSyntax, <Out> ByRef speculativeModel As SemanticModel, Optional bindingOption As SpeculativeBindingOption = SpeculativeBindingOption.BindAsExpression) As Boolean 2321Public MustOverride Shadows ReadOnly Property ParentModel As SemanticModel 3061Protected NotOverridable Overrides ReadOnly Property ParentModelCore As SemanticModel
Compilation\SpeculativeSemanticModelWithMemberModel.vb (1)
107Public Overrides ReadOnly Property ParentModel As SemanticModel
Compilation\SpeculativeSyntaxTreeSemanticModel.vb (1)
57Public Overrides ReadOnly Property ParentModel As SemanticModel
Compilation\SyntaxTreeSemanticModel.vb (1)
1419Public Overrides ReadOnly Property ParentModel As SemanticModel
Compilation\VisualBasicCompilation.vb (4)
2042Public Shadows Function GetSemanticModel(syntaxTree As SyntaxTree, Optional ignoreAccessibility As Boolean = False) As SemanticModel 2043Dim model As SemanticModel = Nothing 2053Friend Overrides Function CreateSemanticModel(syntaxTree As SyntaxTree, options As SemanticModelOptions) As SemanticModel 2774Protected Overrides Function CommonGetSemanticModel(syntaxTree As SyntaxTree, options As SemanticModelOptions) As SemanticModel
Errors\ErrorFacts.vb (1)
9''' <see cref="SemanticModel.GetDiagnostics(Text.TextSpan?, System.Threading.CancellationToken)"/> API.
Operations\VisualBasicOperationFactory.vb (2)
18Private ReadOnly _semanticModel As SemanticModel 20Public Sub New(semanticModel As SemanticModel)
src\Compilers\VisualBasic\BasicAnalyzerDriver\VisualBasicDeclarationComputer.vb (3)
15Public Shared Sub ComputeDeclarationsInSpan(model As SemanticModel, 25Public Shared Sub ComputeDeclarationsInNode(model As SemanticModel, 41Private Shared Sub ComputeDeclarationsCore(model As SemanticModel,
SymbolDisplay\SymbolDisplay.vb (5)
45semanticModel As SemanticModel, 53semanticModel As SemanticModel, 96semanticModel As SemanticModel, 104semanticModelOpt As SemanticModel, 117semanticModelOpt As SemanticModel,
SymbolDisplay\SymbolDisplayVisitor.vb (3)
32semanticModelOpt As SemanticModel, 43semanticModelOpt As SemanticModel, 55Protected Shadows Sub Initialize(builder As ArrayBuilder(Of SymbolDisplayPart), format As SymbolDisplayFormat, isFirstSymbolVisited As Boolean, semanticModelOpt As SemanticModel, positionOpt As Integer, inNamespaceOrType As Boolean)
SymbolDisplay\SymbolDisplayVisitor_Minimal.vb (1)
179Private Function GetSyntaxTree(semanticModel As SemanticModel) As SyntaxTree
Symbols\Symbol.vb (4)
885Public Function ToMinimalDisplayString(semanticModel As SemanticModel, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As String 889Public Function ToMinimalDisplayParts(semanticModel As SemanticModel, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) 1346Private Function ISymbol_ToMinimalDisplayString(semanticModel As SemanticModel, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As String Implements ISymbol.ToMinimalDisplayString 1350Private Function ISymbol_ToMinimalDisplayParts(semanticModel As SemanticModel, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ISymbol.ToMinimalDisplayParts
Symbols\TypeSymbol.vb (2)
622Private Function ITypeSymbol_ToMinimalDisplayString(semanticModel As SemanticModel, topLevelNullability As NullableFlowState, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As String Implements ITypeSymbol.ToMinimalDisplayString 626Private Function ITypeSymbol_ToMinimalDisplayParts(semanticModel As SemanticModel, topLevelNullability As NullableFlowState, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ITypeSymbol.ToMinimalDisplayParts
VisualBasicExtensions.vb (80)
665Public Function OptionStrict(semanticModel As SemanticModel) As OptionStrict 680Public Function OptionInfer(semanticModel As SemanticModel) As Boolean 695Public Function OptionExplicit(semanticModel As SemanticModel) As Boolean 710Public Function OptionCompareText(semanticModel As SemanticModel) As Boolean 807Public Function ClassifyConversion(semanticModel As SemanticModel, expression As ExpressionSyntax, destination As ITypeSymbol) As Conversion 825Public Function ClassifyConversion(semanticModel As SemanticModel, position As Integer, expression As ExpressionSyntax, destination As ITypeSymbol) As Conversion 842Public Function GetDeclaredSymbol(semanticModel As SemanticModel, identifierSyntax As ModifiedIdentifierSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 859Public Function GetDeclaredSymbol(semanticModel As SemanticModel, elementSyntax As TupleElementSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 876Public Function GetDeclaredSymbol(semanticModel As SemanticModel, fieldInitializerSyntax As FieldInitializerSyntax, Optional cancellationToken As CancellationToken = Nothing) As IPropertySymbol 889Public Function GetDeclaredSymbol(semanticModel As SemanticModel, anonymousObjectCreationExpressionSyntax As AnonymousObjectCreationExpressionSyntax, Optional cancellationToken As CancellationToken = Nothing) As INamedTypeSymbol 902Public Function GetDeclaredSymbol(semanticModel As SemanticModel, rangeVariableSyntax As ExpressionRangeVariableSyntax, Optional cancellationToken As CancellationToken = Nothing) As IRangeVariableSymbol 915Public Function GetDeclaredSymbol(semanticModel As SemanticModel, rangeVariableSyntax As CollectionRangeVariableSyntax, Optional cancellationToken As CancellationToken = Nothing) As IRangeVariableSymbol 928Public Function GetDeclaredSymbol(semanticModel As SemanticModel, rangeVariableSyntax As AggregationRangeVariableSyntax, Optional cancellationToken As CancellationToken = Nothing) As IRangeVariableSymbol 941Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As LabelStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As ILabelSymbol 954Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As EnumMemberDeclarationSyntax, Optional cancellationToken As CancellationToken = Nothing) As IFieldSymbol 967Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As TypeStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As INamedTypeSymbol 980Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As TypeBlockSyntax, Optional cancellationToken As CancellationToken = Nothing) As INamedTypeSymbol 993Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As EnumStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As INamedTypeSymbol 1006Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As EnumBlockSyntax, Optional cancellationToken As CancellationToken = Nothing) As INamedTypeSymbol 1019Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As NamespaceStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As INamespaceSymbol 1032Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As NamespaceBlockSyntax, Optional cancellationToken As CancellationToken = Nothing) As INamespaceSymbol 1045Public Function GetDeclaredSymbol(semanticModel As SemanticModel, parameter As ParameterSyntax, Optional cancellationToken As CancellationToken = Nothing) As IParameterSymbol 1058Public Function GetDeclaredSymbol(semanticModel As SemanticModel, typeParameter As TypeParameterSyntax, Optional cancellationToken As CancellationToken = Nothing) As ITypeParameterSymbol 1071Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As DelegateStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As INamedTypeSymbol 1084Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As SubNewStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As IMethodSymbol 1097Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As MethodStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As IMethodSymbol 1110Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As DeclareStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As IMethodSymbol 1123Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As OperatorStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As IMethodSymbol 1136Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As MethodBlockBaseSyntax, Optional cancellationToken As CancellationToken = Nothing) As IMethodSymbol 1149Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As PropertyStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As IPropertySymbol 1162Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As EventStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As IEventSymbol 1175Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As PropertyBlockSyntax, Optional cancellationToken As CancellationToken = Nothing) As IPropertySymbol 1188Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As EventBlockSyntax, Optional cancellationToken As CancellationToken = Nothing) As IEventSymbol 1201Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As CatchStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As ILocalSymbol 1214Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As AccessorStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As IMethodSymbol 1227Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As SimpleImportsClauseSyntax, Optional cancellationToken As CancellationToken = Nothing) As IAliasSymbol 1240Public Function GetForEachStatementInfo(semanticModel As SemanticModel, node As ForEachStatementSyntax) As ForEachStatementInfo 1253Public Function GetForEachStatementInfo(semanticModel As SemanticModel, node As ForEachBlockSyntax) As ForEachStatementInfo 1266Public Function GetAwaitExpressionInfo(semanticModel As SemanticModel, awaitExpression As AwaitExpressionSyntax, Optional cancellationToken As CancellationToken = Nothing) As AwaitExpressionInfo 1279Public Function GetPreprocessingSymbolInfo(semanticModel As SemanticModel, node As IdentifierNameSyntax) As PreprocessingSymbolInfo 1292Public Function GetSymbolInfo(semanticModel As SemanticModel, expression As ExpressionSyntax, Optional cancellationToken As CancellationToken = Nothing) As SymbolInfo 1306Public Function GetCollectionInitializerSymbolInfo(semanticModel As SemanticModel, expression As ExpressionSyntax, Optional cancellationToken As CancellationToken = Nothing) As SymbolInfo 1319Public Function GetSymbolInfo(semanticModel As SemanticModel, crefReference As CrefReferenceSyntax, Optional cancellationToken As CancellationToken = Nothing) As SymbolInfo 1332Public Function GetSymbolInfo(semanticModel As SemanticModel, attribute As AttributeSyntax, Optional cancellationToken As CancellationToken = Nothing) As SymbolInfo 1345Public Function GetSpeculativeSymbolInfo(semanticModel As SemanticModel, position As Integer, expression As ExpressionSyntax, bindingOption As SpeculativeBindingOption) As SymbolInfo 1358Public Function GetSpeculativeSymbolInfo(semanticModel As SemanticModel, position As Integer, attribute As AttributeSyntax) As SymbolInfo 1371Public Function GetConversion(semanticModel As SemanticModel, expression As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As Conversion 1478Public Function GetSpeculativeConversion(semanticModel As SemanticModel, position As Integer, expression As ExpressionSyntax, bindingOption As SpeculativeBindingOption) As Conversion 1488Public Function GetTypeInfo(semanticModel As SemanticModel, expression As ExpressionSyntax, Optional cancellationToken As CancellationToken = Nothing) As TypeInfo 1501Public Function GetSpeculativeTypeInfo(semanticModel As SemanticModel, position As Integer, expression As ExpressionSyntax, bindingOption As SpeculativeBindingOption) As TypeInfo 1514Public Function GetTypeInfo(semanticModel As SemanticModel, attribute As AttributeSyntax, Optional cancellationToken As CancellationToken = Nothing) As TypeInfo 1527Public Function GetMemberGroup(semanticModel As SemanticModel, expression As ExpressionSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 1540Public Function GetSpeculativeMemberGroup(semanticModel As SemanticModel, position As Integer, expression As ExpressionSyntax) As ImmutableArray(Of ISymbol) 1553Public Function GetMemberGroup(semanticModel As SemanticModel, attribute As AttributeSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 1567Public Function GetAliasInfo(semanticModel As SemanticModel, nameSyntax As IdentifierNameSyntax, Optional cancellationToken As CancellationToken = Nothing) As IAliasSymbol 1581Public Function GetSpeculativeAliasInfo(semanticModel As SemanticModel, position As Integer, nameSyntax As IdentifierNameSyntax, bindingOption As SpeculativeBindingOption) As IAliasSymbol 1595semanticModel As SemanticModel, 1612semanticModel As SemanticModel, 1683''' Use <see cref="GetAggregateClauseSymbolInfo(SemanticModel, AggregateClauseSyntax, CancellationToken)"/> instead. 1690semanticModel As SemanticModel, 1708semanticModel As SemanticModel, 1725semanticModel As SemanticModel, 1742semanticModel As SemanticModel, 1758Public Function AnalyzeControlFlow(semanticModel As SemanticModel, firstStatement As StatementSyntax, lastStatement As StatementSyntax) As ControlFlowAnalysis 1771Public Function AnalyzeControlFlow(semanticModel As SemanticModel, statement As StatementSyntax) As ControlFlowAnalysis 1784Public Function AnalyzeDataFlow(semanticModel As SemanticModel, expression As ExpressionSyntax) As DataFlowAnalysis 1797Public Function AnalyzeDataFlow(semanticModel As SemanticModel, firstStatement As StatementSyntax, lastStatement As StatementSyntax) As DataFlowAnalysis 1810Public Function AnalyzeDataFlow(semanticModel As SemanticModel, statement As StatementSyntax) As DataFlowAnalysis 1823Public Function TryGetSpeculativeSemanticModelForMethodBody(semanticModel As SemanticModel, position As Integer, method As MethodBlockBaseSyntax, <Out> ByRef speculativeModel As SemanticModel) As Boolean 1837Public Function TryGetSpeculativeSemanticModel(semanticModel As SemanticModel, position As Integer, rangeArgument As RangeArgumentSyntax, <Out> ByRef speculativeModel As SemanticModel) As Boolean 1851Public Function TryGetSpeculativeSemanticModel(semanticModel As SemanticModel, position As Integer, statement As ExecutableStatementSyntax, <Out> ByRef speculativeModel As SemanticModel) As Boolean 1865Public Function TryGetSpeculativeSemanticModel(semanticModel As SemanticModel, position As Integer, initializer As EqualsValueSyntax, <Out> ByRef speculativeModel As SemanticModel) As Boolean 1879Public Function TryGetSpeculativeSemanticModel(semanticModel As SemanticModel, position As Integer, attribute As AttributeSyntax, <Out> ByRef speculativeModel As SemanticModel) As Boolean 1893Public Function TryGetSpeculativeSemanticModel(semanticModel As SemanticModel, position As Integer, type As TypeSyntax, <Out> ByRef speculativeModel As SemanticModel, Optional bindingOption As SpeculativeBindingOption = SpeculativeBindingOption.BindAsExpression) As Boolean
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (5)
Microsoft.NetCore.Analyzers\Performance\BasicPreferDictionaryTryMethodsOverContainsKeyGuardFixer.vb (1)
231Private Shared Function GetDictionaryValueType(semanticModel As SemanticModel, dictionary As SyntaxNode) As ITypeSymbol
Microsoft.NetCore.Analyzers\Performance\BasicUseStringMethodCharOverloadWithSingleCharacters.Fixer.vb (2)
18Protected Overrides Function TryGetChar(model As SemanticModel, argumentListNode As SyntaxNode, ByRef c As Char) As Boolean 66Protected Overrides Sub ApplyFix(editor As DocumentEditor, model As SemanticModel, oldArgumentListNode As SyntaxNode, c As Char)
Microsoft.NetCore.Analyzers\Runtime\BasicForwardCancellationTokenToInvocations.Fixer.vb (1)
22Protected Overrides Function TryGetInvocation(model As SemanticModel, node As SyntaxNode, ct As CancellationToken, <NotNullWhen(True)> ByRef invocation As IInvocationOperation) As Boolean
Microsoft.NetCore.Analyzers\Runtime\BasicPreferStreamAsyncMemoryOverloads.Fixer.vb (1)
43Protected Overrides Function IsPassingZeroAndBufferLength(model As SemanticModel, bufferValueNode As SyntaxNode, offsetValueNode As SyntaxNode, countValueNode As SyntaxNode) As Boolean
Microsoft.CodeAnalysis.Workspaces (404)
CaseCorrection\AbstractCaseCorrectionService.cs (3)
20protected abstract void AddReplacements(SemanticModel? semanticModel, SyntaxNode root, ImmutableArray<TextSpan> spans, ConcurrentDictionary<SyntaxToken, SyntaxToken> replacements, CancellationToken cancellationToken); 35var semanticModel = await document.ReuseExistingSpeculativeModelAsync(spans.Collapse(), cancellationToken).ConfigureAwait(false); 44private SyntaxNode CaseCorrect(SemanticModel? semanticModel, SyntaxNode root, ImmutableArray<TextSpan> spans, CancellationToken cancellationToken)
Classification\Classifier.cs (5)
32var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 48SemanticModel semanticModel, 60SemanticModel semanticModel, 72SemanticModel semanticModel, 114LanguageServices languageServices, SemanticModel semanticModel, TextSpan textSpan, ClassificationOptions options,
Classification\EmbeddedLanguageClassificationServiceExtensions.cs (1)
18SemanticModel semanticModel,
Classification\IEmbeddedLanguageClassificationService.cs (1)
26SemanticModel semanticModel,
Classification\SyntaxClassification\AbstractSyntaxClassificationService.cs (2)
37var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false); 48SemanticModel semanticModel,
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (3)
21private readonly SemanticModel _semanticModel; 35SemanticModel semanticModel, 57SemanticModel semanticModel,
Classification\SyntaxClassification\AbstractSyntaxClassifier.cs (2)
22public virtual void AddClassifications(SyntaxNode syntax, TextSpan textSpan, SemanticModel semanticModel, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 26public virtual void AddClassifications(SyntaxToken syntax, TextSpan textSpan, SemanticModel semanticModel, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken)
Classification\SyntaxClassification\ISyntaxClassificationService.cs (1)
45SemanticModel semanticModel,
Classification\SyntaxClassification\ISyntaxClassifier.cs (2)
29void AddClassifications(SyntaxNode node, TextSpan textSpan, SemanticModel semanticModel, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 34void AddClassifications(SyntaxToken token, TextSpan textSpan, SemanticModel semanticModel, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken);
Classification\SyntaxClassification\SyntaxClassificationExtensions.cs (1)
49SemanticModel semanticModel,
Editing\DocumentEditor.cs (4)
18private DocumentEditor(Document document, SemanticModel model, SyntaxNode root) 35var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 46/// The <see cref="CodeAnalysis.SemanticModel"/> of the original document. 48public SemanticModel SemanticModel { get; }
Editing\SymbolEditor.cs (2)
295var model = await newDoc.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 483var model = await doc.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Editing\SymbolEditorExtensions.cs (1)
41var model = await doc.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ExternalAccess\Pythia\Api\PythiaDocumentExtensions.cs (1)
13public static Task<SemanticModel> GetSemanticModelForNodeAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken)
ExternalAccess\Pythia\Api\PythiaSemanticModelExtensions.cs (1)
12public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
ExternalAccess\Pythia\Api\PythiaTypeInferenceServiceWrapper.cs (1)
22public ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, int position, string? name, CancellationToken cancellationToken)
FindSymbols\FindReferences\DependentTypeFinder.cs (5)
198var cachedModels = new ConcurrentSet<SemanticModel>(); 243async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(DocumentId documentId) 246var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 262var semanticModel = await GetRequiredSemanticModelAsync(documentId).ConfigureAwait(false); 282var semanticModel = await GetRequiredSemanticModelAsync(documentId).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\AbstractMethodOrPropertyOrEventSymbolReferenceFinder.cs (1)
19var semanticModel = state.SemanticModel;
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (2)
488var semanticModel = state.SemanticModel; 613var semanticModel = state.SemanticModel;
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (2)
67var semanticModel = state.SemanticModel; 155SemanticModel semanticModel,
FindSymbols\FindReferences\Finders\ExplicitConstructorInitializerSymbolReferenceFinder.cs (1)
85var semanticModel = state.SemanticModel;
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (3)
106var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 130SemanticModel semanticModel, 169private static SyntaxNode? GetContainer(SemanticModel semanticModel, SyntaxNode parameterNode, ISyntaxFactsService syntaxFactsService)
FindSymbols\FindReferences\FindReferenceCache.cs (6)
39var model = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false); 40var nullableEnableSemanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 53public readonly SemanticModel SemanticModel; 63private readonly SemanticModel _nullableEnabledSemanticModel; 75Document document, SourceText text, SemanticModel semanticModel, SemanticModel nullableEnabledSemanticModel, SyntaxNode root, SyntaxTreeIndex syntaxTreeIndex)
FindSymbols\FindReferences\FindReferencesDocumentState.cs (1)
26public SemanticModel SemanticModel => this.Cache.SemanticModel;
FindSymbols\ReferenceLocationExtensions.cs (3)
36var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 49SemanticModel semanticModel, 75SemanticModel semanticModel,
FindSymbols\SymbolFinder.cs (9)
23/// Obsolete. Use <see cref="FindSymbolAtPositionAsync(SemanticModel, int, Workspace, CancellationToken)"/>. 27SemanticModel semanticModel, 43SemanticModel semanticModel, 61SemanticModel semanticModel, 77SemanticModel semanticModel, 94SemanticModel semanticModel, 111SemanticModel semanticModel, 131var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 218var semanticModel = await linkedDocument.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
FindSymbols\TopLevelSyntaxTree\DeclaredSymbolInfo.cs (1)
223public ISymbol? TryResolve(SemanticModel semanticModel, CancellationToken cancellationToken)
ObsoleteSymbol\AbstractObsoleteSymbolService.cs (6)
25protected virtual void ProcessDimKeyword(ref ArrayBuilder<TextSpan>? result, SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 35var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false); 59void Recurse(TextSpan span, SemanticModel semanticModel) 109SyntaxToken ProcessNode(SemanticModel semanticModel, SyntaxNode node) 159void ProcessToken(SemanticModel semanticModel, SyntaxToken token) 171void ProcessIdentifier(SemanticModel semanticModel, SyntaxToken token)
ReassignedVariable\AbstractReassignedVariableService.cs (16)
50using var _3 = PooledDictionary<SyntaxTree, SemanticModel>.GetInstance(out var syntaxTreeToModel); 51var semanticModel = GetSemanticModel(root.SyntaxTree); 61void Recurse(TextSpan span, SemanticModel semanticModel) 90SemanticModel GetSemanticModel(SyntaxTree syntaxTree) 92if (!syntaxTreeToModel.TryGetValue(syntaxTree, out var model)) 103void ProcessNode(SemanticModel semanticModel, SyntaxNode node) 122void ProcessIdentifier(SemanticModel semanticModel, TIdentifierNameSyntax identifier) 134void ProcessParameter(SemanticModel semanticModel, TParameterSyntax parameterSyntax) 141void ProcessVariable(SemanticModel semanticModel, TVariableSyntax variable) 148void ProcessSingleVariableDesignation(SemanticModel semanticModel, TSingleVariableDesignationSyntax designation) 155bool IsSymbolReassigned(SemanticModel semanticModel, [NotNullWhen(true)] ISymbol? symbol) 176bool ComputeParameterIsAssigned(SemanticModel semanticModel, IParameterSymbol parameter) 200var otherSemanticModel = GetSemanticModel(group.Key); 240bool TryGetParameterLocation(SemanticModel semanticModel, IParameterSymbol parameter, out TextSpan location) 266bool ComputeLocalIsAssigned(SemanticModel semanticModel, ILocalSymbol local) 291SemanticModel semanticModel,
Recommendations\AbstractRecommendationService.cs (1)
27var semanticModel = syntaxContext.SemanticModel;
Recommendations\AbstractRecommendationServiceRunner.cs (2)
277var semanticModel = _context.SemanticModel; 289var semanticModel = _context.SemanticModel;
Recommendations\Recommender.cs (3)
20SemanticModel semanticModel, 36SemanticModel semanticModel, 51var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Rename\ConflictEngine\ConflictResolver.cs (2)
123private static ImmutableArray<ISymbol> SymbolsForEnclosingInvocationExpressionWorker(SyntaxNode invocationExpression, SemanticModel semanticModel, CancellationToken cancellationToken) 172SemanticModel semanticModel,
Rename\ConflictEngine\ConflictResolver.Session.cs (4)
215var semanticModel = await declarationDocument.GetRequiredSemanticModelAsync(_cancellationToken).ConfigureAwait(false); 359SemanticModel? newDocumentSemanticModel = null; 631private ImmutableArray<ISymbol> GetSymbolsInNewSolution(Document newDocument, SemanticModel newDocumentSemanticModel, RenameActionAnnotation conflictAnnotation, SyntaxNodeOrToken tokenOrNode) 776var semanticModel = await document.GetRequiredSemanticModelAsync(_cancellationToken).ConfigureAwait(false);
Rename\IRenameRewriterLanguageService.cs (2)
87SemanticModel semanticModel, 126public abstract ImmutableArray<Location> ComputePossibleImplicitUsageConflicts(ISymbol renamedSymbol, SemanticModel semanticModel, Location originalDeclarationLocation, int newDeclarationLocationStartingPosition, CancellationToken cancellationToken);
Rename\Renamer.RenameSymbolDocumentAction.cs (2)
50var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 106var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Rename\RenameRewriterParameters.cs (2)
16SemanticModel semanticModel, 50internal readonly SemanticModel SemanticModel = semanticModel;
Rename\RenameUtilities.cs (2)
83int position, SemanticModel semanticModel, SolutionServices services, CancellationToken cancellationToken) 185SemanticModel semanticModel,
Shared\Extensions\SemanticModelExtensions.cs (2)
19public static SemanticMap GetSemanticMap(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 71this SemanticModel semanticModel,
Shared\Utilities\SemanticMap.cs (1)
23internal static SemanticMap From(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
Shared\Utilities\SemanticMap.Walker.cs (1)
12private sealed class Walker(SemanticModel semanticModel, SemanticMap map, CancellationToken cancellationToken)
Simplification\Simplifier.cs (6)
74var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 81public static TNode Expand<TNode>(TNode node, SemanticModel semanticModel, Workspace workspace, Func<SyntaxNode, bool>? expandInsideNode = null, bool expandParameter = false, CancellationToken cancellationToken = default) where TNode : SyntaxNode 92internal static TNode Expand<TNode>(TNode node, SemanticModel semanticModel, SolutionServices services, Func<SyntaxNode, bool>? expandInsideNode = null, bool expandParameter = false, CancellationToken cancellationToken = default) where TNode : SyntaxNode 119var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 126public static SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Workspace workspace, Func<SyntaxNode, bool>? expandInsideNode = null, CancellationToken cancellationToken = default) 137internal static SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, SolutionServices services, Func<SyntaxNode, bool>? expandInsideNode = null, CancellationToken cancellationToken = default)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
22/// <see cref="SemanticModel"/> is needed, use <see cref="SemanticSpanAnalysis"/> or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
23SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (7)
14public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 18SemanticModel semanticModel1, 19SemanticModel semanticModel2, 48SemanticModel semanticModel1, 49SemanticModel semanticModel2, 129SemanticModel semanticModel1, 130SemanticModel semanticModel2,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
33public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 36public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 39public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 42public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 45public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 54public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66public static TSymbol? GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 88public static INamedTypeSymbol? GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 91public static INamespaceSymbol? GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 94public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel) 108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 137public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 168private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 219this SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
66SemanticModel? semanticModel, 68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (3)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 23public ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken) 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
15ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken); 18SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (25)
51bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 58bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 59bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 72bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 77ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken); 79ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 80SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 82IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 84ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 92IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 93IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 100bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 107bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 109string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 120IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (3)
17SemanticModel semanticModel) 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
386bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
44var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
53var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
87TryGetSemanticModel(compilation, syntaxTree, out var semanticModel)) 116[NotNullWhen(true)] out SemanticModel? semanticModel) 185TryGetSemanticModel(reader.Compilation, firstSourceTree, out var semanticModel)) 255SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
50private SemanticModel? _lazySpeculativeSemanticModel; 75SemanticModel semanticModel, 96protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 102protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 103protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType); 104protected abstract bool ConversionsAreCompatible(SemanticModel model1, TExpressionSyntax expression1, SemanticModel model2, TExpressionSyntax expression2); 109protected abstract bool IsForEachTypeInferred(TForEachStatementSyntax forEachStatement, SemanticModel semanticModel); 110protected abstract bool ForEachConversionsAreCompatible(SemanticModel originalModel, TForEachStatementSyntax originalForEach, SemanticModel newModel, TForEachStatementSyntax newForEach); 112SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType, out ImmutableArray<ILocalSymbol> localVariables); 155public SemanticModel OriginalSemanticModel { get; } 190public SemanticModel SpeculativeSemanticModel 224protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 977SemanticModel speculativeSemanticModel) 1031private bool IsReceiverNonUniquePossibleValueTypeParam(TExpressionSyntax invocation, SemanticModel semanticModel) 1049private static bool IsReceiverUniqueInstance(TExpressionSyntax receiver, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
26SemanticModel semanticModel, 47public static void AddAliasSymbols(SemanticModel semanticModel, int namespaceId, IEnumerable<IAliasSymbol> aliasSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (4)
11/// <see cref="SemanticModel.SyntaxTree"/> that <see cref="OriginalSemanticModel"/> points at. 17/// cref="SemanticModel.SyntaxTree"/> that <see cref="SpeculativeSemanticModel"/> points at. 24SemanticModel OriginalSemanticModel { get; } 30SemanticModel SpeculativeSemanticModel { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
199public string ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null) 202public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (2)
65public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 68public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
73protected abstract INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model); 78SemanticModel model, 94SemanticModel model, 121var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 185var model = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false); 259private static bool IsInsideNamespace(SyntaxNode node, INamespaceSymbol symbol, SemanticModel model, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
12SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14SemanticModel semanticModel, 48public SemanticModel SemanticModel { get; } = semanticModel;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (8)
33public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 35if (document.TryGetSemanticModel(out var semanticModel)) 44public static async ValueTask<SemanticModel> GetRequiredNullableDisabledSemanticModelAsync(this Document document, CancellationToken cancellationToken) 46if (document.TryGetNullableDisabledSemanticModel(out var semanticModel)) 111public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 128public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 153public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 178var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeInferenceServiceExtensions.cs (11)
15public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 18public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 21public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 24public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 29SemanticModel semanticModel, 39SemanticModel semanticModel, 47private static INamedTypeSymbol? GetFirstDelegateType(SemanticModel semanticModel, ImmutableArray<ITypeSymbol> types) 55SemanticModel semanticModel, 67SemanticModel semanticModel, 85SemanticModel semanticModel, 97SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (13)
30Func<SemanticModel, TType, TNode, bool> canReplace, 31Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 53Func<SemanticModel, TType, TNode, bool> canReplace, 54Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 75Func<SemanticModel, TNode, bool> canReplace, 76Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 97Func<SemanticModel, TType, TNode, bool> canReplace, 98Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 119Func<SemanticModel, TNode, bool> canReplace, 120Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 155Func<SemanticModel, TType, TNode, bool> canReplace, 156Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 172var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (4)
338SemanticModel semanticModel, 389SemanticModel semanticModel, 451SemanticModel semanticModel, 461this SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, string identifierName)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
62SemanticModel semanticModel, 454SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (7)
37SemanticModel semanticModel, 47SemanticModel semanticModel, 58SemanticModel semanticModel, 140SemanticModel semanticModel, 232SemanticModel semanticModel, 258private static SyntaxNode GetNegationOfIsPatternExpression(SyntaxNode isExpression, SyntaxGenerator generator, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, CancellationToken cancellationToken) 471SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
38SemanticModel semanticModel, 119var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 208var semanticModel = compilation.GetSemanticModel(group.Key);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
82var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
27var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 34var currentModel = await current.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (31)
39SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 47SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 55SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 63SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 71SemanticModel semanticModel, 95protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, CancellationToken cancellationToken) 179public bool IsWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 182public bool IsOnlyWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 185public bool IsInOutContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 188public bool IsInRefContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 191public bool IsInInContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 194public bool CanReplaceWithRValue(SemanticModel semanticModel, SyntaxNode? expression, CancellationToken cancellationToken) 197public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 203public bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel) 206public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken) 209public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement) 212public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 215public IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 218public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 221public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 227public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 230public IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 233public IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 236public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 239public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 242public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 245public bool IsInsideNameOfExpression(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 251public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, INamedTypeSymbol? expressionTypeOpt, CancellationToken cancellationToken) 254public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 257public IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (17)
15bool IsExpressionContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 16bool IsStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 17bool IsTypeContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 18bool IsNamespaceContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 19bool IsNamespaceDeclarationNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 20bool IsTypeDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 21bool IsMemberDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 22bool IsGlobalStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 23bool IsLabelContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 24bool IsAttributeNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 27SemanticModel semanticModel, SyntaxNode location, 31SemanticModel semanticModel, SyntaxNode location, 34SyntaxToken GenerateUniqueName(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, string baseName, 38SemanticModel semanticModel, SyntaxNode location, 42SemanticModel semanticModel, SyntaxNode location, 47CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination); 49IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
18protected readonly SemanticModel SemanticModel; 26protected AbstractTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (8)
13protected abstract AbstractTypeInferrer CreateTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken); 16SemanticModel semanticModel, ImmutableArray<ITypeSymbol> result, string? nameOpt) 27SemanticModel semanticModel, ImmutableArray<TypeInferenceInfo> result, string? nameOpt) 42SemanticModel semanticModel, string name) 80SemanticModel semanticModel, int position, 91SemanticModel semanticModel, SyntaxNode expression, 102SemanticModel semanticModel, int position, 110SemanticModel semanticModel, SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\ITypeInferenceService.cs (4)
27ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken); 28ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 30ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 31ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (4)
34protected abstract SemanticModel? TryGetSpeculativeSemanticModelWorker(SemanticModel previousSemanticModel, SyntaxNode previousBodyNode, SyntaxNode currentBodyNode); 49public async Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseLanguageService.cs (2)
36Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseWorkspaceService.cs (1)
21ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (10)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 20public readonly SemanticModel PreviousNonSpeculativeSemanticModel = previousNonSpeculativeSemanticModel; 23/// The current semantic model we retrieved <see cref="SemanticModel"/> for the <see cref="BodyNode"/>. Could 26public readonly SemanticModel CurrentSemanticModel = currentSemanticModel; 34/// The top level version of the project when we retrieved <see cref="SemanticModel"/>. As long as this is the 94public async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 131var semanticModel = info.CurrentSemanticModel; 157var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 202var semanticModel = await reuseService.TryGetSpeculativeSemanticModelAsync(reuseInfo.PreviousNonSpeculativeSemanticModel, bodyNode, cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractReducer.IExpressionRewriter.cs (1)
16SyntaxNodeOrToken VisitNodeOrToken(SyntaxNodeOrToken nodeOrTokenToReduce, SemanticModel semanticModel, bool simplifyAllDescendants);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (9)
41protected abstract SemanticModel GetSpeculativeSemanticModel(ref SyntaxNode nodeToSpeculate, SemanticModel originalSemanticModel, SyntaxNode originalNode); 51public abstract SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken); 52public abstract SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken); 69var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 165var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 191var semanticModelForReduce = semanticModel; 291var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
18SemanticModel semanticModel, 26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (2)
63public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 99public static bool IsNamespaceOrTypeOrThisParameter(SyntaxNode expression, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (2)
24SemanticModel semanticModel, TMemberAccessExpressionSyntax memberAccessExpression, CancellationToken cancellationToken); 34SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractSimplifier.cs (1)
18SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (2)
25SemanticModel semanticModel, 53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 16public readonly SemanticModel SemanticModel = semanticModel; 22var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Workspace\Solution\Document.cs (21)
30/// A cached reference to the <see cref="SemanticModel"/>. 32private WeakReference<SemanticModel>? _model; 35/// A cached reference to the <see cref="SemanticModel"/>. 37private WeakReference<SemanticModel>? _nullableDisabledModel; 258public bool TryGetSemanticModel([NotNullWhen(returnValue: true)] out SemanticModel? semanticModel) 269internal bool TryGetNullableDisabledSemanticModel([NotNullWhen(returnValue: true)] out SemanticModel? semanticModel) 279/// The returned <see cref="SemanticModel"/> may be <see langword="null"/> if <see 284internal async Task<SemanticModel?> GetSemanticModelAsync(SemanticModelOptions options, CancellationToken cancellationToken = default) 294internal async ValueTask<SemanticModel> GetRequiredNullableDisabledSemanticModelAsync(CancellationToken cancellationToken) 296if (this.TryGetNullableDisabledSemanticModel(out var semanticModel)) 309/// The returned <see cref="SemanticModel"/> may be <see langword="null"/> if <see 313public Task<SemanticModel?> GetSemanticModelAsync(CancellationToken cancellationToken = default) 322/// The returned <see cref="SemanticModel"/> may be <see langword="null"/> if <see 326private async Task<SemanticModel?> GetSemanticModelHelperAsync(bool disableNullableAnalysis, CancellationToken cancellationToken) 331var semanticModel = await GetSemanticModelWorkerAsync().ConfigureAwait(false); 335async Task<SemanticModel> GetSemanticModelWorkerAsync() 341if (this.TryGetNullableDisabledSemanticModel(out var semanticModel)) 346if (this.TryGetSemanticModel(out var semanticModel)) 354var result = compilation.GetSemanticModel(syntaxTree, disableNullableAnalysis ? SemanticModelOptions.DisableNullableAnalysis : SemanticModelOptions.None); 357var original = Interlocked.CompareExchange(ref disableNullableAnalysis ? ref _nullableDisabledModel : ref _model, new WeakReference<SemanticModel>(result), null); 367if (original.TryGetTarget(out var semanticModel))
Workspace\Solution\Solution_SemanticModelCaching.cs (2)
20private ImmutableArray<(DocumentId documentId, SemanticModel semanticModel)> _activeSemanticModels = []; 23DocumentId documentId, SemanticModel semanticModel)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
NetCoreTests.cs (6)
94var semanticModel = await document.GetSemanticModelAsync(); 163var semanticModel = await document.GetSemanticModelAsync(); 203var semanticModel = await document.GetSemanticModelAsync(); 263var semanticModel = await document.GetSemanticModelAsync(); 387var semanticModel = await document.GetSemanticModelAsync(); 552var semanticModel = await document.GetSemanticModelAsync();
Microsoft.CodeAnalysis.Workspaces.UnitTests (81)
CodeCleanup\CodeCleanupTests.cs (2)
310var semanticModel = await document.GetSemanticModelAsync(); 313var newSemanticModel = await document.ReuseExistingSpeculativeModelAsync(accessor.Statements[0], CancellationToken.None);
FindReferencesTests.cs (3)
187var semanticModel = comp.GetSemanticModel(tree); 228var semanticModel = comp.GetSemanticModel(tree); 294var semanticModel = comp.GetSemanticModel(tree);
SemanticModelReuse\SemanticModelReuseTests.cs (51)
42var model = await document.ReuseExistingSpeculativeModelAsync(null, CancellationToken.None); 54var model1 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 55var model2 = await document.ReuseExistingSpeculativeModelAsync(null, CancellationToken.None); 68var model1 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 69var model2 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 77var actualModel = await document.GetSemanticModelAsync(); 88var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 94var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 105var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 111var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 117var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 128var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 134var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 140var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 151var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 157var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 163var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 174var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 180var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 186var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 197var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 203var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 209var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 221var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 227var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 248var model1 = await document1.ReuseExistingSpeculativeModelAsync(source1.IndexOf("return"), CancellationToken.None); 254var model2 = await document2.ReuseExistingSpeculativeModelAsync(source2.IndexOf("{ return"), CancellationToken.None); 271var model = await document.ReuseExistingSpeculativeModelAsync(null, CancellationToken.None); 289var model1 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 290var model2 = await document.ReuseExistingSpeculativeModelAsync(null, CancellationToken.None); 309var model1 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 310var model2 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 318var actualModel = await document.GetSemanticModelAsync(); 335var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 347var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 364var model1 = await document1.ReuseExistingSpeculativeModelAsync(source1.IndexOf("return"), CancellationToken.None); 377var model2 = await document2.ReuseExistingSpeculativeModelAsync(source2.IndexOf("return"), CancellationToken.None); 389var model3 = await document3.ReuseExistingSpeculativeModelAsync(source2.IndexOf("return"), CancellationToken.None); 406var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 418var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 430var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 449var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 463var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 477var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 496var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 510var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 524var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 542var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 554var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 575var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 588var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
Simplifier\SimplifierTests.cs (2)
36var semanticModel = await GetDocument().GetRequiredSemanticModelAsync(CancellationToken.None); 47var semanticModel = await GetDocument().GetRequiredSemanticModelAsync(CancellationToken.None);
SolutionTests\SolutionTests.cs (2)
2612var semantics = await document.GetSemanticModelAsync(); 3531var docModel = doc.GetSemanticModelAsync().Result;
SymbolKeyTests.cs (21)
605var model = compilation.GetSemanticModel(tree); 641var model = compilation.GetSemanticModel(tree); 663var model = compilation.GetSemanticModel(tree); 688var model = compilation.GetSemanticModel(tree); 706var model = compilation.GetSemanticModel(tree); 724var model = compilation.GetSemanticModel(tree); 745var model = compilation.GetSemanticModel(tree); 769var model = compilation.GetSemanticModel(tree); 812var model = compilation.GetSemanticModel(tree); 826var model = compilation.GetSemanticModel(tree); 855var firstModel = await document.GetSemanticModelAsync(); 858var firstReusedModel = await document.ReuseExistingSpeculativeModelAsync(position, CancellationToken.None); 868var testModel = await document.ReuseExistingSpeculativeModelAsync(position, CancellationToken.None); 902var firstModel = await document.GetSemanticModelAsync(); 905var firstReusedModel = await document.ReuseExistingSpeculativeModelAsync(position, CancellationToken.None); 915var testModel = await document.ReuseExistingSpeculativeModelAsync(position, CancellationToken.None); 1276var semanticModel = compilation1.GetSemanticModel(tree); 1493SemanticModel model, Func<SyntaxNode, bool> predicate = null) 1501SemanticModel model, SyntaxNode node, 1560var semanticModel = compilation.GetSemanticModel(node.SyntaxTree); 1568private static void GetInteriorSymbols(SemanticModel model, SyntaxNode root, List<ISymbol> symbols)
Microsoft.DotNet.ApiDiff (15)
MemoryOutputDiffGenerator.cs (15)
119(SyntaxNode beforeAssemblyNode, SemanticModel beforeModel) = await GetAssemblyRootNodeAndModelAsync(_beforeLoader, beforeAssemblySymbol).ConfigureAwait(false); 153private async Task<string> ProcessAfterAssemblyAsync(IAssemblySymbol afterAssemblySymbol, SyntaxNode? beforeParentNode = null, SemanticModel? beforeModel = null) 157(SyntaxNode afterAssemblyNode, SemanticModel afterModel) = await GetAssemblyRootNodeAndModelAsync(_afterLoader, afterAssemblySymbol).ConfigureAwait(false); 173private async Task<(SyntaxNode rootNode, SemanticModel model)> GetAssemblyRootNodeAndModelAsync(IAssemblySymbolLoader loader, IAssemblySymbol assemblySymbol) 197SemanticModel model = await document.GetSemanticModelAsync().ConfigureAwait(false) ?? throw new InvalidOperationException($"Semantic model could not be found for document of assembly '{assemblySymbol.Name}'."); 214private string? VisitChildren(SyntaxNode? beforeParentNode, SyntaxNode? afterParentNode, SemanticModel? beforeModel, SemanticModel? afterModel, ChangeType parentChangeType, bool wereParentAttributesChanged) 307private ConcurrentDictionary<string, MemberDeclarationSyntax> CollectChildrenNodes(SyntaxNode? parentNode, SemanticModel? model) 367private string? VisitLeafNode(MemberDeclarationSyntax? beforeNode, MemberDeclarationSyntax? afterNode, SemanticModel? beforeModel, SemanticModel? afterModel, ChangeType changeType) 452private string? VisitAttributes(MemberDeclarationSyntax? beforeNode, MemberDeclarationSyntax? afterNode, SemanticModel? beforeModel, SemanticModel? afterModel) 501private Dictionary<string, AttributeSyntax> CollectAttributeNodes(MemberDeclarationSyntax? memberNode, SemanticModel? model) 658private string GetAttributeDocId(IMethodSymbol attributeConstructorSymbol, AttributeSyntax attribute, SemanticModel model) 688private string GetDocId(SyntaxNode node, SemanticModel model)
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\AppContextDefaultsAnalyzer.cs (1)
106private bool IsCallToDefineSwitchDefault(InvocationExpressionSyntax call, SemanticModel model)
Microsoft.Extensions.Logging.Generators (5)
LoggerMessageGenerator.Parser.cs (2)
78SemanticModel sm = _compilation.GetSemanticModel(syntaxTree); 627private (string? loggerField, bool multipleLoggerFields) FindLoggerField(SemanticModel sm, TypeDeclarationSyntax classDec, ITypeSymbol loggerSymbol)
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithMetadataName.cs (3)
34public SemanticModel SemanticModel { get; } 49SemanticModel semanticModel, 129var semanticModel = compilation.GetSemanticModel(syntaxTree);
Microsoft.Extensions.Options.SourceGeneration (5)
Generator.cs (3)
20IncrementalValuesProvider<(TypeDeclarationSyntax? TypeSyntax, SemanticModel SemanticModel)> typeDeclarations = context.SyntaxProvider 27IncrementalValueProvider<(Compilation, ImmutableArray<(TypeDeclarationSyntax? TypeSyntax, SemanticModel SemanticModel)>)> compilationAndTypes = 33private static void HandleAnnotatedTypes(Compilation compilation, ImmutableArray<(TypeDeclarationSyntax? TypeSyntax, SemanticModel SemanticModel)> types, SourceProductionContext context)
Parser.cs (2)
46public IReadOnlyList<ValidatorType> GetValidatorTypes(IEnumerable<(TypeDeclarationSyntax TypeSyntax, SemanticModel SemanticModel)> classes) 52SemanticModel? sm = null;
Microsoft.Extensions.Validation.ValidationsGenerator (6)
Parsers\ValidationsGenerator.AddValidation.cs (1)
28var semanticModel = context.SemanticModel;
src\Http\Http.Extensions\gen\Microsoft.AspNetCore.Http.RequestDelegateGenerator\StaticRouteHandlerModel\InvocationOperationExtensions.cs (4)
42public static bool TryGetRouteHandlerMethod(this IInvocationOperation invocation, SemanticModel semanticModel, [NotNullWhen(true)] out IMethodSymbol? method) 83private static IMethodSymbol? ResolveMethodFromOperation(IOperation operation, SemanticModel semanticModel) => operation switch 97private static IOperation? ResolveDeclarationOperation(ISymbol symbol, SemanticModel? semanticModel) 112var targetSemanticModel = semanticModel?.Compilation.GetSemanticModel(expr.SyntaxTree);
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
198public static bool IsType(this INamedTypeSymbol type, string typeName, SemanticModel semanticModel)
Microsoft.Gen.ComplianceReports (2)
Parser.cs (2)
38SemanticModel? sm = null; 105SemanticModel sm)
Microsoft.Gen.Logging (3)
Parsing\Parser.cs (3)
54SemanticModel? sm = _compilation.GetSemanticModel(syntaxTree); 603private Location? GetLoggerMessageAttribute(MethodDeclarationSyntax methodSyntax, SemanticModel sm, SymbolHolder symbols) 620private (string? member, ISymbol? secondMember, bool isNullable) FindLoggerMember(SemanticModel sm, TypeDeclarationSyntax classDec, ITypeSymbol loggerSymbol)
Microsoft.Gen.MetadataExtractor (6)
src\Generators\Microsoft.Gen.ComplianceReports\Parser.cs (2)
38SemanticModel? sm = null; 105SemanticModel sm)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (4)
70SemanticModel? semanticModel = null; 278SemanticModel semanticModel) 368SemanticModel semanticModel, 398SemanticModel semanticModel)
Microsoft.Gen.Metrics (4)
Parser.cs (4)
70SemanticModel? semanticModel = null; 278SemanticModel semanticModel) 368SemanticModel semanticModel, 398SemanticModel semanticModel)
Microsoft.Gen.MetricsReports (4)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (4)
70SemanticModel? semanticModel = null; 278SemanticModel semanticModel) 368SemanticModel semanticModel, 398SemanticModel semanticModel)
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\CustomMarshallerAttributeFixer.cs (2)
37SemanticModel model = await doc.GetSemanticModelAsync(fixAllContext.CancellationToken).ConfigureAwait(false); 156var model = await doc.GetSemanticModelAsync(ct).ConfigureAwait(false);
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (1)
35SemanticModel model = context.GetSemanticModel(diagnostic.Location.SourceTree);
Microsoft.Maui.Controls.BindingSourceGen (3)
BindingSourceGenerator.cs (3)
189 private static Result<ITypeSymbol> GetLambdaReturnType(LambdaExpressionSyntax lambda, SemanticModel semanticModel, CancellationToken t) 205 private static Result<ITypeSymbol> GetLambdaParameterType(LambdaExpressionSyntax lambda, SemanticModel semanticModel, CancellationToken t) 227 private static SetterOptions DeriveSetterOptions(ExpressionSyntax? lambdaBodyExpression, SemanticModel semanticModel, bool enabledNullable)
Microsoft.ML.InternalCodeAnalyzer (4)
BestFriendAnalyzer.cs (1)
50var model = context.SemanticModel;
ContractsCheckNameofFixProvider.cs (1)
133var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken);
NameFixProvider.cs (1)
106var semanticModel = await document.GetSemanticModelAsync(cancellationToken);
RelaxTestNamingSuppressor.cs (1)
44var semanticModel = context.GetSemanticModel(tree);
Microsoft.VisualStudio.LanguageServices (7)
Library\ClassView\AbstractSyncClassViewCommandHandler.cs (1)
62var semanticModel = await document.GetSemanticModelAsync(userCancellationToken).ConfigureAwait(true);
Snippets\SnippetExpansionClient.cs (2)
763var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 897var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(true);
Venus\ContainedLanguageCodeSupport.cs (4)
62var semanticModel = document.GetSemanticModelAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken); 296var semanticModel = document.GetSemanticModelAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken); 423var semanticModel = document.GetSemanticModelAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken); 481var semanticModel = document.GetSemanticModelAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken);
Microsoft.VisualStudio.LanguageServices.CSharp (15)
CodeModel\CSharpCodeModelService.cs (10)
954public override string GetFullName(SyntaxNode node, SemanticModel semanticModel) 969public override string GetFullyQualifiedName(string name, int position, SemanticModel semanticModel) 2893public override string GetMethodXml(SyntaxNode node, SemanticModel semanticModel) 3013protected override ITypeSymbol? GetTypeSymbolFromPartialName(string partialName, SemanticModel semanticModel, int position) 3050var semanticModel = compilation.GetSemanticModel(tree); 3689private static TypeDeclarationSyntax InsertIntoBaseList(TypeDeclarationSyntax typeDeclaration, ITypeSymbol typeSymbol, SemanticModel semanticModel, int insertionIndex) 3721public override SyntaxNode AddBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position) 3754public override SyntaxNode RemoveBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel) 3814public override SyntaxNode AddImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position) 3849public override SyntaxNode RemoveImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel)
CodeModel\MethodXml\MethodXmlBuilder.cs (2)
17private MethodXmlBuilder(IMethodSymbol symbol, SemanticModel semanticModel) 604public static string Generate(MethodDeclarationSyntax methodDeclaration, SemanticModel semanticModel)
LanguageService\CSharpHelpContextService.cs (3)
50var semanticModel = await document.ReuseExistingSpeculativeModelAsync(span, cancellationToken).ConfigureAwait(false); 91private string? TryGetText(SyntaxToken token, SemanticModel semanticModel, Document document, CancellationToken cancellationToken) 153SyntaxToken token, SemanticModel semanticModel, Document document, CancellationToken cancellationToken,
Microsoft.VisualStudio.LanguageServices.Implementation (46)
CodeModel\AbstractCodeModelService.cs (11)
486public abstract string GetFullName(SyntaxNode node, SemanticModel semanticModel); 488public abstract string GetFullyQualifiedName(string name, int position, SemanticModel semanticModel); 735public abstract string GetMethodXml(SyntaxNode node, SemanticModel semanticModel); 805protected abstract ITypeSymbol? GetTypeSymbolFromPartialName(string partialName, SemanticModel semanticModel, int position); 808public ITypeSymbol GetTypeSymbol(object type, SemanticModel semanticModel, int position) 1256public virtual IList<string> GetHandledEventNames(SyntaxNode method, SemanticModel semanticModel) 1263public virtual bool HandlesEvent(string eventName, SyntaxNode method, SemanticModel semanticModel) 1294public abstract SyntaxNode AddBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position); 1295public abstract SyntaxNode RemoveBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel); 1298public abstract SyntaxNode AddImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position); 1299public abstract SyntaxNode RemoveImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel);
CodeModel\Collections\BasesCollection.cs (2)
65var semanticModel = FileCodeModel.GetSemanticModel(); 109var semanticModel = FileCodeModel.GetSemanticModel();
CodeModel\FileCodeModel.cs (1)
435internal SemanticModel GetSemanticModel()
CodeModel\FileCodeModel_CodeGen.cs (13)
192var semanticModel = GetSemanticModel(); 226var semanticModel = GetSemanticModel(); 260var semanticModel = GetSemanticModel(); 285var semanticModel = GetSemanticModel(); 309var semanticModel = GetSemanticModel(); 345var semanticModel = GetSemanticModel(); 391var semanticModel = GetSemanticModel(); 415var semanticModel = GetSemanticModel(); 441var semanticModel = GetSemanticModel(); 696var semanticModel = GetSemanticModel(); 719var semanticModel = GetSemanticModel(); 732var semanticModel = GetSemanticModel(); 757var semanticModel = GetSemanticModel();
CodeModel\ICodeModelService.cs (10)
119string GetFullName(SyntaxNode node, SemanticModel semanticModel); 124string GetFullyQualifiedName(string name, int position, SemanticModel semanticModel); 266string GetMethodXml(SyntaxNode node, SemanticModel semanticModel); 286ITypeSymbol GetTypeSymbol(object type, SemanticModel semanticModel, int position); 354IList<string> GetHandledEventNames(SyntaxNode method, SemanticModel semanticModel); 355bool HandlesEvent(string eventName, SyntaxNode method, SemanticModel semanticModel); 369SyntaxNode AddBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position); 370SyntaxNode RemoveBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel); 373SyntaxNode AddImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position); 374SyntaxNode RemoveImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel);
CodeModel\InternalElements\AbstractCodeElement.cs (3)
47protected SemanticModel GetSemanticModel() 83var semanticModel = GetSemanticModel(); 117var semanticModel = GetSemanticModel();
CodeModel\InternalElements\CodeFunctionWithEventHandler.cs (4)
61var semanticModel = GetSemanticModel(); 74var semanticModel = GetSemanticModel(); 87var semanticModel = GetSemanticModel(); 97var semanticModel = GetSemanticModel();
CodeModel\MethodXml\AbstractMethodXmlBuilder.cs (2)
66protected readonly SemanticModel SemanticModel; 69protected AbstractMethodXmlBuilder(IMethodSymbol symbol, SemanticModel semanticModel)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Implementation\LanguageServer\Extensions\SymbolExtensions.cs (1)
48var semanticModel = await codeDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Roslyn.Diagnostics.Analyzers (292)
AbstractApplyTraitToClass`1.cs (2)
28SemanticModel SemanticModel, 48var semanticModel = (await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false))!;
AbstractCreateTestAccessor`1.cs (2)
36var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 60var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
AbstractExposeMemberForTesting`1.cs (2)
42var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 102var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
AbstractRunIterations`1.cs (1)
31var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
DefaultableTypeShouldHaveDefaultableFieldsAnalyzer.cs (1)
98var semanticModel = originalContext.Compilation.GetSemanticModel(field.Locations[0].SourceTree);
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (2)
82var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); 161var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (4)
88var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 120var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 141var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 206private static SyntaxNode GenerateDescriptionArgument(SyntaxGenerator generator, SemanticModel semanticModel)
NamedTypeFullNameNotNullSuppressor.cs (1)
48var semanticModel = context.GetSemanticModel(tree);
PartsExportedWithMEFv2MustBeMarkedAsShared.Fixer.cs (1)
34var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
RelaxTestNamingSuppressor.cs (1)
52var semanticModel = context.GetSemanticModel(tree);
SpecializedEnumerableCreationAnalyzer.cs (2)
132protected bool ShouldAnalyzeArrayCreationExpression(SyntaxNode expression, SemanticModel semanticModel, CancellationToken cancellationToken) 142protected void AnalyzeMemberAccessName(SyntaxNode name, SemanticModel semanticModel, Action<Diagnostic> addDiagnostic, CancellationToken cancellationToken)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (4)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 34internal SemanticModel GetSemanticModel(SyntaxNode node)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (3)
74var model = context.GetSemanticModel(declSyntax); 182SemanticModel model = context.GetSemanticModel(declSyntax); 243var model = context.GetSemanticModel(node);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
458var semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
57var model = compilation.GetSemanticModel(receiverSyntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (1)
472public static SyntaxNode FirstUnusedIdentifierName(this SyntaxGenerator generator, SemanticModel semanticModel, int position, string baseName, int maxTries = int.MaxValue)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
22/// <see cref="SemanticModel"/> is needed, use <see cref="SemanticSpanAnalysis"/> or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
23SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (7)
14public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 18SemanticModel semanticModel1, 19SemanticModel semanticModel2, 48SemanticModel semanticModel1, 49SemanticModel semanticModel2, 129SemanticModel semanticModel1, 130SemanticModel semanticModel2,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
33public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 36public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 39public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 42public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 45public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 54public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66public static TSymbol? GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 88public static INamedTypeSymbol? GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 91public static INamespaceSymbol? GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 94public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel) 108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 137public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 168private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 219this SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
66SemanticModel? semanticModel, 68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (3)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 23public ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken) 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
15ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken); 18SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (25)
51bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 58bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 59bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 72bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 77ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken); 79ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 80SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 82IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 84ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 92IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 93IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 100bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 107bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 109string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 120IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (3)
17SemanticModel semanticModel) 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
386bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
44var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
53var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
87TryGetSemanticModel(compilation, syntaxTree, out var semanticModel)) 116[NotNullWhen(true)] out SemanticModel? semanticModel) 185TryGetSemanticModel(reader.Compilation, firstSourceTree, out var semanticModel)) 255SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
50private SemanticModel? _lazySpeculativeSemanticModel; 75SemanticModel semanticModel, 96protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 102protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 103protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType); 104protected abstract bool ConversionsAreCompatible(SemanticModel model1, TExpressionSyntax expression1, SemanticModel model2, TExpressionSyntax expression2); 109protected abstract bool IsForEachTypeInferred(TForEachStatementSyntax forEachStatement, SemanticModel semanticModel); 110protected abstract bool ForEachConversionsAreCompatible(SemanticModel originalModel, TForEachStatementSyntax originalForEach, SemanticModel newModel, TForEachStatementSyntax newForEach); 112SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType, out ImmutableArray<ILocalSymbol> localVariables); 155public SemanticModel OriginalSemanticModel { get; } 190public SemanticModel SpeculativeSemanticModel 224protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 977SemanticModel speculativeSemanticModel) 1031private bool IsReceiverNonUniquePossibleValueTypeParam(TExpressionSyntax invocation, SemanticModel semanticModel) 1049private static bool IsReceiverUniqueInstance(TExpressionSyntax receiver, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
26SemanticModel semanticModel, 47public static void AddAliasSymbols(SemanticModel semanticModel, int namespaceId, IEnumerable<IAliasSymbol> aliasSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (4)
11/// <see cref="SemanticModel.SyntaxTree"/> that <see cref="OriginalSemanticModel"/> points at. 17/// cref="SemanticModel.SyntaxTree"/> that <see cref="SpeculativeSemanticModel"/> points at. 24SemanticModel OriginalSemanticModel { get; } 30SemanticModel SpeculativeSemanticModel { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
199public string ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null) 202public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (2)
65public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 68public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
73protected abstract INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model); 78SemanticModel model, 94SemanticModel model, 121var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 183var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 259private static bool IsInsideNamespace(SyntaxNode node, INamespaceSymbol symbol, SemanticModel model, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
12SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14SemanticModel semanticModel, 48public SemanticModel SemanticModel { get; } = semanticModel;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (6)
33public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 35if (document.TryGetSemanticModel(out var semanticModel)) 111public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 128public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 153public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 178var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeInferenceServiceExtensions.cs (11)
15public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 18public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 21public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 24public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 29SemanticModel semanticModel, 39SemanticModel semanticModel, 47private static INamedTypeSymbol? GetFirstDelegateType(SemanticModel semanticModel, ImmutableArray<ITypeSymbol> types) 55SemanticModel semanticModel, 67SemanticModel semanticModel, 85SemanticModel semanticModel, 97SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (13)
30Func<SemanticModel, TType, TNode, bool> canReplace, 31Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 53Func<SemanticModel, TType, TNode, bool> canReplace, 54Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 75Func<SemanticModel, TNode, bool> canReplace, 76Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 97Func<SemanticModel, TType, TNode, bool> canReplace, 98Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 119Func<SemanticModel, TNode, bool> canReplace, 120Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 155Func<SemanticModel, TType, TNode, bool> canReplace, 156Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 172var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (4)
338SemanticModel semanticModel, 389SemanticModel semanticModel, 451SemanticModel semanticModel, 461this SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, string identifierName)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
62SemanticModel semanticModel, 454SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (7)
37SemanticModel semanticModel, 47SemanticModel semanticModel, 58SemanticModel semanticModel, 140SemanticModel semanticModel, 232SemanticModel semanticModel, 258private static SyntaxNode GetNegationOfIsPatternExpression(SyntaxNode isExpression, SyntaxGenerator generator, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, CancellationToken cancellationToken) 471SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
38SemanticModel semanticModel, 119var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 208var semanticModel = compilation.GetSemanticModel(group.Key);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
82var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
27var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 34var currentModel = await current.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (31)
39SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 47SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 55SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 63SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 71SemanticModel semanticModel, 95protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, CancellationToken cancellationToken) 179public bool IsWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 182public bool IsOnlyWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 185public bool IsInOutContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 188public bool IsInRefContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 191public bool IsInInContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 194public bool CanReplaceWithRValue(SemanticModel semanticModel, SyntaxNode? expression, CancellationToken cancellationToken) 197public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 203public bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel) 206public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken) 209public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement) 212public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 215public IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 218public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 221public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 227public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 230public IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 233public IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 236public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 239public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 242public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 245public bool IsInsideNameOfExpression(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 251public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, INamedTypeSymbol? expressionTypeOpt, CancellationToken cancellationToken) 254public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 257public IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (17)
15bool IsExpressionContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 16bool IsStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 17bool IsTypeContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 18bool IsNamespaceContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 19bool IsNamespaceDeclarationNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 20bool IsTypeDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 21bool IsMemberDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 22bool IsGlobalStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 23bool IsLabelContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 24bool IsAttributeNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 27SemanticModel semanticModel, SyntaxNode location, 31SemanticModel semanticModel, SyntaxNode location, 34SyntaxToken GenerateUniqueName(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, string baseName, 38SemanticModel semanticModel, SyntaxNode location, 42SemanticModel semanticModel, SyntaxNode location, 47CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination); 49IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
18protected readonly SemanticModel SemanticModel; 26protected AbstractTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (8)
13protected abstract AbstractTypeInferrer CreateTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken); 16SemanticModel semanticModel, ImmutableArray<ITypeSymbol> result, string? nameOpt) 27SemanticModel semanticModel, ImmutableArray<TypeInferenceInfo> result, string? nameOpt) 42SemanticModel semanticModel, string name) 80SemanticModel semanticModel, int position, 91SemanticModel semanticModel, SyntaxNode expression, 102SemanticModel semanticModel, int position, 110SemanticModel semanticModel, SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\ITypeInferenceService.cs (4)
27ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken); 28ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 30ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 31ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (4)
34protected abstract SemanticModel? TryGetSpeculativeSemanticModelWorker(SemanticModel previousSemanticModel, SyntaxNode previousBodyNode, SyntaxNode currentBodyNode); 49public async Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseLanguageService.cs (2)
36Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseWorkspaceService.cs (1)
21ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (10)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 20public readonly SemanticModel PreviousNonSpeculativeSemanticModel = previousNonSpeculativeSemanticModel; 23/// The current semantic model we retrieved <see cref="SemanticModel"/> for the <see cref="BodyNode"/>. Could 26public readonly SemanticModel CurrentSemanticModel = currentSemanticModel; 34/// The top level version of the project when we retrieved <see cref="SemanticModel"/>. As long as this is the 94public async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 131var semanticModel = info.CurrentSemanticModel; 157var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 202var semanticModel = await reuseService.TryGetSpeculativeSemanticModelAsync(reuseInfo.PreviousNonSpeculativeSemanticModel, bodyNode, cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractReducer.IExpressionRewriter.cs (1)
16SyntaxNodeOrToken VisitNodeOrToken(SyntaxNodeOrToken nodeOrTokenToReduce, SemanticModel semanticModel, bool simplifyAllDescendants);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (9)
41protected abstract SemanticModel GetSpeculativeSemanticModel(ref SyntaxNode nodeToSpeculate, SemanticModel originalSemanticModel, SyntaxNode originalNode); 51public abstract SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken); 52public abstract SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken); 69var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 165var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 191var semanticModelForReduce = semanticModel; 291var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
18SemanticModel semanticModel, 26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (2)
63public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 99public static bool IsNamespaceOrTypeOrThisParameter(SyntaxNode expression, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (2)
24SemanticModel semanticModel, TMemberAccessExpressionSyntax memberAccessExpression, CancellationToken cancellationToken); 34SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractSimplifier.cs (1)
18SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (2)
25SemanticModel semanticModel, 53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 16public readonly SemanticModel SemanticModel = semanticModel; 22var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
TestExportsShouldNotBeDiscoverableCodeFixProvider.cs (1)
53var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Roslyn.Diagnostics.CSharp.Analyzers (209)
CSharpAvoidOptSuffixForNullableEnableCode.cs (1)
67private static void ReportOnInvalidIdentifier(SyntaxToken identifier, SemanticModel semanticModel, Action<Diagnostic> reportAction, CancellationToken cancellationToken)
CSharpAvoidOptSuffixForNullableEnableCodeCodeFixProvider.cs (1)
44var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
CSharpSpecializedEnumerableCreationAnalyzer.cs (1)
67private bool ShouldAnalyzeExpression(SyntaxNode expression, SemanticModel semanticModel, CancellationToken cancellationToken)
PreferNullLiteralCodeFixProvider.cs (1)
59var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (2)
32SemanticModel semanticModel, 119SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ArgumentSyntaxExtensions.cs (1)
40SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\AttributeArgumentSyntaxExtensions.cs (1)
24SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (3)
22SemanticModel semanticModel, 38DefaultExpressionSyntax defaultExpression, SemanticModel semanticModel, CancellationToken cancellationToken) 83DefaultExpressionSyntax defaultExpression, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (5)
321SemanticModel semanticModel, 424[NotNullWhen(true)] this ExpressionSyntax? expression, SemanticModel semanticModel, CancellationToken cancellationToken) 454[NotNullWhen(true)] this ExpressionSyntax? expression, SemanticModel semanticModel, CancellationToken cancellationToken) 465this ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken) 908SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (3)
20this ParenthesizedExpressionSyntax node, SemanticModel semanticModel, CancellationToken cancellationToken) 342SemanticModel semanticModel, CancellationToken cancellationToken) 409ParenthesizedExpressionSyntax node, ExpressionSyntax parentExpression, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (18)
23this SemanticModel semanticModel, 40this SemanticModel semanticModel, 103this SemanticModel semanticModel, 128public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token) 161public static ISet<INamespaceSymbol> GetUsingNamespacesInScope(this SemanticModel semanticModel, SyntaxNode location) 184this SemanticModel semanticModel, 318this SemanticModel semanticModel, 352this SemanticModel semanticModel, ExpressionSyntax expression, 429SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 459public static INamedTypeSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, BaseTypeDeclarationSyntax syntax, CancellationToken cancellationToken) 465public static IMethodSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, ConstructorDeclarationSyntax syntax, CancellationToken cancellationToken) 471public static IMethodSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, LocalFunctionStatementSyntax syntax, CancellationToken cancellationToken) 477public static IParameterSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, ParameterSyntax syntax, CancellationToken cancellationToken) 483public static IPropertySymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, PropertyDeclarationSyntax syntax, CancellationToken cancellationToken) 489public static IMethodSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, BaseMethodDeclarationSyntax syntax, CancellationToken cancellationToken) 495public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, VariableDeclaratorSyntax syntax, CancellationToken cancellationToken) 501public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SingleVariableDesignationSyntax syntax, CancellationToken cancellationToken) 511public static bool UnifiesNativeIntegers(this SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
788SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
26public static bool IsTypeInferred(this TypeSyntax typeSyntax, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\VariableDeclaratorExtensions.cs (1)
23public static bool IsTypeInferred(this VariableDeclaratorSyntax variable, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
24SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (32)
41public bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 44public bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 47public bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 50public bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 53public bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 56public bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken) 59public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 118SemanticModel oldSemanticModel, 121[NotNullWhen(true)] out SemanticModel? speculativeModel) 125var model = oldSemanticModel; 135public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken) 137var original = model.GetOriginalSemanticModel(); 176public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode node) 190public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 193public IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 204public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 216public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 252public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 262public IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 265public IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 269public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 272public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 277public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 290static ImmutableArray<ISymbol> GetCallingConventionSymbols(SemanticModel model, FunctionPointerUnmanagedCallingConventionSyntax syntax) 299/// cref="ModelExtensions.GetSymbolInfo(SemanticModel, SyntaxNode, CancellationToken)"/>, but sometimes employs 303private ImmutableArray<ISymbol> GetSymbolInfo(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 390public bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 398var semanticModel = compilation.GetSemanticModel(syntaxReference.SyntaxTree); 414public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken) 417public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 420public IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node) 429private static IPreprocessingSymbol? CreatePreprocessingSymbol(SemanticModel model, SyntaxToken identifier)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
501public bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (39)
46public static bool IsUnnecessaryCast(ExpressionSyntax cast, SemanticModel semanticModel, CancellationToken cancellationToken) 54public static bool IsUnnecessaryAsCast(BinaryExpressionSyntax cast, SemanticModel semanticModel, CancellationToken cancellationToken) 61public static bool IsUnnecessaryCast(CastExpressionSyntax cast, SemanticModel semanticModel, CancellationToken cancellationToken) 122SemanticModel semanticModel, 154SemanticModel semanticModel, 179SemanticModel originalSemanticModel, CancellationToken cancellationToken) 250SemanticModel originalSemanticModel, IDelegateCreationOperation originalDelegateCreationOperation, 290SemanticModel originalSemanticModel, IConversionOperation originalConversionOperation, 618SemanticModel originalSemanticModel, 682ExpressionSyntax castNode, ExpressionSyntax castedExpressionNode, SemanticModel semanticModel, CancellationToken cancellationToken) 769ExpressionSyntax rewrittenExpression, SemanticModel rewrittenSemanticModel, 836ExpressionSyntax castNode, SemanticModel originalSemanticModel, 837ExpressionSyntax rewrittenExpression, SemanticModel rewrittenSemanticModel, CancellationToken cancellationToken) 861ExpressionSyntax castNode, SemanticModel originalSemanticModel, 862ExpressionSyntax rewrittenExpression, SemanticModel rewrittenSemanticModel, CancellationToken cancellationToken) 891SemanticModel originalSemanticModel, 893SemanticModel rewrittenSemanticModel, 1041SemanticModel semanticModel, 1117SemanticModel semanticModel, 1176SemanticModel semanticModel, CancellationToken cancellationToken) 1243private static bool IsFieldOrArrayElement(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) 1250ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken) 1264SemanticModel originalSemanticModel, SemanticModel rewrittenSemanticModel, 1317SemanticModel originalSemanticModel, SemanticModel rewrittenSemanticModel, 1350SemanticModel originalSemanticModel, SemanticModel rewrittenSemanticModel) 1381SemanticModel originalSemanticModel, 1382SemanticModel rewrittenSemanticModel, 1490SemanticModel originalSemanticModel, 1491SemanticModel rewrittenSemanticModel, 1530SemanticModel semanticModel, 1568MemberAccessExpressionSyntax memberAccessExpression, SemanticModel semanticModel, 1624SemanticModel originalSemanticModel, SemanticModel rewrittenSemanticModel, 1646private static (SemanticModel? rewrittenSemanticModel, ExpressionSyntax? rewrittenExpression) GetSemanticModelWithCastRemoved( 1649SemanticModel originalSemanticModel, 1655var rewrittenSemanticModel = analyzer.SpeculativeSemanticModel;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (17)
58SemanticModel semanticModel, 104protected override void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate) 113protected override SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel) 116public static SemanticModel CreateSpeculativeSemanticModelForNode(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel) 123public static SemanticModel CreateSpeculativeSemanticModelForNode(SyntaxNode nodeToSpeculate, SemanticModel semanticModel, int position, bool isInNamespaceOrTypeContext) 134SemanticModel speculativeModel; 654protected override bool IsForEachTypeInferred(CommonForEachStatementSyntax forEachStatement, SemanticModel semanticModel) 813protected override bool ConversionsAreCompatible(SemanticModel originalModel, ExpressionSyntax originalExpression, SemanticModel newModel, ExpressionSyntax newExpression) 877protected override bool ForEachConversionsAreCompatible(SemanticModel originalModel, CommonForEachStatementSyntax originalForEach, SemanticModel newModel, CommonForEachStatementSyntax newForEach) 886SemanticModel model, 934protected override Conversion ClassifyConversion(SemanticModel model, ExpressionSyntax expression, ITypeSymbol targetType) 937protected override Conversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (6)
35TypeSyntax typeName, SemanticModel semanticModel, 54TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 57SyntaxToken identifier, TypeSyntax typeName, ExpressionSyntax initializer, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 59internal TypeSyntax? FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 92protected virtual bool ShouldAnalyzeForEachStatement(ForEachStatementSyntax forEachStatement, SemanticModel semanticModel, CancellationToken cancellationToken) 95protected virtual bool ShouldAnalyzeDeclarationExpression(DeclarationExpressionSyntax declaration, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (4)
36SyntaxNode declaration, SemanticModel semanticModel, 80private static bool IsTypeApparentInDeclaration(VariableDeclarationSyntax variableDeclaration, SemanticModel semanticModel, UseVarPreference stylePreferences, CancellationToken cancellationToken) 107private static bool IsPredefinedTypeInDeclaration(SyntaxNode declarationStatement, SemanticModel semanticModel) 146private static bool IsInferredPredefinedType(SyntaxNode declarationStatement, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (5)
47protected override bool ShouldAnalyzeForEachStatement(ForEachStatementSyntax forEachStatement, SemanticModel semanticModel, CancellationToken cancellationToken) 60TypeSyntax typeName, SemanticModel semanticModel, 114protected override bool ShouldAnalyzeDeclarationExpression(DeclarationExpressionSyntax declaration, SemanticModel semanticModel, CancellationToken cancellationToken) 137SemanticModel semanticModel, 149private static bool ContainsAnonymousType(TypeSyntax typeName, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (8)
30TypeSyntax typeName, SemanticModel semanticModel, 58protected override bool ShouldAnalyzeForEachStatement(ForEachStatementSyntax forEachStatement, SemanticModel semanticModel, CancellationToken cancellationToken) 69protected override bool ShouldAnalyzeDeclarationExpression(DeclarationExpressionSyntax declaration, SemanticModel semanticModel, CancellationToken cancellationToken) 92TypeSyntax typeName, SemanticModel semanticModel, 152SemanticModel semanticModel, 182var newSemanticModel = semanticModel.Compilation.ReplaceSyntaxTree(tree, newTree).GetSemanticModel(newTree); 191private static bool IsSafeToSwitchToVarWithoutNeedingSpeculation(DeclarationExpressionSyntax declarationExpression, SemanticModel semanticModel, CancellationToken cancellationToken) 243SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (5)
28protected override INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model) 42SemanticModel model, 52private static INamespaceSymbol? GetExplicitNamespaceSymbol(ExpressionSyntax fullName, ExpressionSyntax namespacePart, SemanticModel model) 79private readonly SemanticModel _model; 100SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (3)
51SemanticModel semanticModel, 180public static CSharpSyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 184Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContextService.cs (1)
18public SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
685public static bool IsNumericTypeContext(this SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (9)
618SemanticModel? semanticModel = null) 719this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, SemanticModel? semanticModel = null) 964SemanticModel? semanticModelOpt = null) 1714SemanticModel? semanticModelOpt = null) 2000public static bool IsInstanceContext(this SyntaxTree syntaxTree, SyntaxToken targetToken, SemanticModel semanticModel, CancellationToken cancellationToken) 2169SemanticModel? semanticModel = null) 2742public static bool IsNameOfContext(this SyntaxTree syntaxTree, int position, SemanticModel? semanticModelOpt = null, CancellationToken cancellationToken = default) 2810SemanticModel semanticModel, 3016public static bool IsEnumTypeMemberAccessContext(this SyntaxTree syntaxTree, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
101SemanticModel semanticModel, 130var speculativeSemanticModel = specAnalyzer.SpeculativeSemanticModel; 164SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\InternalExtensions.cs (2)
15SemanticModel semanticModel, 21public static ITypeSymbol DetermineParameterType(ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
110public static async Task<ISymbol?> FindApplicableAliasAsync(this ITypeSymbol type, int position, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (7)
22public static INamespaceSymbol GetDeclaredSymbol(this SemanticModel semanticModel, BaseNamespaceDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default) 36this SemanticModel semanticModel, 45this SemanticModel semanticModel, 54this SemanticModel semanticModel, 77this SemanticModel semanticModel, 99this SemanticModel semanticModel, ArgumentSyntax argument, CancellationToken cancellationToken) 112this SemanticModel semanticModel, AttributeArgumentSyntax argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
70public static IEnumerable<BaseTypeSyntax> GetAllBaseListTypes(this TypeDeclarationSyntax typeNode, SemanticModel model, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
16public static bool IsPotentialTypeName([NotNullWhen(true)] this TypeSyntax? typeSyntax, SemanticModel? semanticModelOpt, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
61var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
41var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (13)
36protected override IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, CancellationToken cancellationToken) 67public bool IsExpressionContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 75public bool IsStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 81public bool IsTypeContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 84public bool IsNamespaceContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 87public bool IsNamespaceDeclarationNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 90public bool IsTypeDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 96public bool IsMemberDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 102public bool IsGlobalStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 105public bool IsLabelContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 108public bool IsAttributeNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 111public CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination) 116public IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.cs (1)
21protected override AbstractTypeInferrer CreateTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
30SemanticModel semanticModel, 2053var currentSemanticModel = SemanticModel; 2054var originalSemanticModel = currentSemanticModel.GetOriginalSemanticModel();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\SemanticModelReuse\CSharpSemanticModelReuseLanguageService.cs (3)
54protected override SemanticModel? TryGetSpeculativeSemanticModelWorker(SemanticModel previousSemanticModel, SyntaxNode previousBodyNode, SyntaxNode currentBodyNode) 59previousSemanticModel.TryGetSpeculativeSemanticModelForMethodBody(previousBaseMethod.Body.SpanStart, currentBaseMethod, out var speculativeModel))
System.Private.CoreLib.Generators (5)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (5)
198private static INamedTypeSymbol? GetIsSupportedTypeSymbol(SemanticModel model, MemberAccessExpressionSyntax memberAccessExpression) 211private static INamedTypeSymbol? GetIsSupportedTypeSymbol(SemanticModel model, IdentifierNameSyntax identifierName) 221private static INamedTypeSymbol[] GatherAndConditions(SemanticModel model, ExpressionSyntax expressionToDecompose) 273private static INamedTypeSymbol[][] DecomposePropertySymbolForIsSupportedGroups_Property(OperationAnalysisContext context, SemanticModel model, ExpressionSyntax expressionToDecompose) 309private static INamedTypeSymbol[][] DecomposeConditionForIsSupportedGroups(OperationAnalysisContext context, SemanticModel model, ExpressionSyntax expressionToDecompose)
System.Text.Json.SourceGeneration (2)
JsonSourceGenerator.Parser.cs (2)
78public ContextGenerationSpec? ParseContextGenerationSpec(ClassDeclarationSyntax contextClassDeclaration, SemanticModel semanticModel, CancellationToken cancellationToken) 169private static bool TryGetNestedTypeDeclarations(ClassDeclarationSyntax contextClassSyntax, SemanticModel semanticModel, CancellationToken cancellationToken, [NotNullWhen(true)] out List<string>? typeDeclarations)
System.Text.RegularExpressions.Generator (4)
RegexGenerator.Parser.cs (1)
39SemanticModel sm = context.SemanticModel;
UpgradeToGeneratedRegexCodeFixer.cs (3)
88if (await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false) is not SemanticModel semanticModel || 171await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false) is not SemanticModel semanticModel || 221if (await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false) is not SemanticModel semanticModel ||
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Analyzers\ImplementITypedDataObject\ImplementITypedDataObjectAnalyzer.cs (1)
36var semanticModel = context.SemanticModel;
System.Windows.Forms.PrivateSourceGenerators (4)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (4)
203var semanticModelCache = new Dictionary<SyntaxTree, SemanticModel>(); 216SemanticModel semanticModel = GetSemanticModel(compilation, argument.SyntaxTree); 233SemanticModel GetSemanticModel(Compilation compilation, SyntaxTree syntaxTree) 235if (!semanticModelCache.TryGetValue(syntaxTree, out SemanticModel model))
Test.Utilities (6)
DocumentExtensions.cs (2)
14public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 16if (document.TryGetSemanticModel(out var semanticModel))
IMethodSymbolExtensions.cs (1)
588var semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree);
IOperationExtensions.cs (1)
56var model = compilation.GetSemanticModel(receiverSyntax.SyntaxTree);
SemanticModelExtensions.cs (1)
12public static IOperation? GetOperationWalkingUpParentChain(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
SyntaxGeneratorExtensions.cs (1)
471public static SyntaxNode FirstUnusedIdentifierName(this SyntaxGenerator generator, SemanticModel semanticModel, int position, string baseName, int maxTries = int.MaxValue)
Text.Analyzers (272)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeMetricsAnalysisContext.cs (4)
14private readonly ConcurrentDictionary<SyntaxTree, SemanticModel> _semanticModelMap; 15private readonly Func<SyntaxTree, SemanticModel> _getSemanticModel; 23_semanticModelMap = new ConcurrentDictionary<SyntaxTree, SemanticModel>(); 34internal SemanticModel GetSemanticModel(SyntaxNode node)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (3)
74var model = context.GetSemanticModel(declSyntax); 182SemanticModel model = context.GetSemanticModel(declSyntax); 243var model = context.GetSemanticModel(node);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
458var semanticModel = compilation.GetSemanticModel(syntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
57var model = compilation.GetSemanticModel(receiverSyntax.SyntaxTree);
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (1)
472public static SyntaxNode FirstUnusedIdentifierName(this SyntaxGenerator generator, SemanticModel semanticModel, int position, string baseName, int maxTries = int.MaxValue)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\DiagnosticAnalyzerCategory.cs (1)
22/// <see cref="SemanticModel"/> is needed, use <see cref="SemanticSpanAnalysis"/> or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
23SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (7)
14public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 18SemanticModel semanticModel1, 19SemanticModel semanticModel2, 48SemanticModel semanticModel1, 49SemanticModel semanticModel2, 129SemanticModel semanticModel1, 130SemanticModel semanticModel2,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
33public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 36public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 39public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 42public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 45public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 48public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 54public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 60public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66public static TSymbol? GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 82public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 88public static INamedTypeSymbol? GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 91public static INamespaceSymbol? GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 94public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel) 108this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 137public static string GenerateNameFromType(this SemanticModel semanticModel, ITypeSymbol type, ISyntaxFacts syntaxFacts, bool capitalize) 168private static bool ShouldPluralize(this SemanticModel semanticModel, ITypeSymbol type) 219this SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
66SemanticModel? semanticModel, 68Func<SemanticModel?, SyntaxToken, bool> predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (3)
21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 23public ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken) 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
15ImmutableArray<TSyntaxNode> GetUnnecessaryImports(SemanticModel model, TextSpan? span, CancellationToken cancellationToken); 18SemanticModel model,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (25)
51bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 58bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 59bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 72bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 77ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken); 79ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 80SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 82IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 84ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 92IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 93IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 96ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 100bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 107bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 109string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 120IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (3)
17SemanticModel semanticModel) 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
386bool IsBindableToken(SemanticModel? semanticModel, SyntaxToken token);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
44var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); 59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
53var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
87TryGetSemanticModel(compilation, syntaxTree, out var semanticModel)) 116[NotNullWhen(true)] out SemanticModel? semanticModel) 185TryGetSemanticModel(reader.Compilation, firstSourceTree, out var semanticModel)) 255SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
728var semanticModel = Compilation.GetSemanticModel(location.SourceTree);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
50private SemanticModel? _lazySpeculativeSemanticModel; 75SemanticModel semanticModel, 96protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 102protected abstract TConversion ClassifyConversion(SemanticModel model, TExpressionSyntax expression, ITypeSymbol targetType); 103protected abstract TConversion ClassifyConversion(SemanticModel model, ITypeSymbol originalType, ITypeSymbol targetType); 104protected abstract bool ConversionsAreCompatible(SemanticModel model1, TExpressionSyntax expression1, SemanticModel model2, TExpressionSyntax expression2); 109protected abstract bool IsForEachTypeInferred(TForEachStatementSyntax forEachStatement, SemanticModel semanticModel); 110protected abstract bool ForEachConversionsAreCompatible(SemanticModel originalModel, TForEachStatementSyntax originalForEach, SemanticModel newModel, TForEachStatementSyntax newForEach); 112SemanticModel model, TForEachStatementSyntax forEach, out IMethodSymbol getEnumeratorMethod, out ITypeSymbol elementType, out ImmutableArray<ILocalSymbol> localVariables); 155public SemanticModel OriginalSemanticModel { get; } 190public SemanticModel SpeculativeSemanticModel 224protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 977SemanticModel speculativeSemanticModel) 1031private bool IsReceiverNonUniquePossibleValueTypeParam(TExpressionSyntax invocation, SemanticModel semanticModel) 1049private static bool IsReceiverUniqueInstance(TExpressionSyntax receiver, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (2)
26SemanticModel semanticModel, 47public static void AddAliasSymbols(SemanticModel semanticModel, int namespaceId, IEnumerable<IAliasSymbol> aliasSymbols)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (4)
11/// <see cref="SemanticModel.SyntaxTree"/> that <see cref="OriginalSemanticModel"/> points at. 17/// cref="SemanticModel.SyntaxTree"/> that <see cref="SpeculativeSemanticModel"/> points at. 24SemanticModel OriginalSemanticModel { get; } 30SemanticModel SpeculativeSemanticModel { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
639public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (1)
45var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
199public string ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null) 202public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (2)
65public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 68public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
73protected abstract INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model); 78SemanticModel model, 94SemanticModel model, 121var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 183var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 259private static bool IsInsideNamespace(SyntaxNode node, INamespaceSymbol symbol, SemanticModel model, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
12SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14SemanticModel semanticModel, 48public SemanticModel SemanticModel { get; } = semanticModel;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (6)
33public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 35if (document.TryGetSemanticModel(out var semanticModel)) 111public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 128public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 153public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 178var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeInferenceServiceExtensions.cs (11)
15public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 18public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 21public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 24public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 29SemanticModel semanticModel, 39SemanticModel semanticModel, 47private static INamedTypeSymbol? GetFirstDelegateType(SemanticModel semanticModel, ImmutableArray<ITypeSymbol> types) 55SemanticModel semanticModel, 67SemanticModel semanticModel, 85SemanticModel semanticModel, 97SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (13)
30Func<SemanticModel, TType, TNode, bool> canReplace, 31Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 53Func<SemanticModel, TType, TNode, bool> canReplace, 54Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 75Func<SemanticModel, TNode, bool> canReplace, 76Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 97Func<SemanticModel, TType, TNode, bool> canReplace, 98Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 119Func<SemanticModel, TNode, bool> canReplace, 120Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 155Func<SemanticModel, TType, TNode, bool> canReplace, 156Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 172var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (4)
338SemanticModel semanticModel, 389SemanticModel semanticModel, 451SemanticModel semanticModel, 461this SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, string identifierName)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
62SemanticModel semanticModel, 454SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (7)
37SemanticModel semanticModel, 47SemanticModel semanticModel, 58SemanticModel semanticModel, 140SemanticModel semanticModel, 232SemanticModel semanticModel, 258private static SyntaxNode GetNegationOfIsPatternExpression(SyntaxNode isExpression, SyntaxGenerator generator, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, CancellationToken cancellationToken) 471SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
38SemanticModel semanticModel, 119var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 208var semanticModel = compilation.GetSemanticModel(group.Key);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
82var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
27var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 34var currentModel = await current.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (31)
39SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 47SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 55SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 63SemanticModel semanticModel, SyntaxNode location, SyntaxNode? containerOpt, 71SemanticModel semanticModel, 95protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, CancellationToken cancellationToken) 179public bool IsWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 182public bool IsOnlyWrittenTo(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 185public bool IsInOutContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 188public bool IsInRefContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 191public bool IsInInContext(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 194public bool CanReplaceWithRValue(SemanticModel semanticModel, SyntaxNode? expression, CancellationToken cancellationToken) 197public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 203public bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel) 206public ImmutableHashSet<string> GetAliasNameSet(SemanticModel model, CancellationToken cancellationToken) 209public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement) 212public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 215public IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 218public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 221public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 227public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 230public IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 233public IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 236public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 239public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 242public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 245public bool IsInsideNameOfExpression(SemanticModel semanticModel, SyntaxNode? node, CancellationToken cancellationToken) 251public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, INamedTypeSymbol? expressionTypeOpt, CancellationToken cancellationToken) 254public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 257public IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (17)
15bool IsExpressionContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 16bool IsStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 17bool IsTypeContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 18bool IsNamespaceContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 19bool IsNamespaceDeclarationNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 20bool IsTypeDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 21bool IsMemberDeclarationContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 22bool IsGlobalStatementContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 23bool IsLabelContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 24bool IsAttributeNameContext(SemanticModel semanticModel, int position, CancellationToken cancellationToken); 27SemanticModel semanticModel, SyntaxNode location, 31SemanticModel semanticModel, SyntaxNode location, 34SyntaxToken GenerateUniqueName(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, string baseName, 38SemanticModel semanticModel, SyntaxNode location, 42SemanticModel semanticModel, SyntaxNode location, 47CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination); 49IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
18protected readonly SemanticModel SemanticModel; 26protected AbstractTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (8)
13protected abstract AbstractTypeInferrer CreateTypeInferrer(SemanticModel semanticModel, CancellationToken cancellationToken); 16SemanticModel semanticModel, ImmutableArray<ITypeSymbol> result, string? nameOpt) 27SemanticModel semanticModel, ImmutableArray<TypeInferenceInfo> result, string? nameOpt) 42SemanticModel semanticModel, string name) 80SemanticModel semanticModel, int position, 91SemanticModel semanticModel, SyntaxNode expression, 102SemanticModel semanticModel, int position, 110SemanticModel semanticModel, SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\ITypeInferenceService.cs (4)
27ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken); 28ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 30ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, int position, string? nameOpt, CancellationToken cancellationToken); 31ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, SyntaxNode expression, string? nameOpt, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (4)
34protected abstract SemanticModel? TryGetSpeculativeSemanticModelWorker(SemanticModel previousSemanticModel, SyntaxNode previousBodyNode, SyntaxNode currentBodyNode); 49public async Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseLanguageService.cs (2)
36Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\ISemanticModelReuseWorkspaceService.cs (1)
21ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (10)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 20public readonly SemanticModel PreviousNonSpeculativeSemanticModel = previousNonSpeculativeSemanticModel; 23/// The current semantic model we retrieved <see cref="SemanticModel"/> for the <see cref="BodyNode"/>. Could 26public readonly SemanticModel CurrentSemanticModel = currentSemanticModel; 34/// The top level version of the project when we retrieved <see cref="SemanticModel"/>. As long as this is the 94public async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 131var semanticModel = info.CurrentSemanticModel; 157var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 202var semanticModel = await reuseService.TryGetSpeculativeSemanticModelAsync(reuseInfo.PreviousNonSpeculativeSemanticModel, bodyNode, cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractReducer.IExpressionRewriter.cs (1)
16SyntaxNodeOrToken VisitNodeOrToken(SyntaxNodeOrToken nodeOrTokenToReduce, SemanticModel semanticModel, bool simplifyAllDescendants);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (9)
41protected abstract SemanticModel GetSpeculativeSemanticModel(ref SyntaxNode nodeToSpeculate, SemanticModel originalSemanticModel, SyntaxNode originalNode); 51public abstract SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken); 52public abstract SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken); 69var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 165var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 191var semanticModelForReduce = semanticModel; 291var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
18SemanticModel semanticModel, 26SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (2)
63public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 99public static bool IsNamespaceOrTypeOrThisParameter(SyntaxNode expression, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (2)
24SemanticModel semanticModel, TMemberAccessExpressionSyntax memberAccessExpression, CancellationToken cancellationToken); 34SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractSimplifier.cs (1)
18SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (2)
25SemanticModel semanticModel, 53SemanticModel semanticModel,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 16public readonly SemanticModel SemanticModel = semanticModel; 22var model = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);