14 interfaces inheriting from ISymbol
Microsoft.CodeAnalysis (14)
Symbols\IAliasSymbol.cs (1)
16public interface IAliasSymbol : ISymbol
Symbols\IAssemblySymbol.cs (1)
18public interface IAssemblySymbol : ISymbol
Symbols\IDiscardSymbol.cs (1)
13public interface IDiscardSymbol : ISymbol
Symbols\IEventSymbol.cs (1)
17public interface IEventSymbol : ISymbol
Symbols\IFieldSymbol.cs (1)
17public interface IFieldSymbol : ISymbol
Symbols\ILabelSymbol.cs (1)
16public interface ILabelSymbol : ISymbol
Symbols\ILocalSymbol.cs (1)
14public interface ILocalSymbol : ISymbol
Symbols\IMethodSymbol.cs (1)
19public interface IMethodSymbol : ISymbol
Symbols\IModuleSymbol.cs (1)
17public interface IModuleSymbol : ISymbol
Symbols\INamespaceOrTypeSymbol.cs (1)
18public interface INamespaceOrTypeSymbol : ISymbol
Symbols\IParameterSymbol.cs (1)
18public interface IParameterSymbol : ISymbol
Symbols\IPreprocessingSymbol.cs (1)
14public interface IPreprocessingSymbol : ISymbol
Symbols\IPropertySymbol.cs (1)
17public interface IPropertySymbol : ISymbol
Symbols\IRangeVariableSymbol.cs (1)
16public interface IRangeVariableSymbol : ISymbol
6 implementations of ISymbol
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
CodeGenerationSymbol.cs (1)
22internal abstract class CodeGenerationSymbol : ISymbol
Microsoft.CodeAnalysis.CSharp (2)
Symbols\PublicModel\Symbol.cs (1)
15internal abstract class Symbol : ISymbol
Symbols\PublicModel\TypeSymbol.cs (1)
12internal abstract class TypeSymbol : NamespaceOrTypeSymbol, ISymbol, ITypeSymbol
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
16private abstract class AbstractWrappedSymbol : ISymbol
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
25Implements ISymbol, ISymbolInternal, IFormattable
Microsoft.CodeAnalysis.Workspaces (1)
CodeGenerationSymbol.cs (1)
22internal abstract class CodeGenerationSymbol : ISymbol
6610 references to ISymbol
IdeCoreBenchmarks (2)
FindReferencesBenchmarks.cs (1)
31ISymbol _type;
RenameBenchmarks.cs (1)
22private ISymbol _symbol;
Microsoft.CodeAnalysis (486)
CodeGen\PermissionSetAttribute.cs (1)
84ISymbol iSymbol = _sourceAttribute.GetType(context).GetInternalSymbol()!.GetISymbol();
Compilation\Compilation.cs (13)
871public ISymbol? GetAssemblyOrModuleSymbol(MetadataReference reference) 876protected abstract ISymbol? CommonGetAssemblyOrModuleSymbol(MetadataReference reference); 1595ISymbol symbol, 1596ISymbol within, 1623void checkInCompilationReferences(ISymbol s, string parameterName) 1673bool isContainingAssemblyInReferences(ISymbol s) 1724ISymbol symbol, 1725ISymbol within, 3011Func<ISymbol, bool> isAddedSymbol, 3038Func<ISymbol, bool> isAddedSymbol, 3084Func<ISymbol, bool> isAddedSymbol, 3594public abstract IEnumerable<ISymbol> GetSymbolsWithName(Func<string, bool> predicate, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default(CancellationToken)); 3611public abstract IEnumerable<ISymbol> GetSymbolsWithName(string name, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default(CancellationToken));
Compilation\DataFlowAnalysis.cs (14)
23public abstract ImmutableArray<ISymbol> VariablesDeclared { get; } 29public abstract ImmutableArray<ISymbol> DataFlowsIn { get; } 35public abstract ImmutableArray<ISymbol> DataFlowsOut { get; } 43public abstract ImmutableArray<ISymbol> DefinitelyAssignedOnEntry { get; } 51public abstract ImmutableArray<ISymbol> DefinitelyAssignedOnExit { get; } 57public abstract ImmutableArray<ISymbol> AlwaysAssigned { get; } 62public abstract ImmutableArray<ISymbol> ReadInside { get; } 67public abstract ImmutableArray<ISymbol> WrittenInside { get; } 72public abstract ImmutableArray<ISymbol> ReadOutside { get; } 77public abstract ImmutableArray<ISymbol> WrittenOutside { get; } 83public abstract ImmutableArray<ISymbol> Captured { get; } 88public abstract ImmutableArray<ISymbol> CapturedInside { get; } 93public abstract ImmutableArray<ISymbol> CapturedOutside { get; } 99public abstract ImmutableArray<ISymbol> UnsafeAddressTaken { get; }
Compilation\Extensions.cs (2)
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))
Compilation\IImportScope.cs (2)
13/// location can be found using either <see cref="ISymbol.Locations"/> or <see 14/// cref="ISymbol.DeclaringSyntaxReferences"/> on the <see cref="IAliasSymbol"/> itself. For <see cref="Imports"/>
Compilation\SemanticModel.cs (26)
384internal ISymbol? GetDeclaredSymbolForNode(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 398protected abstract ISymbol? GetDeclaredSymbolCore(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)); 411internal ImmutableArray<ISymbol> GetDeclaredSymbolsForNode(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 427protected abstract ImmutableArray<ISymbol> GetDeclaredSymbolsCore(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)); 450public ImmutableArray<ISymbol> LookupSymbols( 462protected abstract ImmutableArray<ISymbol> LookupSymbolsCore( 503public ImmutableArray<ISymbol> LookupBaseMembers( 513protected abstract ImmutableArray<ISymbol> LookupBaseMembersCore( 537public ImmutableArray<ISymbol> LookupStaticMembers( 548protected abstract ImmutableArray<ISymbol> LookupStaticMembersCore( 571public ImmutableArray<ISymbol> LookupNamespacesAndTypes( 582protected abstract ImmutableArray<ISymbol> LookupNamespacesAndTypesCore( 601public ImmutableArray<ISymbol> LookupLabels( 611protected abstract ImmutableArray<ISymbol> LookupLabelsCore( 749internal ImmutableArray<ISymbol> GetMemberGroup(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 759protected abstract ImmutableArray<ISymbol> GetMemberGroupCore(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)); 765public ISymbol? GetEnclosingSymbol(int position, CancellationToken cancellationToken = default(CancellationToken)) 774protected abstract ISymbol? GetEnclosingSymbolCore(int position, CancellationToken cancellationToken = default(CancellationToken)); 801public bool IsAccessible(int position, ISymbol symbol) 821protected abstract bool IsAccessibleCore(int position, ISymbol symbol); 874internal abstract void ComputeDeclarationsInNode(SyntaxNode node, ISymbol associatedSymbol, bool getSymbol, ArrayBuilder<DeclarationInfo> builder, CancellationToken cancellationToken, int? levelsToCompute = null); 882/// <see cref="ShouldSkipSyntaxNodeAnalysis(SyntaxNode, ISymbol)"/>. 884internal virtual Func<SyntaxNode, bool>? GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) => null; 890/// logic to <see cref="GetSyntaxNodesToAnalyzeFilter(SyntaxNode, ISymbol)"/>. 892internal virtual bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol) => false; 897protected internal virtual SyntaxNode GetTopmostNodeForDiagnosticAnalysis(ISymbol symbol, SyntaxNode declaringSyntax)
Compilation\SymbolInfo.cs (12)
22private readonly ImmutableArray<ISymbol> _candidateSymbols; 30public ISymbol? Symbol { get; } 39public ImmutableArray<ISymbol> CandidateSymbols => _candidateSymbols.NullToEmpty(); 48internal SymbolInfo(ISymbol symbol) 49: this(symbol, ImmutableArray<ISymbol>.Empty, CandidateReason.None) 53internal SymbolInfo(ISymbol symbol, CandidateReason reason) 54: this(symbol, ImmutableArray<ISymbol>.Empty, reason) 58internal SymbolInfo(ImmutableArray<ISymbol> candidateSymbols, CandidateReason candidateReason) 63private SymbolInfo(ISymbol? symbol, ImmutableArray<ISymbol> candidateSymbols, CandidateReason candidateReason) 71foreach (var item in _candidateSymbols) 80internal ImmutableArray<ISymbol> GetAllSymbols()
DeclarationComputer.cs (4)
17var declaredSymbol = GetDeclaredSymbol(model, node, getSymbol, cancellationToken); 21internal static DeclarationInfo GetDeclarationInfo(SyntaxNode node, ISymbol? declaredSymbol, IEnumerable<SyntaxNode>? executableCodeBlocks) 42private static ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken) 49var declaredSymbol = model.GetDeclaredSymbol(node, cancellationToken);
DeclarationInfo.cs (2)
15internal DeclarationInfo(SyntaxNode declaredNode, ImmutableArray<SyntaxNode> executableCodeBlocks, ISymbol? declaredSymbol) 42public ISymbol? DeclaredSymbol { get; }
Diagnostic\CommonMessageProvider.cs (1)
104public abstract string GetErrorDisplayString(ISymbol symbol);
Diagnostic\DiagnosticInfo.cs (2)
400var symbol = _arguments[i] as ISymbol ?? (_arguments[i] as ISymbolInternal)?.GetISymbol();
DiagnosticAnalyzer\AnalysisContextInfo.cs (5)
18private readonly ISymbol? _symbol; 32public AnalysisContextInfo(Compilation compilation, ISymbol symbol) : 52public AnalysisContextInfo(Compilation compilation, ISymbol symbol, SyntaxNode node) : 60ISymbol? symbol, 90sb.AppendLine($"{nameof(ISymbol)}: {_symbol.Name} ({_symbol.Kind})");
DiagnosticAnalyzer\AnalysisScope.cs (2)
145public static bool ShouldSkipDeclarationAnalysis(ISymbol symbol) 164Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopmostNodeForAnalysis,
DiagnosticAnalyzer\AnalyzerDriver.cs (38)
36private static readonly Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> s_getTopmostNodeForAnalysis = GetTopmostNodeForAnalysis; 245private Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>>? _lazyGeneratedCodeSymbolsForTreeMap; 250private Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>> GeneratedCodeSymbolsForTreeMap 289private ConcurrentDictionary<ISymbol, bool>? _lazyIsGeneratedCodeSymbolMap; 294private ConcurrentDictionary<ISymbol, bool> IsGeneratedCodeSymbolMap 411_lazyGeneratedCodeSymbolsForTreeMap = new Dictionary<SyntaxTree, ImmutableHashSet<ISymbol>>(); 412_lazyIsGeneratedCodeSymbolMap = new ConcurrentDictionary<ISymbol, bool>(); 1195foreach (var symbol in declaredSymbols) 1208ImmutableHashSet<ISymbol> getOrComputeGeneratedCodeSymbolsInTree(SyntaxTree tree, Compilation compilation, CancellationToken cancellationToken) 1213ImmutableHashSet<ISymbol>? generatedCodeSymbols; 1226ImmutableHashSet<ISymbol>? existingGeneratedCodeSymbols; 1239static ImmutableHashSet<ISymbol> computeGeneratedCodeSymbolsInTree(SyntaxTree tree, Compilation compilation, INamedTypeSymbol generatedCodeAttribute, CancellationToken cancellationToken) 1246return ImmutableHashSet<ISymbol>.Empty; 1255ImmutableHashSet<ISymbol>.Builder? generatedSymbolsBuilder = null; 1258var symbol = declarationInfo.DeclaredSymbol; 1262generatedSymbolsBuilder ??= ImmutableHashSet.CreateBuilder<ISymbol>(); 1268return generatedSymbolsBuilder != null ? generatedSymbolsBuilder.ToImmutable() : ImmutableHashSet<ISymbol>.Empty; 1596async Task onSymbolAndMembersProcessedAsync(ISymbol symbol, DiagnosticAnalyzer analyzer) 1612async Task processContainerOnMemberCompletedAsync(INamespaceOrTypeSymbol containerSymbol, ISymbol processedMemberSymbol, DiagnosticAnalyzer analyzer) 1663var symbol = symbolEvent.Symbol; 1696var symbol = symbolEvent.Symbol; 1727var symbol = symbolEvent.Symbol; 1793private static SyntaxNode GetTopmostNodeForAnalysis(ISymbol symbol, SyntaxReference syntaxReference, Compilation compilation, CancellationToken cancellationToken) 2012ISymbol symbol, 2043ISymbol symbol, 2070async ValueTask<IGroupedAnalyzerActions> getAllActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 2086async ValueTask<IGroupedAnalyzerActions> getInheritedActionsAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken) 2110static async ValueTask<AnalyzerActions> getSymbolActionsCoreAsync(AnalyzerDriver driver, ISymbol symbol, DiagnosticAnalyzer analyzer) 2171private bool IsGeneratedCodeSymbol(ISymbol symbol) 2345ISymbol symbol, 2399var symbol = symbolEvent.Symbol; 2434ISymbol symbol, 2453private static void ComputeDeclarationsInNode(SemanticModel semanticModel, ISymbol declaredSymbol, SyntaxNode declaringReferenceSyntax, SyntaxNode topmostNodeForAnalysis, ArrayBuilder<DeclarationInfo> builder, CancellationToken cancellationToken) 2480var symbol = symbolEvent.Symbol; 2716ISymbol declaredSymbol, 2748var declaredSymbolOfDeclInNode = declInNode.DeclaredSymbol ?? semanticModel.GetDeclaredSymbol(declInNode.DeclaredNode, analyzerExecutor.CancellationToken); 2776private static bool IsEquivalentSymbol(ISymbol declaredSymbol, ISymbol? otherSymbol)
DiagnosticAnalyzer\AnalyzerExecutor.cs (24)
315ISymbol symbol, 418Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 429var symbol = symbolDeclaredEvent.Symbol; 465ISymbol processedMemberSymbol, 467Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 499Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 513Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 520var symbol = symbolDeclaredEvent.Symbol; 667ISymbol containingSymbol, 690ISymbol containingSymbol, 717ISymbol declaredSymbol, 752ISymbol declaredSymbol, 770ISymbol declaredSymbol, 889ISymbol declaredSymbol, 970ISymbol declaredSymbol, 991ISymbol containingSymbol, 1059ISymbol declaredSymbol, 1079ISymbol containingSymbol, 1109internal static bool CanHaveExecutableCodeBlock(ISymbol symbol) 1329private Action<Diagnostic> GetAddDiagnostic(ISymbol contextSymbol, ImmutableArray<SyntaxReference> cachedDeclaringReferences, DiagnosticAnalyzer analyzer, Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis) 1336ISymbol contextSymbol, 1343Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 1472private bool IsAnalyzerSuppressedForSymbol(DiagnosticAnalyzer analyzer, ISymbol symbol)
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (23)
26private Dictionary<ISymbol, HashSet<ISymbol>?>? _lazyPendingMemberSymbolsMap; 31private Dictionary<ISymbol, (ImmutableArray<SymbolEndAnalyzerAction>, SymbolDeclaredCompilationEvent)>? _lazyPendingSymbolEndActionsMap; 47private Dictionary<ISymbol, Task<HostSymbolStartAnalysisScope>>? _lazySymbolScopeTasks; 131ISymbol symbol, 138_lazySymbolScopeTasks ??= new Dictionary<ISymbol, Task<HostSymbolStartAnalysisScope>>(); 158_lazyPendingMemberSymbolsMap ??= new Dictionary<ISymbol, HashSet<ISymbol>?>(); 170HashSet<ISymbol>? getDependentSymbols() 172HashSet<ISymbol>? memberSet = null; 186void processMembers(IEnumerable<ISymbol> members) 188foreach (var member in members) 192memberSet ??= new HashSet<ISymbol>(); 214private void VerifyNewEntryForPendingMemberSymbolsMap(ISymbol symbol, HashSet<ISymbol>? dependentSymbols) 232public void ClearSymbolScopeTask(ISymbol symbol) 361ISymbol containingSymbol, 362ISymbol processedMemberSymbol, 394var symbol = symbolDeclaredEvent.Symbol; 413public void MarkSymbolEndAnalysisComplete(ISymbol symbol) 421public void MarkSymbolEndAnalysisPending(ISymbol symbol, ImmutableArray<SymbolEndAnalyzerAction> symbolEndActions, SymbolDeclaredCompilationEvent symbolDeclaredEvent) 429private void MarkSymbolEndAnalysisPending_NoLock(ISymbol symbol, ImmutableArray<SymbolEndAnalyzerAction> symbolEndActions, SymbolDeclaredCompilationEvent symbolDeclaredEvent) 431_lazyPendingSymbolEndActionsMap ??= new Dictionary<ISymbol, (ImmutableArray<SymbolEndAnalyzerAction>, SymbolDeclaredCompilationEvent)>();
DiagnosticAnalyzer\AnalyzerManager.cs (7)
89ISymbol symbol, 100ISymbol symbol, 175ISymbol symbol, 429ISymbol containingSymbol, 430ISymbol processedMemberSymbol, 443ISymbol symbol, 451public void MarkSymbolEndAnalysisComplete(ISymbol symbol, DiagnosticAnalyzer analyzer)
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (65)
70/// Register an action to be executed at completion of semantic analysis of an <see cref="ISymbol"/> with an appropriate Kind. 71/// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. 73/// <param name="action">Action to be executed for an <see cref="ISymbol"/>.</param> 74/// <param name="symbolKinds">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches one of the <see cref="SymbolKind"/> values.</param> 81/// Register an action to be executed at completion of semantic analysis of an <see cref="ISymbol"/> with an appropriate Kind. 82/// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. 84/// <param name="action">Action to be executed for an <see cref="ISymbol"/>.</param> 85/// <param name="symbolKinds">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches one of the <see cref="SymbolKind"/> values.</param> 89/// Register an action to be executed at start of semantic analysis of an <see cref="ISymbol"/> and its members with an appropriate Kind. 92/// <param name="symbolKind">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches the given <see cref="SymbolKind"/>.</param> 344/// Register an action to be executed at completion of semantic analysis of an <see cref="ISymbol"/> with an appropriate Kind. 345/// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. 347/// <param name="action">Action to be executed for an <see cref="ISymbol"/>.</param> 348/// <param name="symbolKinds">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches one of the <see cref="SymbolKind"/> values.</param> 355/// Register an action to be executed at completion of semantic analysis of an <see cref="ISymbol"/> with an appropriate Kind. 356/// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. 358/// <param name="action">Action to be executed for an <see cref="ISymbol"/>.</param> 359/// <param name="symbolKinds">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches one of the <see cref="SymbolKind"/> values.</param> 363/// Register an action to be executed at start of semantic analysis of an <see cref="ISymbol"/> and its members with an appropriate Kind. 366/// <param name="symbolKind">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches the given <see cref="SymbolKind"/>.</param> 702/// A symbol action can use a <see cref="SymbolAnalysisContext"/> to report <see cref="Diagnostic"/>s about an <see cref="ISymbol"/>. 706private readonly ISymbol _symbol; 714/// <see cref="ISymbol"/> that is the subject of the analysis. 716public ISymbol Symbol { get { return _symbol; } } 719/// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="ISymbol"/>. 741public SymbolAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 747ISymbol symbol, 765/// Report a <see cref="Diagnostic"/> about an <see cref="ISymbol"/>. 780/// A symbol start/end action can use a <see cref="SymbolStartAnalysisContext"/> to report <see cref="Diagnostic"/>s about code within a <see cref="ISymbol"/> and its members. 785/// <see cref="ISymbol"/> that is the subject of the analysis. 787public ISymbol Symbol { get; } 790/// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="ISymbol"/>. 810public SymbolStartAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, CancellationToken cancellationToken) 815internal SymbolStartAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, bool isGeneratedCode, CancellationToken cancellationToken) 825/// Register an action to be executed at end of semantic analysis of an <see cref="ISymbol"/> and its members. 923private readonly ISymbol _owningSymbol; 934/// <see cref="ISymbol"/> for which the code block provides a definition or value. 936public ISymbol OwningSymbol { get { return _owningSymbol; } } 959protected CodeBlockStartAnalysisContext(SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, CancellationToken cancellationToken) 966ISymbol owningSymbol, 1016private readonly ISymbol _owningSymbol; 1029/// <see cref="ISymbol"/> for which the code block provides a definition or value. 1031public ISymbol OwningSymbol { get { return _owningSymbol; } } 1054public CodeBlockAnalysisContext(SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1061ISymbol owningSymbol, 1109private readonly ISymbol _owningSymbol; 1124/// <see cref="ISymbol"/> for which the <see cref="OperationBlocks"/> provides a definition or value. 1126public ISymbol OwningSymbol => _owningSymbol; 1151ISymbol owningSymbol, 1161ISymbol owningSymbol, 1232private readonly ISymbol _owningSymbol; 1249/// <see cref="ISymbol"/> for which the <see cref="OperationBlocks"/> provides a definition or value. 1251public ISymbol OwningSymbol => _owningSymbol; 1276ISymbol owningSymbol, 1288ISymbol owningSymbol, 1481private readonly ISymbol? _containingSymbol; 1494/// <see cref="ISymbol"/> for the declaration containing the syntax node. 1496public ISymbol? ContainingSymbol => _containingSymbol; 1524public SyntaxNodeAnalysisContext(SyntaxNode node, ISymbol? containingSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1537ISymbol? containingSymbol, 1576private readonly ISymbol _containingSymbol; 1590/// <see cref="ISymbol"/> for the declaration containing the operation. 1592public ISymbol ContainingSymbol => _containingSymbol; 1617ISymbol containingSymbol, 1629ISymbol containingSymbol,
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (3)
231ISymbol owningSymbol, 296ISymbol owningSymbol, 331ISymbol owningSymbol,
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (20)
36private readonly ConcurrentDictionary<ISymbol, ImmutableDictionary<string, SuppressMessageInfo>> _localSuppressionsBySymbol; 37private StrongBox<ISymbol?>? _lazySuppressMessageAttribute; 38private StrongBox<ISymbol?>? _lazyUnconditionalSuppressMessageAttribute; 43private readonly Dictionary<ISymbol, Dictionary<string, SuppressMessageInfo>> _globalSymbolSuppressions = new Dictionary<ISymbol, Dictionary<string, SuppressMessageInfo>>(); 50public void AddGlobalSymbolSuppression(ISymbol symbol, SuppressMessageInfo info) 69public bool HasGlobalSymbolSuppression(ISymbol symbol, string id, bool isImmediatelyContainingSymbol, out SuppressMessageInfo info) 104_localSuppressionsBySymbol = new ConcurrentDictionary<ISymbol, ImmutableDictionary<string, SuppressMessageInfo>>(); 169foreach (var symbol in declaredSymbols) 208private bool IsDiagnosticGloballySuppressed(string id, ISymbol? symbolOpt, bool isImmediatelyContainingSymbol, out SuppressMessageInfo info) 215private bool IsDiagnosticLocallySuppressed(string id, ISymbol symbol, out SuppressMessageInfo info) 221private ISymbol? SuppressMessageAttribute 229new StrongBox<ISymbol?>(_compilation.GetTypeByMetadataName("System.Diagnostics.CodeAnalysis.SuppressMessageAttribute")), 237private ISymbol? UnconditionalSuppressMessageAttribute 245new StrongBox<ISymbol?>(_compilation.GetTypeByMetadataName("System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute")), 273private ImmutableDictionary<string, SuppressMessageInfo> DecodeLocalSuppressMessageAttributes(ISymbol symbol) 307private void DecodeGlobalSuppressMessageAttributes(Compilation compilation, ISymbol symbol, GlobalSuppressions globalSuppressions) 346foreach (var target in ResolveTargetSymbols(compilation, info.Target, scope)) 353internal static ImmutableArray<ISymbol> ResolveTargetSymbols(Compilation compilation, string target, TargetScope scope) 366return ImmutableArray<ISymbol>.Empty;
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (17)
65public ImmutableArray<ISymbol> Resolve(out bool resolvedWithDocCommentIdFormat) 70return ImmutableArray<ISymbol>.Empty; 82var results = ArrayBuilder<ISymbol>.GetInstance(); 198ISymbol singleResult; 377private TypeInfo? ParseType(ISymbol bindingContext) 491private TypeInfo? ParseIndexedTypeParameter(ISymbol bindingContext) 540private TypeInfo? ParseNamedTypeParameter(ISymbol bindingContext) 574private TypeInfo? ParseNamedType(ISymbol bindingContext) 655private TypeInfo[] ParseTypeArgumentList(ISymbol bindingContext) 724private ISymbol GetFirstMatchingIndexer(ImmutableArray<ISymbol> candidateMembers, ParameterInfo[] parameters) 726foreach (var symbol in candidateMembers) 738private ImmutableArray<IMethodSymbol> GetMatchingMethods(ImmutableArray<ISymbol> candidateMembers, int? arity, ParameterInfo[] parameters, TypeInfo? returnType) 742foreach (var symbol in candidateMembers) 806private ITypeSymbol BindParameterOrReturnType(ISymbol bindingContext, TypeInfo type) 821private static INamedTypeSymbol GetFirstMatchingNamedType(ImmutableArray<ISymbol> candidateMembers, int arity) 828private static INamespaceOrTypeSymbol GetFirstMatchingNamespaceOrType(ImmutableArray<ISymbol> candidateMembers)
DiagnosticAnalyzer\SymbolDeclaredCompilationEvent.cs (2)
19public SymbolDeclaredCompilationEvent(Compilation compilation, ISymbol symbol, SemanticModel? semanticModelWithCachedBoundNodes = null) 27public ISymbol Symbol { get; }
DocumentationCommentId.cs (51)
40private static readonly ListPool<ISymbol> s_symbolListPool = new ListPool<ISymbol>(); 47public static string CreateDeclarationId(ISymbol symbol) 64public static string CreateReferenceId(ISymbol symbol) 85public static ImmutableArray<ISymbol> GetSymbolsForDeclarationId(string id, Compilation compilation) 113private static bool TryGetSymbolsForDeclarationId(string id, Compilation compilation, List<ISymbol> results) 136public static ISymbol? GetFirstSymbolForDeclarationId(string id, Compilation compilation) 163public static ImmutableArray<ISymbol> GetSymbolsForReferenceId(string id, Compilation compilation) 191private static bool TryGetSymbolsForReferenceId(string id, Compilation compilation, List<ISymbol> results) 219public static ISymbol? GetFirstSymbolForReferenceId(string id, Compilation compilation) 315public override void DefaultVisit(ISymbol symbol) 366private ReferenceGenerator GetReferenceGenerator(ISymbol typeParameterContext) 376public override bool DefaultVisit(ISymbol symbol) 507private readonly ISymbol? _typeParameterContext; 509public ReferenceGenerator(StringBuilder builder, ISymbol? typeParameterContext) 515public ISymbol? TypeParameterContext 520private void BuildDottedName(ISymbol symbol) 631var container = symbol.ContainingSymbol?.ContainingSymbol; 643var typeParameterDeclarer = typeParameterSymbol.ContainingSymbol; 645for (var scope = _typeParameterContext; scope != null; scope = scope.ContainingSymbol) 659public static bool ParseDeclaredSymbolId(string id, Compilation compilation, List<ISymbol> results) 678public static bool ParseReferencedSymbolId(string id, Compilation compilation, List<ISymbol> results) 691private static void ParseDeclaredId(string id, ref int index, Compilation compilation, List<ISymbol> results) 822private static ITypeSymbol? ParseTypeSymbol(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext) 843private static void ParseTypeSymbol(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext, List<ISymbol> results) 867foreach (var context in contexts) 931private static void ParseTypeParameterSymbol(string id, ref int index, ISymbol? typeParameterContext, List<ISymbol> results) 968private static void ParseNamedTypeSymbol(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext, List<ISymbol> results) 1079private static bool ParseTypeArguments(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext, List<ITypeSymbol> typeArguments) 1113private static void GetMatchingTypes(List<INamespaceOrTypeSymbol> containers, string memberName, int arity, List<ISymbol> results) 1121private static void GetMatchingTypes(INamespaceOrTypeSymbol container, string memberName, int arity, List<ISymbol> results) 1125foreach (var symbol in members) 1138private static void GetMatchingNamespaceOrTypes(List<INamespaceOrTypeSymbol> containers, string memberName, List<ISymbol> results) 1146private static void GetMatchingNamespaceOrTypes(INamespaceOrTypeSymbol container, string memberName, List<ISymbol> results) 1150foreach (var symbol in members) 1159private static void GetMatchingNamespaces(List<INamespaceOrTypeSymbol> containers, string memberName, List<ISymbol> results) 1167private static void GetMatchingNamespaces(INamespaceOrTypeSymbol container, string memberName, List<ISymbol> results) 1171foreach (var symbol in members) 1180private static void GetMatchingMethods(string id, ref int index, List<INamespaceOrTypeSymbol> containers, string memberName, int arity, Compilation compilation, List<ISymbol> results) 1192foreach (var symbol in members) 1247private static void GetMatchingProperties(string id, ref int index, List<INamespaceOrTypeSymbol> containers, string memberName, Compilation compilation, List<ISymbol> results) 1260foreach (var symbol in members) 1305private static void GetMatchingFields(List<INamespaceOrTypeSymbol> containers, string memberName, List<ISymbol> results) 1311foreach (var symbol in members) 1321private static void GetMatchingEvents(List<INamespaceOrTypeSymbol> containers, string memberName, List<ISymbol> results) 1327foreach (var symbol in members) 1411private static bool ParseParameterList(string id, ref int index, Compilation compilation, ISymbol typeParameterContext, List<ParameterInfo> parameters) 1452private static ParameterInfo? ParseParameter(string id, ref int index, Compilation compilation, ISymbol? typeParameterContext)
Emit\EditAndContinue\DefinitionMap.cs (1)
87protected abstract ISymbolInternal? GetISymbolInternalOrNull(ISymbol symbol);
Emit\EditAndContinue\SymbolChanges.cs (44)
27private readonly IReadOnlyDictionary<ISymbol, SymbolChange> _changes; 33private readonly ISet<ISymbol> _replacedSymbols; 40private readonly IReadOnlyDictionary<ISymbol, ISet<ISymbol>> _deletedMembers; 42private readonly Func<ISymbol, bool> _isAddedSymbol; 44protected SymbolChanges(DefinitionMap definitionMap, IEnumerable<SemanticEdit> edits, Func<ISymbol, bool> isAddedSymbol) 75var containingSymbol = containingType.GetInternalSymbol()?.GetISymbol(); 89private ImmutableArray<ISymbolInternal> GetDeletedMemberInternalSymbols(ISet<ISymbol> deletedMembers, bool includeMethods, bool includeProperties, bool includeEvents) 93foreach (var symbol in deletedMembers) 142public bool IsReplaced(ISymbol symbol, bool checkEnclosingTypes = false) 144ISymbol? currentSymbol = symbol; 168public bool IsAdded(ISymbol symbol) 176public bool RequiresCompilation(ISymbol symbol) 193var current = symbol.GetISymbol(); 307private SymbolChange GetChange(ISymbol symbol) 324var container = GetContainingSymbol(symbol); 402protected abstract ISymbolInternal? GetISymbolInternalOrNull(ISymbol symbol); 406foreach (var symbol in _changes.Keys) 423private static void CalculateChanges(IEnumerable<SemanticEdit> edits, out IReadOnlyDictionary<ISymbol, SymbolChange> changes, out ISet<ISymbol> replaceSymbols, out IReadOnlyDictionary<ISymbol, ISet<ISymbol>> deletedMembers) 425var changesBuilder = new Dictionary<ISymbol, SymbolChange>(); 426HashSet<ISymbol>? lazyReplaceSymbolsBuilder = null; 427Dictionary<ISymbol, ISet<ISymbol>>? lazyDeletedMembersBuilder = null; 445(lazyReplaceSymbolsBuilder ??= new HashSet<ISymbol>()).Add(edit.NewSymbol); 458set = new HashSet<ISymbol>(); 476var member = edit.NewSymbol; 501replaceSymbols = lazyReplaceSymbolsBuilder ?? SpecializedCollections.EmptySet<ISymbol>(); 502deletedMembers = lazyDeletedMembersBuilder ?? SpecializedCollections.EmptyReadOnlyDictionary<ISymbol, ISet<ISymbol>>(); 505private static void AddContainingTypesAndNamespaces(Dictionary<ISymbol, SymbolChange> changes, ISymbol symbol) 509var containingSymbol = GetContainingSymbol(symbol); 530private static ISymbol? GetContainingSymbol(ISymbol symbol) 537var associated = GetAssociatedSymbol(symbol); 558private static ISymbol? GetAssociatedSymbol(ISymbol symbol) 564var associated = ((IFieldSymbol)symbol).AssociatedSymbol; 574var associated = ((IMethodSymbol)symbol).AssociatedSymbol; 588var field = fieldDefinition.GetInternalSymbol()?.GetISymbol(); 594var associatedSymbol = GetAssociatedSymbol(field);
Emit\NoPia\CommonEmbeddedParameter.cs (1)
270return ((ISymbol)UnderlyingParameter).ToDisplayString(SymbolDisplayFormat.ILVisualizationFormat);
Emit\SemanticEdit.cs (6)
28public ISymbol? OldSymbol { get; } 34public ISymbol? NewSymbol { get; } 62public SemanticEdit(SemanticEditKind kind, ISymbol? oldSymbol, ISymbol? newSymbol, Func<SyntaxNode, SyntaxNode?>? syntaxMap, bool preserveLocalVariables) 94public SemanticEdit(SemanticEditKind kind, ISymbol? oldSymbol, ISymbol? newSymbol, Func<SyntaxNode, SyntaxNode?>? syntaxMap = null, bool preserveLocalVariables = false, MethodInstrumentation instrumentation = default)
Generated\Operations.Generated.cs (30)
842ISymbol Member { get; } 2727ISymbol? DeclaredSymbol { get; } 2982ISymbol? DeconstructSymbol { get; } 2994ISymbol? DeclaredSymbol { get; } 3507ISymbol? LengthSymbol { get; } 3512ISymbol? IndexerSymbol { get; } 3520ISymbol? DeclaredSymbol { get; } 3538ISymbol? SliceSymbol { get; } 3572ISymbol LengthSymbol { get; } 3576ISymbol IndexerSymbol { get; } 8197internal DeclarationPatternOperation(ITypeSymbol? matchedType, bool matchesNull, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8206public ISymbol? DeclaredSymbol { get; } 8854internal RecursivePatternOperation(ITypeSymbol matchedType, ISymbol? deconstructSymbol, ImmutableArray<IPatternOperation> deconstructionSubpatterns, ImmutableArray<IPropertySubpatternOperation> propertySubpatterns, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8864public ISymbol? DeconstructSymbol { get; } 8867public ISymbol? DeclaredSymbol { get; } 9984internal ListPatternOperation(ISymbol? lengthSymbol, ISymbol? indexerSymbol, ImmutableArray<IPatternOperation> patterns, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9992public ISymbol? LengthSymbol { get; } 9993public ISymbol? IndexerSymbol { get; } 9995public ISymbol? DeclaredSymbol { get; } 10045internal SlicePatternOperation(ISymbol? sliceSymbol, IPatternOperation? pattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10051public ISymbol? SliceSymbol { get; } 10098internal ImplicitIndexerReferenceOperation(IOperation instance, IOperation argument, ISymbol lengthSymbol, ISymbol indexerSymbol, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10109public ISymbol LengthSymbol { get; } 10110public ISymbol IndexerSymbol { get; } 10245private ImmutableArray<(ISymbol, T)> VisitArray<T>(ImmutableArray<(ISymbol, T)> nodes) where T : IOperation => nodes.SelectAsArray((n, @this) => (n.Item1, @this.Visit(n.Item2)), this)!;
InternalUtilities\GeneratedCodeUtilities.cs (1)
19ISymbol symbol, INamedTypeSymbol generatedCodeAttribute)
Operations\ControlFlowGraphBuilder.cs (1)
3321foreach (ISymbol candidate in valueType.GetMembers(method.Name))
Operations\OperationNodes.cs (5)
184public abstract ISymbol Member { get; } 189public override ISymbol Member => Method; 194public override ISymbol Member => Property; 199public override ISymbol Member => Event; 204public override ISymbol Member => Field;
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (5)
27public ISymbol TargetSymbol { get; } 39/// To get the entire list of attributes, use <see cref="ISymbol.GetAttributes"/> on <see cref="TargetSymbol"/>. 46ISymbol targetSymbol, 110var targetSymbol = 139ISymbol symbol,
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (2)
152var containingSymbol = type.ContainingSymbol; 268foreach (var member in enumType.GetMembers())
SymbolDisplay\AbstractSymbolDisplayVisitor_Minimal.cs (9)
24ImmutableArray<ISymbol> normalSymbols = ShouldRestrictMinimallyQualifyLookupToNamespacesAndTypes() 27ISymbol normalSymbol = SingleSymbolWithArity(normalSymbols, symbol.Arity); 43ImmutableArray<ISymbol> typeOnlySymbols = semanticModelOpt.LookupNamespacesAndTypes(positionOpt, name: symbol.Name); 44ISymbol typeOnlySymbol = SingleSymbolWithArity(typeOnlySymbols, symbol.Arity); 61private static ISymbol SingleSymbolWithArity(ImmutableArray<ISymbol> candidates, int desiredArity) 63ISymbol singleSymbol = null; 64foreach (ISymbol candidate in candidates) 96protected static ITypeSymbol GetSymbolType(ISymbol symbol)
SymbolDisplay\FormattedSymbolList.cs (3)
18private readonly IEnumerable<ISymbol> _symbols; 21internal FormattedSymbolList(IEnumerable<ISymbol> symbols, SymbolDisplayFormat symbolDisplayFormat = null) 35foreach (var symbol in _symbols)
SymbolDisplay\SymbolDisplayFormat.cs (1)
149/// Formats a symbol description in a form that suits <see cref="ISymbol.ToMinimalDisplayString"/>.
SymbolDisplay\SymbolDisplayMiscellaneousOptions.cs (1)
49/// Has no effect outside <see cref="ISymbol.ToMinimalDisplayString"/> and only applies
SymbolDisplay\SymbolDisplayPart.cs (5)
13/// <seealso cref="ISymbol.ToDisplayParts"/> 14/// <seealso cref="ISymbol.ToMinimalDisplayParts"/> 20private readonly ISymbol? _symbol; 32public ISymbol? Symbol { get { return _symbol; } } 40public SymbolDisplayPart(SymbolDisplayPartKind kind, ISymbol? symbol, string text)
Symbols\IErrorTypeSymbol.cs (1)
33ImmutableArray<ISymbol> CandidateSymbols { get; }
Symbols\IFieldSymbol.cs (1)
26ISymbol? AssociatedSymbol { get; }
Symbols\IMethodSymbol.cs (1)
240ISymbol? AssociatedSymbol { get; }
Symbols\INamedTypeSymbol.cs (1)
164ISymbol? AssociatedSymbol { get; }
Symbols\INamespaceOrTypeSymbol.cs (2)
25ImmutableArray<ISymbol> GetMembers(); 32ImmutableArray<ISymbol> GetMembers(string name);
Symbols\ISymbol.cs (6)
24public interface ISymbol : IEquatable<ISymbol?> 69/// Gets the <see cref="ISymbol"/> for the immediately containing symbol. 71ISymbol ContainingSymbol { get; } 206/// Gets the <see cref="ISymbol"/> for the original definition of the symbol. 210ISymbol OriginalDefinition { get; } 314bool Equals([NotNullWhen(returnValue: true)] ISymbol? other, SymbolEqualityComparer equalityComparer);
Symbols\ISymbolExtensions.cs (1)
107internal static bool IsInSource(this ISymbol symbol)
Symbols\ISymbolInternal.cs (3)
11/// An object implementing this interface might also implement <see cref="ISymbol"/> (as is done in VB), 134/// Returns an <see cref="ISymbol"/> instance associated with this symbol. 136ISymbol GetISymbol();
Symbols\ITypeSymbol.cs (2)
107ISymbol? FindImplementationForInterfaceMember(ISymbol interfaceMember);
Symbols\SymbolEqualityComparer.cs (8)
12/// Allows for the comparison of two <see cref="ISymbol"/> instances 14public sealed class SymbolEqualityComparer : IEqualityComparer<ISymbol?> 17/// Compares two <see cref="ISymbol"/> instances based on the default comparison rules, equivalent to calling <see cref="IEquatable{ISymbol}.Equals(ISymbol)"/>. 25/// Compares two <see cref="ISymbol"/> instances, considering that a reference type and the same nullable reference type are not equal. 45/// Determines if two <see cref="ISymbol" /> instances are equal according to the rules of this comparer 50public bool Equals(ISymbol? x, ISymbol? y) 60public int GetHashCode(ISymbol? obj)
Symbols\SymbolVisitor.cs (2)
9public virtual void Visit(ISymbol? symbol) 14public virtual void DefaultVisit(ISymbol symbol)
Symbols\SymbolVisitor`1.cs (2)
9public virtual TResult? Visit(ISymbol? symbol) 16public virtual TResult? DefaultVisit(ISymbol symbol)
Symbols\SymbolVisitor`2.cs (2)
11public virtual TResult Visit(ISymbol? symbol, TArgument argument) 21public virtual TResult DefaultVisit(ISymbol symbol, TArgument argument)
Symbols\TypedConstant.cs (1)
26Debug.Assert(!(value is ISymbol) || value is ISymbolInternal);
TreeDumper.cs (2)
223var symbol = o as ISymbol;
Microsoft.CodeAnalysis.CodeStyle (526)
AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (2)
112foreach (var member in members) 205private static bool IsFieldWrite(IFieldReferenceOperation fieldReference, ISymbol owningSymbol)
AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
71var symbol = context.SemanticModel.GetDeclaredSymbol(namespaceDecl); 177var symbol = semanticModel.GetDeclaredSymbol(typeDecl);
AbstractObjectCreationExpressionAnalyzer.cs (1)
34private ISymbol _initializedSymbol;
AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
39protected abstract ICollection<ISymbol> GetMissingEnumMembers(TSwitchOperation operation);
AbstractPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
29protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchExpressionOperation operation)
AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
29protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation operation)
AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (2)
51protected abstract bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node); 153static bool IsStaticMemberOrIsLocalFunctionHelper(ISymbol symbol)
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
746using var _ = PooledHashSet<ISymbol>.GetInstance(out var processedPartialSymbols); 757foreach (var symbol in symbols)
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (17)
71protected virtual void HandleNamedTypeSymbolStart(SymbolStartAnalysisContext context, Action<ISymbol, ValueUsageInfo> onSymbolUsageFound) 81private readonly Dictionary<ISymbol, ValueUsageInfo> _symbolValueUsageStateMap = new(); 178Action<ISymbol, ValueUsageInfo> onSymbolUsageFound = OnSymbolUsage; 206var symbol = symbolContext.Symbol.OriginalDefinition; 242private void OnSymbolUsage(ISymbol memberSymbol, ValueUsageInfo usageInfo) 261private bool TryRemove(ISymbol memberSymbol, out ValueUsageInfo valueUsageInfo) 278var memberSymbol = memberReference.Member.OriginalDefinition; 364foreach (var symbol in symbolInfo.GetAllSymbols()) 403PooledHashSet<ISymbol> symbolsReferencedInDocComments = null; 410foreach (var member in namedType.GetMembers()) 494ISymbol member) 536private PooledHashSet<ISymbol> GetCandidateSymbolsReferencedInDocComments(INamedTypeSymbol namedTypeSymbol, Compilation compilation, CancellationToken cancellationToken) 538var builder = PooledHashSet<ISymbol>.GetInstance(); 547var symbol = lazyModel.GetSymbolInfo(node, cancellationToken).Symbol?.OriginalDefinition; 569foreach (var member in namedTypeSymbol.GetMembers()) 585private void AddDebuggerDisplayAttributeArgumentsCore(ISymbol symbol, ArrayBuilder<string> builder) 610private bool IsCandidateSymbol(ISymbol memberSymbol)
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
268public bool IsComputingUnusedParams(ISymbol symbol) 273ISymbol symbol,
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (7)
31/// We use this value in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/> to determine whether to bail from analysis or not. 44/// We use this value in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/> to determine whether to bail from analysis or not. 50/// We use this value in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/> to determine whether to bail from analysis or not. 219/// delegate escape, and corresponding bail out from flow analysis in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/>. 267/// delegate escape, and corresponding bail out from flow analysis in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/>. 332private bool ShouldAnalyze(IOperation operationBlock, ISymbol owningSymbol, ref bool hasOperationNoneDescendant) 551ISymbol symbol,
AbstractSpeculationAnalyzer.cs (26)
322protected bool SymbolsAreCompatible(ISymbol? symbol, ISymbol? newSymbol, bool requireNonNullSymbols = false) 326ISymbol? symbol, 327ISymbol? newSymbol, 399private static bool CompareAcrossSemanticModels(ISymbol symbol, ISymbol newSymbol) 645private static bool IsStaticAccess(ISymbol? symbol) 683var originalExpressionSymbol = this.OriginalSemanticModel.GetSymbolInfo(currentOriginalNode).Symbol; 684var replacedExpressionSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(currentReplacedNode).Symbol; 703private static bool IsSymbolSystemObjectInstanceMethod([NotNullWhen(true)] ISymbol? symbol) 714var attributeSym = this.OriginalSemanticModel.GetSymbolInfo(attribute).Symbol; 715var newAttributeSym = this.SpeculativeSemanticModel.GetSymbolInfo(newAttribute).Symbol; 783var implementationMember = expressionType.FindImplementationForInterfaceMember(getEnumerator); 818var symbol = this.OriginalSemanticModel.GetSymbolInfo(type).Symbol; 820ISymbol? newSymbol; 836private static bool IsDelegateInvoke(ISymbol symbol) 842private static bool IsAnonymousDelegateInvoke(ISymbol symbol) 858var symbol = originalSymbolInfo.Symbol; 859var newSymbol = newSymbolInfo.Symbol; 885for (var overriddenMember = newSymbol.GetOverriddenMember(); overriddenMember != null; overriddenMember = overriddenMember.GetOverriddenMember()) 938ISymbol symbol, 939ISymbol newSymbol, 969var implementationMember = newSymbolContainingType.FindImplementationForInterfaceMember(symbol); 1016var receiverSymbol = semanticModel.GetSymbolInfo(receiver).GetAnySymbol(); 1029private bool SymbolsHaveCompatibleParameterLists(ISymbol originalSymbol, ISymbol newSymbol, TExpressionSyntax originalInvocation)
AbstractUseAutoPropertyAnalyzer.cs (1)
110foreach (var member in namedType.GetMembers())
AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
180var symbol = semanticModel.GetSymbolInfo(identifier, cancellationToken).GetAnySymbol();
AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
35protected abstract (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol);
AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
28protected override (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol)
AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
28protected override (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol)
AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
101var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
303var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
79var memberSymbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).GetAnySymbol();
AbstractUseThrowExpressionDiagnosticAnalyzer.cs (6)
106if (!TryDecomposeIfCondition(ifOperation, out var localOrParameter)) 138private static bool ValueIsAccessed(SemanticModel semanticModel, IConditionalOperation ifOperation, IBlockOperation containingBlock, ISymbol localOrParameter, IExpressionStatementOperation expressionStatement, IAssignmentOperation assignmentExpression) 169IBlockOperation containingBlock, IConditionalOperation ifOperation, ISymbol localOrParameter, 191if (!TryGetLocalOrParameterSymbol(assignmentExpression.Value, out var assignmentValue)) 211[NotNullWhen(true)] out ISymbol? localOrParameter) 243[NotNullWhen(true)] out ISymbol? localOrParameter)
AccessibilityExtensions.cs (3)
14internal static bool MatchesSymbol(this Accessibility accessibility, ISymbol symbol) 23private static Accessibility GetAccessibility(ISymbol symbol) 25for (var currentSymbol = symbol; currentSymbol != null; currentSymbol = currentSymbol.ContainingSymbol)
DeclarationModifiers.cs (1)
65public static DeclarationModifiers From(ISymbol symbol)
GeneratedCodeUtilities.cs (1)
19ISymbol symbol, INamedTypeSymbol generatedCodeAttribute)
HashCodeAnalyzer.cs (4)
58public (bool accessesBase, ImmutableArray<ISymbol> members, ImmutableArray<IOperation> statements) GetHashedMembers(ISymbol? owningSymbol, IOperation? operation) 89private (bool accessesBase, ImmutableArray<ISymbol> members)? MatchTuplePattern( 112private (bool accessesBase, ImmutableArray<ISymbol> members)? MatchAccumulatorPattern(
HashCodeAnalyzer.OperationDeconstructor.cs (6)
27private readonly ArrayBuilder<ISymbol> _hashedSymbols; 36_hashedSymbols = ArrayBuilder<ISymbol>.GetInstance(); 43public readonly (bool accessesBase, ImmutableArray<ISymbol> hashedSymbol) GetResult() 153if (TryGetFieldOrProperty(value, out var fieldOrProp) && 177private static bool TryGetFieldOrProperty(IOperation operation, [NotNullWhen(true)] out ISymbol? symbol) 197private readonly bool TryAddSymbol(ISymbol member)
INamedTypeSymbolExtensions.cs (63)
66public static ISymbol? FindImplementationForAbstractMember(this INamedTypeSymbol? type, ISymbol symbol) 77private static bool ImplementationExists(INamedTypeSymbol classOrStructType, ISymbol member) 82ISymbol member, 83Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 151ISymbol member, 152Func<INamedTypeSymbol, ISymbol, bool> isValid, 155var implementation = classOrStructType.FindImplementationForInterfaceMember(member); 175public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembers( 181Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> GetMembers; 201static ImmutableArray<ISymbol> GetImplicitlyImplementableMembers(INamedTypeSymbol type, ISymbol within) 214static bool IsPropertyWithNonPublicImplementableAccessor(ISymbol member) 231static bool IsImplicitlyImplementable(ISymbol member, ISymbol within) 248private static bool IsImplementable(ISymbol m) 251public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembersInThis( 261var implementation = classOrStructType.FindImplementationForInterfaceMember(m); 269public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembersInThis( 272Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 280var implementation = classOrStructType.FindImplementationForInterfaceMember(m); 288public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedExplicitMembers( 302private static ImmutableArray<ISymbol> GetExplicitlyImplementableMembers(INamedTypeSymbol type, ISymbol within) 314private static bool IsPropertyWithInaccessibleImplementableAccessor(ISymbol member, ISymbol within) 326private static bool IsInaccessibleImplementableAccessor(IMethodSymbol? accessor, ISymbol within) 329private static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembers( 332Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented, 333Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 334Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 344return ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)>.Empty; 349return ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)>.Empty; 355return ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)>.Empty; 406private static ImmutableArray<ISymbol> GetUnimplementedMembers( 409Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented, 410Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 411Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 425public static IEnumerable<ISymbol> GetAttributeNamedParameters( 428ISymbol within) 441foreach (var member in type.GetMembers()) 443var namedParameter = IsAttributeNamedParameter(member, within ?? compilation.Assembly); 452private static ISymbol? IsAttributeNamedParameter( 453ISymbol symbol, 454ISymbol within) 494private static ImmutableArray<ISymbol> GetMembers(INamedTypeSymbol type, ISymbol within) 507public static ImmutableArray<ISymbol> GetOverridableMembers( 513var result = new Dictionary<ISymbol, int>(); 544Dictionary<ISymbol, int> result, INamedTypeSymbol containingType, 547foreach (var member in type.GetMembers()) 558private static bool IsOverridable(ISymbol member, INamedTypeSymbol containingType) 579Dictionary<ISymbol, int> result, INamedTypeSymbol containingType, CancellationToken cancellationToken) 581foreach (var member in containingType.GetMembers()) 591var overriddenMember = member.GetOverriddenMember(); 598private static bool IsEqualsObjectOverride(ISymbol? member) 609private static bool IsEqualsObject(ISymbol member)
IParameterSymbolExtensions.cs (1)
42foreach (var member in containingType.GetMembers(parameter.Name))
ISemanticFacts.cs (6)
65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, 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); 105ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken);
ISemanticFactsExtensions.cs (2)
100foreach (var symbol in symbolInfo.CandidateSymbols) 111private static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] ISymbol? symbol)
ISymbolExtensions.cs (88)
19public static string ToNameDisplayString(this ISymbol symbol) 22public static string ToSignatureDisplayString(this ISymbol symbol) 25public static bool HasPublicResultantVisibility(this ISymbol symbol) 28public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 75public static ISymbol? GetOverriddenMember(this ISymbol? symbol) 84public static ImmutableArray<ISymbol> ExplicitInterfaceImplementations(this ISymbol symbol) 87IEventSymbol @event => ImmutableArray<ISymbol>.CastUp(@event.ExplicitInterfaceImplementations), 88IMethodSymbol method => ImmutableArray<ISymbol>.CastUp(method.ExplicitInterfaceImplementations), 89IPropertySymbol property => ImmutableArray<ISymbol>.CastUp(property.ExplicitInterfaceImplementations), 90_ => ImmutableArray.Create<ISymbol>(), 93public static ImmutableArray<ISymbol> ExplicitOrImplicitInterfaceImplementations(this ISymbol symbol) 96return ImmutableArray<ISymbol>.Empty; 107public static ImmutableArray<ISymbol> ImplicitInterfaceImplementations(this ISymbol symbol) 110public static bool IsOverridable([NotNullWhen(true)] this ISymbol? symbol) 119public static bool IsImplementableMember([NotNullWhen(true)] this ISymbol? symbol) 152public static INamedTypeSymbol? GetContainingTypeOrThis(this ISymbol symbol) 162public static bool IsErrorType([NotNullWhen(true)] this ISymbol? symbol) 165public static bool IsModuleType([NotNullWhen(true)] this ISymbol? symbol) 168public static bool IsInterfaceType([NotNullWhen(true)] this ISymbol? symbol) 171public static bool IsArrayType([NotNullWhen(true)] this ISymbol? symbol) 174public static bool IsTupleType([NotNullWhen(true)] this ISymbol? symbol) 177public static bool IsAnonymousFunction([NotNullWhen(true)] this ISymbol? symbol) 180public static bool IsKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind) 183public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind) 186public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind1, SymbolKind kind2) 192public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind1, SymbolKind kind2, SymbolKind kind3) 198public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, params SymbolKind[] kinds) 204public static bool IsReducedExtension([NotNullWhen(true)] this ISymbol? symbol) 207public static bool IsEnumMember([NotNullWhen(true)] this ISymbol? symbol) 210public static bool IsExtensionMethod(this ISymbol symbol) 213public static bool IsLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 216public static bool IsAnonymousOrLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 219public static bool IsModuleMember([NotNullWhen(true)] this ISymbol? symbol) 222public static bool IsConstructor([NotNullWhen(true)] this ISymbol? symbol) 225public static bool IsStaticConstructor([NotNullWhen(true)] this ISymbol? symbol) 228public static bool IsDestructor([NotNullWhen(true)] this ISymbol? symbol) 231public static bool IsUserDefinedOperator([NotNullWhen(true)] this ISymbol? symbol) 234public static bool IsConversion([NotNullWhen(true)] this ISymbol? symbol) 237public static bool IsOrdinaryMethod([NotNullWhen(true)] this ISymbol? symbol) 240public static bool IsOrdinaryMethodOrLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 243public static bool IsDelegateType([NotNullWhen(true)] this ISymbol? symbol) 246public static bool IsAnonymousType([NotNullWhen(true)] this ISymbol? symbol) 249public static bool IsNormalAnonymousType([NotNullWhen(true)] this ISymbol? symbol) 252public static bool IsAnonymousDelegateType([NotNullWhen(true)] this ISymbol? symbol) 255public static bool IsAnonymousTypeProperty([NotNullWhen(true)] this ISymbol? symbol) 258public static bool IsTupleField([NotNullWhen(true)] this ISymbol? symbol) 261public static bool IsIndexer([NotNullWhen(true)] this ISymbol? symbol) 264public static bool IsWriteableFieldOrProperty([NotNullWhen(true)] this ISymbol? symbol) 272public static bool IsRequired([NotNullWhen(true)] this ISymbol? symbol) 275public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 285public static int GetArity(this ISymbol symbol) 294public static ISymbol? GetOriginalUnreducedDefinition(this ISymbol? symbol) 337public static bool IsFunctionValue([NotNullWhen(true)] this ISymbol? symbol) 340public static bool IsThisParameter([NotNullWhen(true)] this ISymbol? symbol) 344public static ISymbol? ConvertThisParameterToType(this ISymbol? symbol) 354public static bool IsParams([NotNullWhen(true)] this ISymbol? symbol) 357public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 365public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 373public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 386public static ImmutableArray<ITypeSymbol> GetTypeArguments(this ISymbol? symbol) 394public static ImmutableArray<ITypeSymbol> GetAllTypeArguments(this ISymbol symbol) 409public static bool IsAttribute([NotNullWhen(true)] this ISymbol? symbol) 418public static bool RequiresUnsafeModifier([NotNullWhen(true)] this ISymbol? member) 425this ISymbol? symbol, 468public static bool IsStaticType([NotNullWhen(true)] this ISymbol? symbol) 471public static bool IsNamespace([NotNullWhen(true)] this ISymbol? symbol) 475[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken) 495public static IEnumerable<IPropertySymbol> GetValidAnonymousTypeProperties(this ISymbol symbol) 501public static Accessibility ComputeResultantAccessibility(this ISymbol? symbol, ITypeSymbol finalDestination) 527public static bool IsInaccessibleLocal(this ISymbol symbol, int position) 545public static bool IsAccessor([NotNullWhen(true)] this ISymbol? symbol) 548public static bool IsPropertyAccessor([NotNullWhen(true)] this ISymbol? symbol) 551public static bool IsEventAccessor([NotNullWhen(true)] this ISymbol? symbol) 554public static bool IsFromSource(this ISymbol symbol) 557public static bool IsNonImplicitAndFromSource(this ISymbol symbol) 560public static ITypeSymbol? GetSymbolType(this ISymbol? symbol) 576public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position) 715public static bool IsKind<TSymbol>(this ISymbol symbol, SymbolKind kind, [NotNullWhen(true)] out TSymbol? result) where TSymbol : class, ISymbol 732public static bool IsSymbolWithSpecialDiscardName(this ISymbol symbol) 741public static bool IsObsolete(this ISymbol symbol)
ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (2)
20private readonly HashSet<ISymbol> _visited = new(); 22public override bool DefaultVisit(ISymbol node)
ISymbolExtensions_Accessibility.cs (11)
17this ISymbol symbol, 18ISymbol within, 39this ISymbol symbol, 51this ISymbol symbol, 64ISymbol symbol, 83ISymbol symbol, 84ISymbol within, // must be assembly or named type symbol 180private static bool IsNamedTypeAccessible(INamedTypeSymbol type, ISymbol within) 218ISymbol within) 253ISymbol within, 413ISymbol within,
ITypeSymbolExtensions.cs (10)
401public static bool CanSupportCollectionInitializer(this ITypeSymbol typeSymbol, ISymbol within) 432public static IEnumerable<T> GetAccessibleMembersInBaseTypes<T>(this ITypeSymbol containingType, ISymbol within) where T : class, ISymbol 443public static ImmutableArray<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol? containingType, ISymbol within) where T : class, ISymbol 488public static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, ISymbol within) where T : class, ISymbol 498private static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, string memberName, ISymbol within) where T : class, ISymbol 683foreach (var member in type.GetMembers())
ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
15public override Accessibility DefaultVisit(ISymbol node)
NamingStyleDiagnosticAnalyzerBase.cs (3)
47protected abstract bool ShouldIgnore(ISymbol symbol); 80var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node, syntaxContext.CancellationToken); 106ISymbol symbol,
NamingStyleRules.cs (5)
26internal bool TryGetApplicableRule(ISymbol symbol, out NamingRule applicableRule) 45private bool IsSymbolNameAnalyzable(ISymbol symbol) 66private static bool DoesSymbolImplementAnotherSymbol(ISymbol symbol) 88private static bool IsInterfaceImplementation(ISymbol symbol) 101foreach (var implementedInterfaceMember in implementedInterfaceMembersWithSameName)
OperationExtensions.cs (2)
27public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 224public static RefKind GetRefKind(this IReturnOperation? operation, ISymbol containingSymbol)
PopulateSwitchExpressionHelpers.cs (6)
17public static ICollection<ISymbol> GetMissingEnumMembers(ISwitchExpressionOperation operation) 30var enumMembers = new Dictionary<long, ISymbol>(); 38return SpecializedCollections.EmptyCollection<ISymbol>(); 53ISwitchExpressionOperation operation, Dictionary<long, ISymbol> enumMembers) 65private static void HandleBinaryPattern(IBinaryPatternOperation? binaryPattern, Dictionary<long, ISymbol> enumMembers) 77private static void RemoveIfConstantPatternHasValue(IOperation operation, Dictionary<long, ISymbol> enumMembers)
PopulateSwitchStatementHelpers.cs (6)
44public static ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation switchStatement) 49var enumMembers = new Dictionary<long, ISymbol>(); 62return SpecializedCollections.EmptyCollection<ISymbol>(); 86private static bool TryRemoveExistingEnumMembers(ISwitchOperation switchStatement, Dictionary<long, ISymbol> enumValues) 134Dictionary<long, ISymbol> enumValues) 136foreach (var member in enumType.GetMembers())
SemanticModelExtensions.cs (11)
47public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 59public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66where TSymbol : class, ISymbol 68for (var symbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 81public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 84(ISymbol)semanticModel.Compilation.Assembly; 93public static IEnumerable<ISymbol> GetExistingSymbols( 115public static HashSet<ISymbol> GetAllDeclaredSymbols( 118var symbols = new HashSet<ISymbol>(); 129HashSet<ISymbol> symbols, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 131var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
SuppressMessageAttributeState.cs (2)
102out ImmutableArray<ISymbol> resolvedSymbols) 107resolvedSymbols = ImmutableArray<ISymbol>.Empty;
SuppressMessageAttributeState.TargetSymbolResolver.cs (17)
65public ImmutableArray<ISymbol> Resolve(out bool resolvedWithDocCommentIdFormat) 70return ImmutableArray<ISymbol>.Empty; 82var results = ArrayBuilder<ISymbol>.GetInstance(); 198ISymbol singleResult; 377private TypeInfo? ParseType(ISymbol bindingContext) 491private TypeInfo? ParseIndexedTypeParameter(ISymbol bindingContext) 540private TypeInfo? ParseNamedTypeParameter(ISymbol bindingContext) 574private TypeInfo? ParseNamedType(ISymbol bindingContext) 655private TypeInfo[] ParseTypeArgumentList(ISymbol bindingContext) 724private ISymbol GetFirstMatchingIndexer(ImmutableArray<ISymbol> candidateMembers, ParameterInfo[] parameters) 726foreach (var symbol in candidateMembers) 738private ImmutableArray<IMethodSymbol> GetMatchingMethods(ImmutableArray<ISymbol> candidateMembers, int? arity, ParameterInfo[] parameters, TypeInfo? returnType) 742foreach (var symbol in candidateMembers) 806private ITypeSymbol BindParameterOrReturnType(ISymbol bindingContext, TypeInfo type) 821private static INamedTypeSymbol GetFirstMatchingNamedType(ImmutableArray<ISymbol> candidateMembers, int arity) 828private static INamespaceOrTypeSymbol GetFirstMatchingNamespaceOrType(ImmutableArray<ISymbol> candidateMembers)
SymbolAnnotation.cs (3)
17public static SyntaxAnnotation Create(ISymbol symbol) 20public static ISymbol? GetSymbol(SyntaxAnnotation annotation, Compilation compilation) 23public static ImmutableArray<ISymbol> GetSymbols(SyntaxAnnotation annotation, Compilation compilation)
SymbolEquivalenceComparer.cs (12)
37IEqualityComparer<ISymbol?> 137public bool Equals(ISymbol? x, ISymbol? y) 146public bool Equals(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 152private bool EqualsCore(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 155public int GetHashCode(ISymbol? x) 158private static ISymbol UnwrapAlias(ISymbol symbol) 161private static SymbolKind GetKindAndUnwrapAlias(ref ISymbol symbol) 179private static bool IsObjectType(ISymbol symbol)
SymbolEquivalenceComparer.EquivalenceVisitor.cs (6)
37public bool AreEquivalent(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 113private bool AreEquivalentWorker(ISymbol x, ISymbol y, SymbolKind k, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 273private static bool HaveSameLocation(ISymbol x, ISymbol y)
SymbolEquivalenceComparer.GetHashCodeVisitor.cs (4)
22private readonly Func<int, ISymbol, int> _symbolAggregator; 36public int GetHashCode(ISymbol? x, int currentHash) 59private int GetHashCodeWorker(ISymbol x, int currentHash) 152foreach (var candidate in errorType.CandidateSymbols)
SymbolInfoExtensions.cs (6)
14public static ImmutableArray<ISymbol> GetAllSymbols(this SymbolInfo info) 17private static ImmutableArray<ISymbol> GetAllSymbolsWorker(this SymbolInfo info) 25var builder = ArrayBuilder<ISymbol>.GetInstance(info.CandidateSymbols.Length + 1); 32public static ISymbol? GetAnySymbol(this SymbolInfo info) 35public static ImmutableArray<ISymbol> GetBestOrAllSymbols(this SymbolInfo info) 46return ImmutableArray<ISymbol>.Empty;
SymbolKey.AbstractSymbolKey.cs (1)
10where TSymbol : class, ISymbol
SymbolKey.AliasSymbolKey.cs (3)
40var target = targetResolution.GetAnySymbol(); 58SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target, 61var symbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken);
SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (2)
21public static void Create(ISymbol symbol, SymbolKeyWriter visitor) 57var symbol = semanticModel.GetSymbolInfo(node, reader.CancellationToken)
SymbolKey.BodyLevelSymbolKey.cs (8)
20public static ImmutableArray<Location> GetBodyLevelSourceLocations(ISymbol symbol, CancellationToken cancellationToken) 39public static void Create(ISymbol symbol, SymbolKeyWriter visitor) 70var container = symbol.ContainingSymbol; 101private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 207foreach (var container in containingSymbol) 231var symbol = resolution.GetAnySymbol(); 255private static IEnumerable<(ISymbol symbol, int ordinal)> EnumerateSymbols( 264var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
SymbolKey.cs (30)
30/// the "same" <see cref="ISymbol.ContainingType"/> and 31/// equal <see cref="ISymbol.MetadataName"/>.</item> 33/// the "same" <see cref="ISymbol.ContainingType"/>, 34/// equal <see cref="ISymbol.MetadataName"/>, 40/// the "same" <see cref="ISymbol.ContainingAssembly"/>. 41/// <see cref="ISymbol.MetadataName"/> is not used because module identity is not important in practice.</item> 43/// the "same" <see cref="ISymbol.ContainingSymbol"/>, 44/// equal <see cref="ISymbol.MetadataName"/>, 48/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 49/// equal <see cref="ISymbol.MetadataName"/>. 54/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 55/// equal <see cref="ISymbol.MetadataName"/>.</item> 59/// the "same" the "same" <see cref="ISymbol.ContainingType"/>, 60/// the "same" <see cref="ISymbol.MetadataName"/>, and have 64/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 65/// the "same" <see cref="ISymbol.MetadataName"/>.</item> 67/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 68/// the "same" <see cref="ISymbol.MetadataName"/>.</item> 75/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see 76/// cref="ISymbol.Kind"/> as the original symbol. The symbol with the same index in the destination tree as the 134public static SymbolKey Create(ISymbol? symbol, CancellationToken cancellationToken = default) 153public static bool CanCreate(ISymbol symbol, CancellationToken cancellationToken) 206public static string CreateString(ISymbol? symbol, CancellationToken cancellationToken = default) 210internal static string CreateStringWorker(int version, ISymbol? symbol, CancellationToken cancellationToken = default) 237/// to the corresponding <see cref="ISymbol"/> in a future <see cref="Compilation"/>. 248where TSymbol : class, ISymbol 264ImmutableArray<ISymbol>.CastUp(symbols.Builder.ToImmutable()), 301string? metadataName) where TSymbol : ISymbol 310foreach (var member in members) 320public static bool IsBodyLevelSymbol(ISymbol symbol)
SymbolKey.NamespaceSymbolKey.cs (3)
64var containingContextualSymbol = containerKind switch 693 => (ISymbol?)null, 90foreach (var container in containingSymbolResolution)
SymbolKey.ParameterSymbolKey.cs (1)
39foreach (var container in containingSymbolResolution)
SymbolKey.SymbolKeyReader.cs (14)
332private readonly Stack<ISymbol?> _contextualSymbolStack = new(); 385where TOwningSymbol : ISymbol 425public ContextualSymbolPopper PushContextualSymbol(ISymbol? contextualSymbol) 431private void PopContextualSymbol(ISymbol? contextualSymbol) 438public ISymbol? CurrentContextualSymbol 459private readonly ISymbol? _contextualSymbol; 461public ContextualSymbolPopper(SymbolKeyReader reader, ISymbol? contextualSymbol) 486public SymbolKeyResolution ReadSymbolKey(ISymbol? contextualSymbol, out string? failureReason) 556Func<TContextualSymbol, int, ISymbol?>? getContextualSymbol, 575var nextContextualSymbol = contextualSymbol is null ? null : getContextualSymbol?.Invoke(contextualSymbol, i); 608Func<TContextualSymbol, int, ISymbol?>? getContextualSymbol, 610where TContextualSymbol : ISymbol 611where TSymbol : ISymbol 746var symbol = semanticModel.GetDeclaredSymbol(node, CancellationToken);
SymbolKey.SymbolKeyWriter.cs (5)
57private readonly Action<ISymbol> _writeSymbolKey; 64private readonly Dictionary<ISymbol, int> _symbolToId = new(); 128internal void WriteSymbolKey(ISymbol? symbol) 273where TSymbol : ISymbol 490public bool ShouldWriteTypeParameterOrdinal(ISymbol symbol, out int methodIndex)
SymbolKey.TupleTypeSymbolKey.cs (1)
41using var _3 = ArrayBuilder<ISymbol>.GetInstance(out var elementTypes);
SymbolKey.TypeParameterSymbolKey.cs (1)
61foreach (var containingSymbol in containingSymbolResolution)
SymbolKeyExtensions.cs (1)
11public static SymbolKey GetSymbolKey(this ISymbol? symbol, CancellationToken cancellationToken = default)
SymbolKeyResolution.cs (8)
11/// single <see cref="ISymbol"/> then that will be returned in <see cref="Symbol"/>. Otherwise, if the key resolves 20private readonly ImmutableArray<ISymbol> _candidateSymbols; 22internal SymbolKeyResolution(ISymbol? symbol) 29internal SymbolKeyResolution(ImmutableArray<ISymbol> candidateSymbols, CandidateReason candidateReason) 38public ISymbol? Symbol { get; } 40public ImmutableArray<ISymbol> CandidateSymbols => _candidateSymbols.NullToEmpty(); 42public Enumerator<ISymbol> GetEnumerator() 45internal Enumerable<TSymbol> OfType<TSymbol>() where TSymbol : ISymbol
SymbolKeyResolution.Enumeration.cs (2)
9public readonly struct Enumerable<TSymbol> where TSymbol : ISymbol 20public struct Enumerator<TSymbol> where TSymbol : ISymbol
SymbolKeyResolutionExtensions.cs (1)
9internal static ISymbol? GetAnySymbol(this SymbolKeyResolution resolution)
SymbolSpecification.cs (7)
101public bool AppliesTo(ISymbol symbol) 163private static bool AnyMatches<TSymbolMatcher>(ImmutableArray<TSymbolMatcher> matchers, ISymbol symbol) 177private static bool AnyMatches(ImmutableArray<Accessibility> matchers, ISymbol symbol) 190private static bool AllMatches<TSymbolMatcher>(ImmutableArray<TSymbolMatcher> matchers, ISymbol symbol) 350bool MatchesSymbol(ISymbol symbol); 396public bool MatchesSymbol(ISymbol symbol) 519public bool MatchesSymbol(ISymbol symbol)
SymbolUsageAnalysis.AnalysisData.cs (14)
35private readonly PooledHashSet<ISymbol> _referenceTakenSymbolsBuilder; 40_referenceTakenSymbolsBuilder = PooledHashSet<ISymbol>.GetInstance(); 61protected abstract PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 66protected abstract PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 132public abstract void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId); 137public abstract void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol); 143protected static PooledDictionary<(ISymbol Symbol, IOperation Write), bool> CreateSymbolsWriteMap( 146var symbolsWriteMap = PooledDictionary<(ISymbol Symbol, IOperation Write), bool>.GetInstance(); 150protected static PooledDictionary<(ISymbol Symbol, IOperation Write), bool> UpdateSymbolsWriteMap( 151PooledDictionary<(ISymbol Symbol, IOperation Write), bool> symbolsWriteMap, 158(ISymbol, IOperation) key = (parameter, null); 178public void OnReadReferenceFound(ISymbol symbol) 199public void OnWriteReferenceFound(ISymbol symbol, IOperation operation, bool maybeWritten, bool isRef) 235foreach (var symbol in SymbolsWriteBuilder.Keys.Select(d => d.symbol).ToArray())
SymbolUsageAnalysis.BasicBlockAnalysisData.cs (8)
30private readonly Dictionary<ISymbol, PooledHashSet<IOperation>> _reachingWrites; 33=> _reachingWrites = new Dictionary<ISymbol, PooledHashSet<IOperation>>(); 64public void Clear(ISymbol symbol) 76public IEnumerable<IOperation> GetCurrentWrites(ISymbol symbol) 91public void OnWriteReferenceFound(ISymbol symbol, IOperation operation, bool maybeWritten) 115var uniqueSymbols = PooledHashSet<ISymbol>.GetInstance(); 128foreach (var symbol in uniqueSymbols) 195private static void AddEntries(Dictionary<ISymbol, PooledHashSet<IOperation>> result, BasicBlockAnalysisData source)
SymbolUsageAnalysis.cs (2)
25public static SymbolUsageResult Run(ControlFlowGraph cfg, ISymbol owningSymbol, CancellationToken cancellationToken) 32public static SymbolUsageResult Run(IOperation rootOperation, ISymbol owningSymbol, CancellationToken cancellationToken)
SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
25private DataFlowAnalyzer(ControlFlowGraph cfg, ISymbol owningSymbol) 40public static SymbolUsageResult RunAnalysis(ControlFlowGraph cfg, ISymbol owningSymbol, CancellationToken cancellationToken)
SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (17)
41private readonly PooledDictionary<CaptureId, PooledHashSet<(ISymbol, IOperation)>> _lValueFlowCapturesMap; 69private readonly PooledDictionary<(int firstBlockOrdinal, int lastBlockOrdinal), PooledHashSet<(ISymbol, IOperation)>> _symbolWritesInsideBlockRangeMap; 73ISymbol owningSymbol, 77PooledDictionary<(ISymbol symbol, IOperation operation), bool> symbolsWriteMap, 78PooledHashSet<ISymbol> symbolsRead, 99_lValueFlowCapturesMap = PooledDictionary<CaptureId, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 103_symbolWritesInsideBlockRangeMap = PooledDictionary<(int firstBlockOrdinal, int lastBlockOrdinal), PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 106public ISymbol OwningSymbol { get; } 108protected override PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 110protected override PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 118ISymbol owningSymbol, 131symbolsRead: PooledHashSet<ISymbol>.GetInstance(), 216private PooledHashSet<(ISymbol, IOperation)> GetOrCreateSymbolWritesInBlockRange(int firstBlockOrdinal, int lastBlockOrdinal, CancellationToken cancellationToken) 225writesInBlockRange = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 461public override void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 465captures = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 513public override void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol)
SymbolUsageAnalysis.OperationTreeAnalysisData.cs (8)
24PooledDictionary<(ISymbol symbol, IOperation operation), bool> symbolsWriteMap, 25PooledHashSet<ISymbol> symbolsRead, 35protected override PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 37protected override PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 42ISymbol owningSymbol, 47symbolsRead: PooledHashSet<ISymbol>.GetInstance(), 66public override void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 78public override void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol)
SymbolUsageAnalysis.Walker.cs (13)
27private ISymbol _currentContainingSymbol; 30private PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>> _pendingWritesMap; 36ISymbol containingSymbol, 52private void Visit(ISymbol containingSymbol, IEnumerable<IOperation> operations, AnalysisData analysisData, CancellationToken cancellationToken) 59_pendingWritesMap = PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 91private void OnReadReferenceFound(ISymbol symbol) 94private void OnWriteReferenceFound(ISymbol symbol, IOperation operation, ValueUsageInfo valueUsageInfo) 102private void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 108private void OnReferenceFound(ISymbol symbol, IOperation operation) 160private bool MakePendingWrite(IOperation operation, ISymbol symbolOpt) 167var set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 176set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 380private void ProcessPossibleDelegateCreationAssignment(ISymbol symbol, IOperation write)
SymbolUsageResult.cs (6)
17ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 18ImmutableHashSet<ISymbol> symbolsRead) 40public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } 45public ImmutableHashSet<ISymbol> SymbolsRead { get; } 54public IEnumerable<(ISymbol Symbol, IOperation WriteOperation)> GetUnreadSymbolWrites() 78public int GetSymbolWriteCount(ISymbol symbol)
UseCompoundAssignmentUtilities.cs (1)
110var symbol = symbolInfo.Symbol;
UseConditionalExpressionForReturnHelpers.cs (1)
16ISymbol containingSymbol,
UseExplicitTupleNameDiagnosticAnalyzer.cs (1)
79foreach (var member in containingType.GetMembers())
UseNamedMemberInitializerAnalyzer.cs (4)
128var leftSymbol = _semanticModel.GetSymbolInfo(leftMemberAccess, _cancellationToken).GetAnySymbol(); 139if (IsExplicitlyImplemented(type, leftSymbol, out var typeMember)) 187ISymbol member, 188out ISymbol typeMember)
UseSystemHashCodeDiagnosticAnalyzer.cs (1)
45var owningSymbol = context.OwningSymbol;
Microsoft.CodeAnalysis.CodeStyle.Fixes (99)
AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
53var symbol = semanticModel.GetDeclaredSymbol(declarator, cancellationToken);
AbstractAddParameterCodeFixProvider.cs (1)
153var symbol = semanticModel.GetSymbolInfo(typeNode, cancellationToken).GetAnySymbol();
AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
114for (ISymbol current = symbol; current != null; current = current.ContainingSymbol)
AbstractCodeGenerationService.cs (12)
66public TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) 116public TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 141public abstract TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 272IEnumerable<ISymbol> members, 295IEnumerable<ISymbol> members, 302foreach (var member in members) 326IEnumerable<ISymbol> members, 334foreach (var member in members) 343private SyntaxNode? GetNewMember(TCodeGenerationContextInfo info, CodeGenerationDestination codeGenerationDestination, ISymbol member, CancellationToken cancellationToken) 359ISymbol member, 374private static bool GeneratingEnum(IEnumerable<ISymbol> members) 456public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
AbstractCodeGenerationService_FindDeclaration.cs (1)
24public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken)
AbstractFlagsEnumGenerator.cs (1)
49var containingSymbol = type.ContainingSymbol;
AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
90var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken) ?? semanticModel.GetSymbolInfo(node, cancellationToken).GetAnySymbol();
AbstractMakeTypePartialCodeFixProvider.cs (1)
38var symbol = semanticModel.GetDeclaredSymbol(declaration, cancellationToken);
AbstractPopulateSwitchCodeFixProvider.cs (1)
40protected abstract ICollection<ISymbol> GetMissingEnumMembers(TSwitchOperation switchOperation);
AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
46protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchExpressionOperation switchOperation)
AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
62protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation switchOperation)
AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
58var symbol = semanticModel.GetDeclaredSymbol(diagnosticNode, cancellationToken);
AbstractSemanticFactsService.cs (10)
30private static readonly Func<ISymbol, bool> s_LocalNameFilter = s => 73string baseName, Func<ISymbol, bool> filter, 90protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken) 113var impl = type.FindImplementationForInterfaceMember(methodToLookFor) ?? methodToLookFor; 151public ISymbol GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 181public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 190public ISymbol FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 193public ISymbol FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 196public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 202public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken)
AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
123protected static bool IsEnumHasFlag(ISymbol symbol)
AbstractUnsealClassCodeFixProvider.cs (1)
42var definition = await SymbolFinder.FindSourceDefinitionAsync(
AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
55var containingSymbol = semanticModel.GetRequiredEnclosingSymbol(ifStatement.SpanStart, cancellationToken);
AddAccessibilityModifiersHelpers.cs (2)
15SyntaxEditor editor, ISymbol symbol, SyntaxNode declaration) 41private static Accessibility GetPreferredAccessibility(ISymbol symbol)
AsyncSymbolVisitor`1.cs (2)
14public override ValueTask<TResult> Visit(ISymbol? symbol) 17public override ValueTask<TResult> DefaultVisit(ISymbol symbol)
CodeGenerationAbstractMethodSymbol.cs (2)
91public override ISymbol ContainingSymbol => this.ContainingType; 101public virtual ISymbol AssociatedSymbol => null;
CodeGenerationAbstractNamedTypeSymbol.cs (1)
114public ISymbol AssociatedSymbol { get; internal set; }
CodeGenerationFieldSymbol.cs (1)
104public ISymbol AssociatedSymbol => null;
CodeGenerationHelpers.cs (3)
41public static TSyntaxNode? AddAnnotationsTo<TSyntaxNode>(ISymbol symbol, TSyntaxNode? syntax) where TSyntaxNode : SyntaxNode 117ISymbol symbol, string commentToken, [NotNullWhen(true)] out string? comment, CancellationToken cancellationToken = default) 151public static IEnumerable<ISymbol> GetMembers(INamedTypeSymbol namedType)
CodeGenerationNamedTypeSymbol.cs (5)
25private readonly ImmutableArray<ISymbol> _members; 41ImmutableArray<ISymbol> members, 119public static ImmutableArray<ISymbol> CandidateSymbols 123return ImmutableArray.Create<ISymbol>(); 162public override ImmutableArray<ISymbol> GetMembers()
CodeGenerationNamespaceInfo.cs (7)
18private readonly IList<ISymbol> _imports; 20private CodeGenerationNamespaceInfo(IList<ISymbol> imports) 25IList<ISymbol> imports) 27var info = new CodeGenerationNamespaceInfo(imports ?? SpecializedCollections.EmptyList<ISymbol>()); 37public static IList<ISymbol> GetImports(INamespaceSymbol @namespace) 40private static IList<ISymbol> GetImports(CodeGenerationNamespaceInfo info) 43? SpecializedCollections.EmptyList<ISymbol>()
CodeGenerationNamespaceOrTypeSymbol.cs (3)
30public virtual ImmutableArray<ISymbol> GetMembers() 31=> ImmutableArray.Create<ISymbol>(); 33public ImmutableArray<ISymbol> GetMembers(string name)
CodeGenerationSymbol.cs (4)
82public virtual ISymbol ContainingSymbol => null; 173public ISymbol OriginalDefinition 222public bool Equals(ISymbol other) 225public bool Equals(ISymbol other, SymbolEqualityComparer equalityComparer)
CodeGenerationSymbolFactory.cs (5)
27public static bool IsCodeGenerationSymbol(this ISymbol symbol) 425ImmutableArray<ISymbol> members = default, 444ImmutableArray<ISymbol> members = default, 496members: ImmutableArray.Create<ISymbol>(invokeMethod), 505public static INamespaceSymbol CreateNamespaceSymbol(string name, IList<ISymbol>? imports = null, IList<INamespaceOrTypeSymbol>? members = null)
CodeGenerationTypeSymbol.cs (2)
62public ISymbol FindImplementationForInterfaceMember(ISymbol interfaceMember) => null;
CodeGenerator.cs (2)
86public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 92public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
Fixer.cs (1)
50using var _ = ArrayBuilder<ISymbol>.GetInstance(out var candidateSymbols);
ICodeGenerationService.cs (4)
84TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 124TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 174Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken); 179bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken);
ISemanticFactsService.cs (1)
35Func<ISymbol, bool> filter, IEnumerable<string> usedNames, CancellationToken cancellationToken);
ISymbolDeclarationService.cs (1)
17ImmutableArray<SyntaxReference> GetDeclarations(ISymbol symbol);
ISymbolExtensions.cs (1)
15public static DeclarationModifiers GetSymbolModifiers(this ISymbol symbol)
ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
16private readonly HashSet<ISymbol> _visited = new(); 28public override void DefaultVisit(ISymbol node)
NamingStyleCodeFixProvider.cs (2)
77var symbol = model.GetDeclaredSymbol(node, context.CancellationToken); 107Document document, ISymbol symbol, string fixedName, CancellationToken cancellationToken)
SimplificationHelpers.cs (4)
64public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 70var typeSymbol = SymbolAnnotation.GetSymbol(annotation1, semanticModel.Compilation); 94public static bool IsValidSymbolInfo([NotNullWhen(true)] ISymbol? symbol) 115internal static bool ShouldSimplifyThisOrMeMemberAccessExpression(SimplifierOptions options, ISymbol symbol)
SyntaxAnnotationExtensions.cs (1)
16where TSymbol : ISymbol
SyntaxGeneratorExtensions.cs (1)
72private static ITypeSymbol GetType(Compilation compilation, ISymbol symbol)
SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (5)
22ImmutableArray<ISymbol> members, 33foreach (var member in members) 84ImmutableArray<ISymbol> members, 104foreach (var symbol in members) 221ISymbol member,
UseSystemHashCodeCodeFixProvider.cs (1)
64var method = semanticModel.GetDeclaredSymbol(methodDecl, cancellationToken);
Microsoft.CodeAnalysis.CSharp (323)
Compilation\CSharpCompilation.cs (8)
2219ISymbol symbol, 2220ISymbol within, 2235ISymbol symbol, 2236ISymbol within, 3441Func<ISymbol, bool> isAddedSymbol, 3680protected override ISymbol? CommonGetAssemblyOrModuleSymbol(MetadataReference reference) 4284public override IEnumerable<ISymbol> GetSymbolsWithName(Func<string, bool> predicate, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default) 4326public override IEnumerable<ISymbol> GetSymbolsWithName(string name, SymbolFilter filter = SymbolFilter.TypeAndMember, CancellationToken cancellationToken = default)
Compilation\CSharpSemanticModel.cs (59)
564var symbol = GetDeclaredSymbol((SingleVariableDesignationSyntax)declaration.Designation, cancellationToken); 591var variable = GetDeclaredSymbol(variableDesignation, cancellationToken); 1084public ImmutableArray<ISymbol> GetMemberGroup(ExpressionSyntax expression, CancellationToken cancellationToken = default(CancellationToken)) 1090: ImmutableArray<ISymbol>.Empty; 1098public ImmutableArray<ISymbol> GetMemberGroup(AttributeSyntax attribute, CancellationToken cancellationToken = default(CancellationToken)) 1104: ImmutableArray<ISymbol>.Empty; 1112public ImmutableArray<ISymbol> GetMemberGroup(ConstructorInitializerSyntax initializer, CancellationToken cancellationToken = default(CancellationToken)) 1118: ImmutableArray<ISymbol>.Empty; 1413public ImmutableArray<ISymbol> LookupSymbols( 1458public new ImmutableArray<ISymbol> LookupBaseMembers( 1483public ImmutableArray<ISymbol> LookupStaticMembers( 1509public ImmutableArray<ISymbol> LookupNamespacesAndTypes( 1531public new ImmutableArray<ISymbol> LookupLabels( 1558private ImmutableArray<ISymbol> LookupSymbolsInternal( 1585return ImmutableArray<ISymbol>.Empty; 1597return ImmutableArray<ISymbol>.Empty; 1636var results = ArrayBuilder<ISymbol>.GetInstance(info.Count); 1681ImmutableArray<ISymbol> sealedResults = results.ToImmutableAndFree(); 1687private void AppendSymbolsWithName(ArrayBuilder<ISymbol> results, string name, Binder binder, NamespaceOrTypeSymbol container, LookupOptions options, LookupSymbolsInfo info) 1721ArrayBuilder<ISymbol> results, 1798private static ImmutableArray<ISymbol> FilterNotReferencable(ImmutableArray<ISymbol> sealedResults) 1800ArrayBuilder<ISymbol> builder = null; 1802foreach (var result in sealedResults) 1810builder = ArrayBuilder<ISymbol>.GetInstance(); 2927public abstract ISymbol GetDeclaredSymbol(MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 2935public abstract ISymbol GetDeclaredSymbol(LocalFunctionStatementSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3009public abstract ISymbol GetDeclaredSymbol(BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3127public abstract ISymbol GetDeclaredSymbol(ArgumentSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3152public abstract ISymbol GetDeclaredSymbol(VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3160public abstract ISymbol GetDeclaredSymbol(SingleVariableDesignationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3214internal abstract ImmutableArray<ISymbol> GetDeclaredSymbols(BaseFieldDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 4081var symbols = ArrayBuilder<ISymbol>.GetInstance(); 4093private static ImmutableArray<IPropertySymbol> FilterOverriddenOrHiddenIndexers(ImmutableArray<ISymbol> symbols) 4096foreach (ISymbol iSymbol in symbols) 4475var tupleElement = GetDeclaredSymbol(tupleArgument, cancellationToken); 4494var symbols = ArrayBuilder<ISymbol>.GetInstance(); 4496foreach (ISymbol invocationSym in containingInvocationInfo.CandidateSymbols) 4882public ISymbol GetEnclosingSymbol(int position) 4973private ImmutableArray<ISymbol> GetMemberGroupFromNode(SyntaxNode node, CancellationToken cancellationToken) 4987return ImmutableArray<ISymbol>.Empty; 4990protected sealed override ImmutableArray<ISymbol> GetMemberGroupCore(SyntaxNode node, CancellationToken cancellationToken) 4993return StaticCast<ISymbol>.From(methodGroup); 5051protected sealed override ISymbol GetDeclaredSymbolCore(SyntaxNode node, CancellationToken cancellationToken) 5127public ISymbol GetDeclaredSymbol(TupleElementSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 5139protected sealed override ImmutableArray<ISymbol> GetDeclaredSymbolsCore(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 5148var symbol = GetDeclaredSymbolCore(declaration, cancellationToken); 5154return ImmutableArray.Create<ISymbol>(); 5162internal override void ComputeDeclarationsInNode(SyntaxNode node, ISymbol associatedSymbol, bool getSymbol, ArrayBuilder<DeclarationInfo> builder, CancellationToken cancellationToken, int? levelsToCompute = null) 5167internal abstract override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol); 5168internal abstract override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol); 5170protected internal override SyntaxNode GetTopmostNodeForDiagnosticAnalysis(ISymbol symbol, SyntaxNode declaringSyntax) 5188protected sealed override ImmutableArray<ISymbol> LookupSymbolsCore(int position, INamespaceOrTypeSymbol container, string name, bool includeReducedExtensionMethods) 5193protected sealed override ImmutableArray<ISymbol> LookupBaseMembersCore(int position, string name) 5198protected sealed override ImmutableArray<ISymbol> LookupStaticMembersCore(int position, INamespaceOrTypeSymbol container, string name) 5203protected sealed override ImmutableArray<ISymbol> LookupNamespacesAndTypesCore(int position, INamespaceOrTypeSymbol container, string name) 5208protected sealed override ImmutableArray<ISymbol> LookupLabelsCore(int position, string name) 5309protected sealed override ISymbol GetEnclosingSymbolCore(int position, CancellationToken cancellationToken) 5338protected sealed override bool IsAccessibleCore(int position, ISymbol symbol)
Compilation\MemberSemanticModel.cs (10)
611public override ISymbol GetDeclaredSymbol(LocalFunctionStatementSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 617public override ISymbol GetDeclaredSymbol(MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 634public override ISymbol GetDeclaredSymbol(BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 670public override ISymbol GetDeclaredSymbol(VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 676public override ISymbol GetDeclaredSymbol(SingleVariableDesignationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 812internal override ImmutableArray<ISymbol> GetDeclaredSymbols(BaseFieldDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 815return ImmutableArray.Create<ISymbol>(); 1103public override ISymbol GetDeclaredSymbol(ArgumentSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)) 2325internal sealed override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) 2330internal sealed override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol)
Compilation\SpeculativeSemanticModelWithMemberModel.cs (9)
276public override ISymbol GetDeclaredSymbol(LocalFunctionStatementSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 281public override ISymbol GetDeclaredSymbol(MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 296public override ISymbol GetDeclaredSymbol(BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 326public override ISymbol GetDeclaredSymbol(VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 331public override ISymbol GetDeclaredSymbol(SingleVariableDesignationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 366internal override ImmutableArray<ISymbol> GetDeclaredSymbols(BaseFieldDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 436public override ISymbol GetDeclaredSymbol(ArgumentSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)) 501internal sealed override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) 506internal override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol)
Compilation\SyntaxTreeSemanticModel.cs (16)
234result = new SymbolInfo(ImmutableArray.Create<ISymbol>(info.Symbol), CandidateReason.NotATypeOrNamespace); 462public override ISymbol GetDeclaredSymbol(ArgumentSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1265var declaredSymbol = GetDeclaredSymbol(variableDecl); 1446public override ISymbol GetDeclaredSymbol(MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1485public override ISymbol GetDeclaredSymbol(LocalFunctionStatementSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1525public override ISymbol GetDeclaredSymbol(BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1820public override ISymbol GetDeclaredSymbol(VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1841public override ISymbol GetDeclaredSymbol(SingleVariableDesignationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1845ISymbol local = memberModel?.GetDeclaredSymbol(declarationSyntax, cancellationToken); 1975internal override ImmutableArray<ISymbol> GetDeclaredSymbols(BaseFieldDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1979var builder = new ArrayBuilder<ISymbol>(); 1983var field = this.GetDeclaredSymbol(declarator, cancellationToken) as ISymbol; 2140ISymbol parameterizedSymbol = null; 2401internal override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) 2511internal override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol)
Compiler\DocumentationCommentCompiler.cs (1)
79/// <param name="assemblyName">Assembly name override, if specified. Otherwise the <see cref="ISymbol.Name"/> of the source assembly is used.</param>
CSharpDeclarationComputer.cs (2)
36ISymbol associatedSymbol, 58ISymbol associatedSymbol,
CSharpExtensions.cs (12)
917public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel? semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken = default(CancellationToken)) 926return ImmutableArray.Create<ISymbol>(); 930public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel? semanticModel, AttributeSyntax attribute, CancellationToken cancellationToken = default(CancellationToken)) 939return ImmutableArray.Create<ISymbol>(); 943public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel? semanticModel, ConstructorInitializerSyntax initializer, CancellationToken cancellationToken = default(CancellationToken)) 952return ImmutableArray.Create<ISymbol>(); 1319public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, MemberDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1395public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, BasePropertyDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1458public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, ArgumentSyntax declaratorSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1476public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, SingleVariableDesignationSyntax designationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1485public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, VariableDeclaratorSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 1494public static ISymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, TupleElementSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Emitter\EditAndContinue\CSharpDefinitionMap.cs (1)
45protected override ISymbolInternal? GetISymbolInternalOrNull(ISymbol symbol)
Emitter\EditAndContinue\CSharpSymbolChanges.cs (2)
14public CSharpSymbolChanges(DefinitionMap definitionMap, IEnumerable<SemanticEdit> edits, Func<ISymbol, bool> isAddedSymbol) 18protected override ISymbolInternal? GetISymbolInternalOrNull(ISymbol symbol)
Emitter\EditAndContinue\EmitHelpers.cs (1)
26Func<ISymbol, bool> isAddedSymbol,
Emitter\EditAndContinue\PEDeltaAssemblyBuilder.cs (1)
38Func<ISymbol, bool> isAddedSymbol)
Emitter\Model\ExpandedVarargsMethodReference.cs (2)
216Debug.Assert(!(value is ISymbol)); 218var symbol = (value as ISymbolInternal)?.GetISymbol();
Errors\MessageProvider.cs (1)
110public override string GetErrorDisplayString(ISymbol symbol)
FlowAnalysis\CSharpDataFlowAnalysis.cs (37)
28private ImmutableArray<ISymbol> _variablesDeclared; 30private ImmutableArray<ISymbol> _dataFlowsIn; 31private ImmutableArray<ISymbol> _dataFlowsOut; 32private ImmutableArray<ISymbol> _definitelyAssignedOnEntry; 33private ImmutableArray<ISymbol> _definitelyAssignedOnExit; 34private ImmutableArray<ISymbol> _alwaysAssigned; 35private ImmutableArray<ISymbol> _readInside; 36private ImmutableArray<ISymbol> _writtenInside; 37private ImmutableArray<ISymbol> _readOutside; 38private ImmutableArray<ISymbol> _writtenOutside; 39private ImmutableArray<ISymbol> _captured; 41private ImmutableArray<ISymbol> _capturedInside; 42private ImmutableArray<ISymbol> _capturedOutside; 43private ImmutableArray<ISymbol> _unsafeAddressTaken; 57public override ImmutableArray<ISymbol> VariablesDeclared 68: ImmutableArray<ISymbol>.Empty; 95public override ImmutableArray<ISymbol> DataFlowsIn 102var result = _context.Failed ? ImmutableArray<ISymbol>.Empty : 115public override ImmutableArray<ISymbol> DefinitelyAssignedOnEntry 122public override ImmutableArray<ISymbol> DefinitelyAssignedOnExit 125private (ImmutableArray<ISymbol> onEntry, ImmutableArray<ISymbol> onExit) ComputeDefinitelyAssignedValues() 132var entryResult = ImmutableArray<ISymbol>.Empty; 133var exitResult = ImmutableArray<ISymbol>.Empty; 152public override ImmutableArray<ISymbol> DataFlowsOut 161: ImmutableArray<ISymbol>.Empty; 172public override ImmutableArray<ISymbol> AlwaysAssigned 180: ImmutableArray<ISymbol>.Empty; 191public override ImmutableArray<ISymbol> ReadInside 207public override ImmutableArray<ISymbol> WrittenInside 223public override ImmutableArray<ISymbol> ReadOutside 239public override ImmutableArray<ISymbol> WrittenOutside 285public override ImmutableArray<ISymbol> Captured 298public override ImmutableArray<ISymbol> CapturedInside 311public override ImmutableArray<ISymbol> CapturedOutside 331public override ImmutableArray<ISymbol> UnsafeAddressTaken 390private static ImmutableArray<ISymbol> Normalize(IEnumerable<Symbol> data)
FlowAnalysis\DataFlowsOutWalker.cs (4)
25private readonly ImmutableArray<ISymbol> _dataFlowsIn; 27private DataFlowsOutWalker(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, HashSet<Symbol> unassignedVariables, ImmutableArray<ISymbol> dataFlowsIn) 33internal static HashSet<Symbol> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, HashSet<Symbol> unassignedVariables, ImmutableArray<ISymbol> dataFlowsIn) 78foreach (ISymbol variable in _dataFlowsIn)
Operations\CSharpOperationFactory.cs (2)
1582var indexerSymbol = Binder.GetIndexerOrImplicitIndexerSymbol(boundIndexerAccess).GetPublicSymbol(); 2421ISymbol? variable = boundDeclarationPattern.Variable.GetPublicSymbol();
SymbolDisplay\SymbolDisplay.cs (5)
31ISymbol symbol, 69ISymbol symbol, 110ISymbol symbol, 157ISymbol symbol, 203ISymbol symbol,
SymbolDisplay\SymbolDisplayVisitor.cs (6)
60internal SymbolDisplayPart CreatePart(SymbolDisplayPartKind kind, ISymbol symbol, string text) 308private void AddAccessibilityIfNeeded(ISymbol symbol) 323private static bool IsLocalFunction(ISymbol symbol) 333private void AddAccessibility(ISymbol symbol) 366private bool ShouldVisitNamespace(ISymbol containingSymbol) 404private static bool IsEnumMember(ISymbol symbol)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
923private void AddMemberModifiersIfNeeded(ISymbol symbol) 1048private void AddExplicitInterfaceIfNeeded<T>(ImmutableArray<T> implementedMembers) where T : ISymbol
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
270var containingSymbol = symbol.ContainingSymbol; 774private void AddTypeArguments(ISymbol owner, ImmutableArray<ImmutableArray<CustomModifier>> modifiers)
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (2)
77var firstSymbol = symbols.OfType<ISymbol>().FirstOrDefault();
Symbols\AliasSymbol.cs (1)
275protected override ISymbol CreateISymbol()
Symbols\ArrayTypeSymbol.cs (1)
471protected sealed override ISymbol CreateISymbol()
Symbols\AssemblySymbol.cs (1)
1044protected override ISymbol CreateISymbol()
Symbols\DiscardSymbol.cs (1)
41protected override ISymbol CreateISymbol()
Symbols\DynamicTypeSymbol.cs (1)
237protected override ISymbol CreateISymbol()
Symbols\ErrorTypeSymbol.cs (1)
539protected sealed override ISymbol CreateISymbol()
Symbols\EventSymbol.cs (1)
323protected sealed override ISymbol CreateISymbol()
Symbols\FieldSymbol.cs (1)
506protected override ISymbol CreateISymbol()
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
119protected override ISymbol CreateISymbol()
Symbols\FunctionTypeSymbol.cs (1)
144protected override ISymbol CreateISymbol() => throw ExceptionUtilities.Unreachable();
Symbols\LabelSymbol.cs (1)
172protected sealed override ISymbol CreateISymbol()
Symbols\LocalSymbol.cs (1)
378protected sealed override ISymbol CreateISymbol()
Symbols\MethodSymbol.cs (1)
1192protected sealed override ISymbol CreateISymbol()
Symbols\ModuleSymbol.cs (1)
416protected override ISymbol CreateISymbol()
Symbols\NamedTypeSymbol.cs (1)
1696protected override ISymbol CreateISymbol()
Symbols\NamespaceSymbol.cs (1)
377protected sealed override ISymbol CreateISymbol()
Symbols\ParameterSymbol.cs (1)
435protected override ISymbol CreateISymbol()
Symbols\PointerTypeSymbol.cs (1)
299protected override ISymbol CreateISymbol()
Symbols\PropertySymbol.cs (1)
420protected sealed override ISymbol CreateISymbol()
Symbols\PublicModel\ErrorTypeSymbol.cs (1)
34ImmutableArray<ISymbol> IErrorTypeSymbol.CandidateSymbols => _underlying.CandidateSymbols.SelectAsArray(s => s.GetPublicSymbol());
Symbols\PublicModel\FieldSymbol.cs (1)
26ISymbol IFieldSymbol.AssociatedSymbol
Symbols\PublicModel\MethodSymbol.cs (1)
217ISymbol IMethodSymbol.AssociatedSymbol
Symbols\PublicModel\NamedTypeSymbol.cs (1)
146ISymbol INamedTypeSymbol.AssociatedSymbol
Symbols\PublicModel\NamespaceOrTypeSymbol.cs (2)
13ImmutableArray<ISymbol> INamespaceOrTypeSymbol.GetMembers() 18ImmutableArray<ISymbol> INamespaceOrTypeSymbol.GetMembers(string name)
Symbols\PublicModel\PreprocessingSymbol.cs (40)
21ISymbol ISymbol.OriginalDefinition => this; 23ISymbol? ISymbol.ContainingSymbol => null; 25INamedTypeSymbol? ISymbol.ContainingType => null; 50bool IEquatable<ISymbol?>.Equals(ISymbol? other) 55bool ISymbol.Equals(ISymbol? other, CodeAnalysis.SymbolEqualityComparer equalityComparer) 60ImmutableArray<Location> ISymbol.Locations => ImmutableArray<Location>.Empty; 62ImmutableArray<SyntaxReference> ISymbol.DeclaringSyntaxReferences => ImmutableArray<SyntaxReference>.Empty; 64ImmutableArray<AttributeData> ISymbol.GetAttributes() => ImmutableArray<AttributeData>.Empty; 66Accessibility ISymbol.DeclaredAccessibility => Accessibility.NotApplicable; 68void ISymbol.Accept(SymbolVisitor visitor) => throw new System.NotSupportedException(); 70TResult ISymbol.Accept<TResult>(SymbolVisitor<TResult> visitor) => throw new System.NotSupportedException(); 72TResult ISymbol.Accept<TArgument, TResult>(SymbolVisitor<TArgument, TResult> visitor, TArgument argument) => throw new System.NotSupportedException(); 74string? ISymbol.GetDocumentationCommentId() => null; 76string? ISymbol.GetDocumentationCommentXml(CultureInfo? preferredCulture, bool expandIncludes, CancellationToken cancellationToken) => null; 78string ISymbol.ToDisplayString(SymbolDisplayFormat? format) 83ImmutableArray<SymbolDisplayPart> ISymbol.ToDisplayParts(SymbolDisplayFormat? format) 88string ISymbol.ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat? format) 93ImmutableArray<SymbolDisplayPart> ISymbol.ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat? format) 98SymbolKind ISymbol.Kind => SymbolKind.Preprocessing; 100string ISymbol.Language => LanguageNames.CSharp; 102string ISymbol.Name => _name; 104string ISymbol.MetadataName => _name; 106int ISymbol.MetadataToken => 0; 108IAssemblySymbol? ISymbol.ContainingAssembly => null; 110IModuleSymbol? ISymbol.ContainingModule => null; 112INamespaceSymbol? ISymbol.ContainingNamespace => null; 114bool ISymbol.IsDefinition => true; 116bool ISymbol.IsStatic => false; 118bool ISymbol.IsVirtual => false; 120bool ISymbol.IsOverride => false; 122bool ISymbol.IsAbstract => false; 124bool ISymbol.IsSealed => false; 126bool ISymbol.IsExtern => false; 128bool ISymbol.IsImplicitlyDeclared => false; 130bool ISymbol.CanBeReferencedByName => SyntaxFacts.IsValidIdentifier(_name) && !SyntaxFacts.ContainsDroppedIdentifierCharacters(_name); 132bool ISymbol.HasUnsupportedMetadata => false;
Symbols\PublicModel\Symbol.cs (40)
55ISymbol ISymbol.OriginalDefinition 63ISymbol ISymbol.ContainingSymbol 71INamedTypeSymbol ISymbol.ContainingType 89bool IEquatable<ISymbol>.Equals(ISymbol other) 94bool ISymbol.Equals(ISymbol other, CodeAnalysis.SymbolEqualityComparer equalityComparer) 104ImmutableArray<Location> ISymbol.Locations 112ImmutableArray<SyntaxReference> ISymbol.DeclaringSyntaxReferences 120ImmutableArray<AttributeData> ISymbol.GetAttributes() 125Accessibility ISymbol.DeclaredAccessibility 133void ISymbol.Accept(SymbolVisitor visitor) 140TResult ISymbol.Accept<TResult>(SymbolVisitor<TResult> visitor) 147TResult ISymbol.Accept<TArgument, TResult>(SymbolVisitor<TArgument, TResult> visitor, TArgument argument) 154string ISymbol.GetDocumentationCommentId() 159string ISymbol.GetDocumentationCommentXml(CultureInfo preferredCulture, bool expandIncludes, CancellationToken cancellationToken) 164string ISymbol.ToDisplayString(SymbolDisplayFormat format) 169ImmutableArray<SymbolDisplayPart> ISymbol.ToDisplayParts(SymbolDisplayFormat format) 174string ISymbol.ToMinimalDisplayString(SemanticModel semanticModel, int position, SymbolDisplayFormat format) 179ImmutableArray<SymbolDisplayPart> ISymbol.ToMinimalDisplayParts(SemanticModel semanticModel, int position, SymbolDisplayFormat format) 195SymbolKind ISymbol.Kind => UnderlyingSymbol.Kind; 197string ISymbol.Language => LanguageNames.CSharp; 199string ISymbol.Name => UnderlyingSymbol.Name; 201string ISymbol.MetadataName => UnderlyingSymbol.MetadataName; 203int ISymbol.MetadataToken => UnderlyingSymbol.MetadataToken; 205IAssemblySymbol ISymbol.ContainingAssembly => UnderlyingSymbol.ContainingAssembly.GetPublicSymbol(); 207IModuleSymbol ISymbol.ContainingModule => UnderlyingSymbol.ContainingModule.GetPublicSymbol(); 209INamespaceSymbol ISymbol.ContainingNamespace => UnderlyingSymbol.ContainingNamespace.GetPublicSymbol(); 211bool ISymbol.IsDefinition => UnderlyingSymbol.IsDefinition; 213bool ISymbol.IsStatic 218bool ISymbol.IsVirtual 223bool ISymbol.IsOverride 228bool ISymbol.IsAbstract 236bool ISymbol.IsSealed 244bool ISymbol.IsExtern => UnderlyingSymbol.IsExtern; 246bool ISymbol.IsImplicitlyDeclared => UnderlyingSymbol.IsImplicitlyDeclared; 248bool ISymbol.CanBeReferencedByName => UnderlyingSymbol.CanBeReferencedByName; 250bool ISymbol.HasUnsupportedMetadata => UnderlyingSymbol.HasUnsupportedMetadata;
Symbols\PublicModel\TypeSymbol.cs (6)
41bool ISymbol.IsDefinition 45return (object)this == ((ISymbol)this).OriginalDefinition; 49bool ISymbol.Equals(ISymbol other, CodeAnalysis.SymbolEqualityComparer equalityComparer) 110ISymbol ITypeSymbol.FindImplementationForInterfaceMember(ISymbol interfaceMember)
Symbols\RangeVariableSymbol.cs (1)
178protected override ISymbol CreateISymbol()
Symbols\Source\SourceAssemblySymbol.cs (1)
2862protected override ISymbol CreateISymbol()
Symbols\Symbol.cs (4)
33private ISymbol _lazyISymbol; 249ISymbol ISymbolInternal.GetISymbol() => this.ISymbol; 1654protected abstract ISymbol CreateISymbol(); 1656internal ISymbol ISymbol
Symbols\SymbolExtensions.cs (18)
378internal static Symbol? EnsureCSharpSymbolOrNull(this ISymbol? symbol, string paramName) 398return (AssemblySymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 404return (NamespaceOrTypeSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 410return (NamespaceSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 416return (TypeSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 422return (NamedTypeSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 428return (TypeParameterSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 434return (EventSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 551where TISymbol : class, ISymbol 557internal static ISymbol? GetPublicSymbol(this Symbol? symbol) 559return symbol.GetPublicSymbol<ISymbol>(); 682internal static IEnumerable<ISymbol?> GetPublicSymbols(this IEnumerable<Symbol?> symbols) 684return symbols.Select(p => p.GetPublicSymbol<ISymbol>()); 688where TISymbol : class, ISymbol 698internal static ImmutableArray<ISymbol> GetPublicSymbols(this ImmutableArray<Symbol> symbols) 700return GetPublicSymbols<ISymbol>(symbols); 759internal static TSymbol? GetSymbol<TSymbol>(this ISymbol? symbol) 766internal static Symbol? GetSymbol(this ISymbol? symbol)
Symbols\TypedConstantExtensions.cs (2)
83foreach (var member in members) 162foreach (var member in members)
Symbols\TypeParameterSymbol.cs (1)
695protected sealed override ISymbol CreateISymbol()
Microsoft.CodeAnalysis.CSharp.CodeStyle (76)
ArgumentSyntaxExtensions.cs (1)
59foreach (var symbol in symbols)
AttributeArgumentSyntaxExtensions.cs (1)
43foreach (var symbol in symbols)
CastSimplifier.cs (16)
559var castedSymbol = semanticModel.GetSymbolInfo(castedExpressionNode, cancellationToken).GetAnySymbol(); 569var memberSymbol = semanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).GetAnySymbol(); 810foreach (var sym in type.GetMembers(opName)) 949var symbol = semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken); 1022var oldSymbolInfo = originalSemanticModel.GetSymbolInfo(currentOld, cancellationToken).Symbol; 1023var newSymbolInfo = rewrittenSemanticModel.GetSymbolInfo(currentNew, cancellationToken).Symbol; 1075var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1080var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1146var implementationMember = rewrittenContainingType.FindImplementationForInterfaceMember(originalMemberSymbol); 1160for (var current = rewrittenMemberSymbol; current != null; current = current.GetOverriddenMember()) 1184var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1189var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1196private static bool IsComplementaryDelegateInvoke(ISymbol originalMemberSymbol, ISymbol rewrittenMemberSymbol) 1259ISymbol originalMemberSymbol, ISymbol rewrittenMemberSymbol, CancellationToken cancellationToken)
ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (2)
82private (VariableDeclaratorSyntax, ISymbol)? TryGetVariableDeclaratorAndSymbol(SemanticModel semanticModel) 89var symbol = semanticModel.GetSymbolInfo(_assignmentTargetOpt).Symbol;
CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (2)
120var symbol = semanticModel.GetSymbolInfo(conditionalAccessExpression.WhenNotNull, cancellationToken).GetAnySymbol(); 165var symbol = semanticModel.GetSymbolInfo(conditionalAccessExpression.WhenNotNull, cancellationToken).GetAnySymbol();
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
165var asOperand = semanticModel.GetSymbolInfo(asExpression.Left, cancellationToken).Symbol;
CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
323ISymbol outSymbol, 358var symbol = semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol;
CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
101foreach (var member in typeSymbol.GetMembers())
CSharpNamingStyleDiagnosticAnalyzer.cs (1)
27protected override bool ShouldIgnore(ISymbol symbol)
CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (2)
30protected override bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node) 47private static bool IsInPropertyOrFieldInitialization(ISymbol containingSymbol, SyntaxNode node)
CSharpSemanticFacts.cs (15)
56public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 62var symbol = semanticModel.GetDeclaredSymbol(ancestor, cancellationToken); 243public IEnumerable<ISymbol> GetDeclaredSymbols( 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) 280return ImmutableArray<ISymbol>.Empty; 284AssignmentExpressionSyntax _ when token.Kind() == SyntaxKind.EqualsToken => GetDeconstructionAssignmentMethods(semanticModel, node).As<ISymbol>(), 285ForEachVariableStatementSyntax _ when token.Kind() == SyntaxKind.InKeyword => GetDeconstructionForEachMethods(semanticModel, node).As<ISymbol>(), 296private static ImmutableArray<ISymbol> GetSymbolInfo(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 346return ImmutableArray<ISymbol>.Empty; 352var symbol = semanticModel.GetSymbolInfo(node, cancellationToken).GetAnySymbol(); 358return ImmutableArray.Create<ISymbol>(type); 368public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken) 378var localFunctionSymbol = semanticModel.GetDeclaredSymbol(localFunction, cancellationToken);
CSharpUseAutoPropertyAnalyzer.cs (3)
114var exprSymbol = semanticModel.GetSymbolInfo(memberAccess.Expression, cancellationToken).GetAnySymbol(); 126foreach (var symbol in symbolInfo.CandidateSymbols) 129void AddIneligibleField(ISymbol? symbol)
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
196var symbol = semanticModel.GetSymbolInfo(binaryExpression, cancellationToken).Symbol; 213var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
CSharpUseDeconstructionDiagnosticAnalyzer.cs (3)
254var symbol = semanticModel.GetSymbolInfo(identifierName, cancellationToken).GetAnySymbol(); 264var member = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).GetAnySymbol(); 285private static IEnumerable<ISymbol> GetExistingSymbols(
CSharpUseImplicitTypeHelper.cs (1)
100var conflict = semanticModel.GetSpeculativeSymbolInfo(typeName.SpanStart, candidateReplacementNode, SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol;
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (3)
107var local = semanticModel.GetDeclaredSymbol(localDeclaration.Declaration.Variables[0], cancellationToken); 202SemanticModel semanticModel, INamedTypeSymbol? expressionTypeOpt, ISymbol local, BlockSyntax block, 366var localEnclosingSymbol = semanticModel.GetEnclosingSymbol(localDeclaration.SpanStart, cancellationToken);
ExpressionSyntaxExtensions.cs (3)
369var symbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol; 422private static bool CanReplace(ISymbol symbol) 645var instanceSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).GetAnySymbol();
Helpers.cs (1)
33public static bool IsPublicInstance(ISymbol symbol)
InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
303var initializerSymbol = semanticModel.GetSymbolInfo(initializer, cancellationToken).GetAnySymbol();
MakeLocalFunctionStaticHelper.cs (2)
30static bool IsChildOrSelf(LocalFunctionStatementSyntax containingLocalFunction, ISymbol calledLocationFunction) 43public static bool CanMakeLocalFunctionStaticByRefactoringCaptures(LocalFunctionStatementSyntax localFunction, SemanticModel semanticModel, out ImmutableArray<ISymbol> captures)
ParenthesizedExpressionSyntaxExtensions.cs (1)
311var exprSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol;
SemanticModelExtensions.cs (5)
39public static ImmutableArray<ISymbol> LookupName( 49return ImmutableArray.Create<ISymbol>(); 102public static ImmutableArray<ISymbol> LookupName( 286var symbol = semanticModel.GetDeclaredSymbol(type.Parent.Parent.Parent, cancellationToken); 298var symbol = semanticModel.GetDeclaredSymbol(variableDeclaration.Variables[0], cancellationToken);
SpeculationAnalyzer.cs (4)
555var originalSymbol = this.OriginalSemanticModel.GetSymbolInfo(ctorInitializer, CancellationToken).Symbol; 556var newSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(newCtorInitializer, CancellationToken).Symbol; 562var originalSymbol = this.OriginalSemanticModel.GetCollectionInitializerSymbolInfo(originalInitializer, CancellationToken).Symbol; 563var newSymbol = this.SpeculativeSemanticModel.GetCollectionInitializerSymbolInfo(newInitializer, CancellationToken).Symbol;
SyntaxNodeExtensions.cs (1)
1008foreach (var symbol in info.GetAllSymbols())
UseExpressionBodyForLocalFunctionHelper.cs (1)
60var symbol = semanticModel.GetDeclaredSymbol(statement);
UseSimpleUsingStatementDiagnosticAnalyzer.cs (1)
151private static bool DeclaredLocalCausesCollision(ILookup<string, ISymbol> symbolNameToExistingSymbol, ImmutableArray<ILocalSymbol> locals)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (81)
AddInheritdocCodeFixProvider.cs (1)
72var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
ConvertToRecordHelpers.cs (26)
312var positionalParam = param.ContainingSymbol.ContainingType.GetMembers().FirstOrDefault(member 376var dictionaryBuilder = ImmutableDictionary<ISymbol, ExpressionSyntax>.Empty.ToBuilder(); 401ImmutableDictionary<ISymbol, ExpressionSyntax> assignmentValues) 417private static ImmutableDictionary<ISymbol, T> GetAssignmentValuesForConstructor<T>( 422var dictionaryBuilder = ImmutableDictionary<ISymbol, T>.Empty.ToBuilder(); 428return ImmutableDictionary<ISymbol, T>.Empty; 443ISymbol? symbol = assignee switch 459return ImmutableDictionary<ISymbol, T>.Empty; 505ISymbol? otherC = null; 531value, successRequirement: true, type, fields, out var _2)) 568[NotNullWhen(true)] out ISymbol? assignedVariable) 608private static ISymbol? GetReferencedSymbolObject(IOperation reference) 656ISymbol otherObject) 725ISymbol currentObject, 726ISymbol otherObject, 784ISymbol currentObject, 786[NotNullWhen(true)] out ISymbol? boundVariable, 832bool TryGetBoundVariableForIsPattern(IPatternOperation isPattern, [NotNullWhen(true)] out ISymbol? boundVariable) 853DeclaredSymbol: ISymbol otherVar, 879ISymbol otherC, 917ISymbol currentObject, 918ISymbol otherObject, 921var leftObject = GetReferencedSymbolObject(memberReference1.Instance!); 922var rightObject = GetReferencedSymbolObject(memberReference2.Instance!); 959[NotNullWhen(true)] out ISymbol? otherC, 1123private static IFieldSymbol? UnwrapPropertyToField(ISymbol propertyOrField)
CSharpAddYieldCodeFixProvider.cs (1)
110var symbol = model.GetEnclosingSymbol(node.Span.Start, cancellationToken);
CSharpCodeGenerationHelpers.cs (4)
207IEnumerable<ISymbol> implementations) 209var implementation = implementations.FirstOrDefault(); 245ISymbol symbol, 266public static T? GetReuseableSyntaxNodeForSymbol<T>(ISymbol symbol, CSharpCodeGenerationContextInfo info) where T : SyntaxNode
CSharpCodeGenerationService.cs (3)
76var newDestinationSymbol = destination.GetSymbolKey(cancellationToken).Resolve(compilation, cancellationToken: cancellationToken).Symbol; 198var members = new List<ISymbol>(); 887public override TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken)
CSharpDeclareAsNullableCodeFixProvider.cs (3)
79var symbol = model.GetSymbolInfo(assignment.Left).Symbol; 192var symbol = model.GetSymbolInfo(assignment.Left, cancellationToken).Symbol; 234var symbol = model.GetSymbolInfo(invocation.Expression, cancellationToken).Symbol;
CSharpDisambiguateSameVariableCodeFixProvider.cs (4)
59[NotNullWhen(true)] out ISymbol? matchingMember, 81var leftSymbol = semanticModel.GetSymbolInfo(left, cancellationToken).GetAnySymbol(); 82var rightSymbol = semanticModel.GetSymbolInfo(right, cancellationToken).GetAnySymbol(); 148out var nameNode, out var matchingMember, out _))
CSharpInlineDeclarationCodeFixProvider.cs (1)
348var previousSymbol = semanticModel.GetSymbolInfo(nodeToReplace, cancellationToken).Symbol;
CSharpMakeMemberRequiredCodeFixProvider.cs (1)
61var fieldOrPropertySymbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
CSharpSemanticFactsService.cs (1)
40protected override IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken)
CSharpSymbolDeclarationService.cs (1)
24public ImmutableArray<SyntaxReference> GetDeclarations(ISymbol symbol)
CSharpTypeInferenceService.TypeInferrer.cs (8)
1502foreach (var symbol in this.SemanticModel.GetSymbolInfo(subpattern.ExpressionColon.Expression).GetAllSymbols()) 2031var memberSymbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration); 2087var symbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration); 2096private ISymbol GetDeclaredMemberSymbolFromOriginalSemanticModel(SyntaxNode declarationInCurrentTree) 2231var symbol = SemanticModel.GetDeclaredSymbol(variableDeclarator); 2260private ImmutableArray<TypeInferenceInfo> InferTypeBasedOnLaterUsage(ISymbol symbol, SyntaxNode afterNode) 2277var descendantSymbol = SemanticModel.GetSymbolInfo(descendant, CancellationToken).GetAnySymbol(); 2306var symbol = SemanticModel.GetRequiredDeclaredSymbol(variable, CancellationToken);
CSharpUseLocalFunctionCodeFixProvider.cs (1)
143var localSymbol = semanticModel.GetDeclaredSymbol(
ITypeSymbolExtensions.cs (1)
112public static async Task<ISymbol?> FindApplicableAliasAsync(this ITypeSymbol type, int position, SemanticModel semanticModel, CancellationToken cancellationToken)
ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (3)
26public override ExpressionSyntax DefaultVisit(ISymbol symbol) 29private static TExpressionSyntax AddInformationTo<TExpressionSyntax>(TExpressionSyntax syntax, ISymbol symbol) 105ISymbol symbol, ExpressionSyntax container, SimpleNameSyntax syntax)
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
35public override TypeSyntax DefaultVisit(ISymbol node) 38private static TTypeSyntax AddInformationTo<TTypeSyntax>(TTypeSyntax syntax, ISymbol symbol)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (4)
2006var enclosingSymbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 2508var containingSymbol = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken); 2835var symbol = semanticModel.GetSymbolInfo(expression, cancellationToken).GetAnySymbol(); 3039var symbol = leftHandBinding.GetBestOrAllSymbols().FirstOrDefault();
MakeLocalFunctionStaticCodeFixHelper.cs (5)
31ImmutableArray<ISymbol> captures, 44ImmutableArray<ISymbol> captures, 51var localFunctionSymbol = semanticModel.GetRequiredDeclaredSymbol(localFunction, cancellationToken); 215private static ImmutableArray<(IParameterSymbol symbol, ISymbol capture)> CreateParameterSymbols(ImmutableArray<ISymbol> captures)
NamedTypeGenerator.cs (3)
102ImmutableArray<ISymbol> members, 106members = ImmutableArray<ISymbol>.Empty; 139IList<ISymbol> newMembers,
NamespaceGenerator.cs (2)
87IList<ISymbol> newMembers, 149private static UsingDirectiveSyntax? GenerateUsingDirective(ISymbol symbol)
NullableHelpers.cs (4)
18/// <see cref="IsSymbolAssignedPossiblyNullValue(SemanticModel, IOperation, ISymbol)"/>. Note 24var declaredSymbol = semanticModel.GetRequiredDeclaredSymbol(declarationSyntax, cancellationToken); 45public static bool? IsSymbolAssignedPossiblyNullValue(SemanticModel semanticModel, IOperation operation, ISymbol symbol) 98private static bool IsSymbolReferencedByOperation(IOperation operation, ISymbol symbol)
PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
69Func<Document, LocalFunctionStatementSyntax, ImmutableArray<ISymbol>, Task> fixer,
TypeSyntaxExtensions.cs (1)
45var firstSymbol = symbols.FirstOrDefault();
Microsoft.CodeAnalysis.CSharp.EditorFeatures (4)
DecompiledSource\CSharpDecompiledSourceService.cs (2)
44public async Task<Document?> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, MetadataReference? metadataReference, string? assemblyLocation, SyntaxFormattingOptions formattingOptions, CancellationToken cancellationToken) 123private static async Task<Document> AddAssemblyInfoRegionAsync(Document document, ISymbol symbol, CancellationToken cancellationToken)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
263var symbol = symbolInfo.Symbol;
EventHookup\EventHookupSessionManager_EventHookupSession.cs (1)
225var symbol = semanticModel.GetSymbolInfo(parentToken.Left, cancellationToken).Symbol;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (65)
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
51var symbol = context.SemanticModel.GetSymbolInfo(node).Symbol;
EditAndContinue\Helpers\CSharpEditAndContinueTestHelpers.cs (1)
29public override ImmutableArray<SyntaxNode> GetDeclarators(ISymbol method)
EditAndContinue\Helpers\EditingTestBase.cs (3)
63internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, IEnumerable<KeyValuePair<TextSpan, TextSpan>>? syntaxMap, string? partialType = null) 66internal static SemanticEditDescription SemanticEdit(SemanticEditKind kind, Func<Compilation, ISymbol> symbolProvider, string? partialType = null, bool preserveLocalVariables = false, Func<Compilation, ISymbol>? deletedSymbolContainerProvider = null)
ExtractClass\ExtractClassTests.cs (2)
3088public Task<ExtractClassOptions?> GetExtractClassOptionsAsync(Document document, INamedTypeSymbol originalSymbol, ImmutableArray<ISymbol> selectedMembers, CancellationToken cancellationToken) 3092IEnumerable<(ISymbol member, bool makeAbstract)> selections;
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (9)
43Func<Compilation, ISymbol> symbolMatcher, 83Func<Compilation, ISymbol> symbolMatcher, 105ISymbol symbol, 125ISymbol symbol, 180protected static Task<(Project, ISymbol)> CompileAndFindSymbolAsync( 185Func<Compilation, ISymbol> symbolMatcher, 195protected static async Task<(Project, ISymbol)> CompileAndFindSymbolAsync( 200Func<Compilation, ISymbol> symbolMatcher, 224var symbol = symbolMatcher(mainCompilation);
PdbSourceDocument\NullResultMetadataAsSourceFileProvider.cs (1)
39public Task<MetadataAsSourceFile?> GetGeneratedFileAsync(MetadataAsSourceWorkspace metadataWorkspace, Workspace sourceWorkspace, Project sourceProject, ISymbol symbol, bool signaturesOnly, MetadataAsSourceOptions options, string tempPath, TelemetryMessage? telemetry, CancellationToken cancellationToken)
PdbSourceDocument\PdbSourceDocumentTests.cs (1)
934var symbol = mainCompilation.GetMember("C.M2");
SymbolKey\SymbolKeyCompilationsTests.cs (7)
549ISymbol sym1 = comp1.Assembly; 550ISymbol sym2 = comp2.Assembly; 578ISymbol assembly1 = compilation1.Assembly; 579ISymbol assembly2 = compilation2.Assembly; 622ISymbol sym1 = comp1.Assembly; 623ISymbol sym2 = comp2.Assembly; 627var resolved = ResolveSymbol(sym2, comp1, SymbolKeyComparison.None);
SymbolKey\SymbolKeyErrorTypeTests.cs (2)
379private static void VerifyResolution(string source, Func<Compilation, ISymbol> symbolToResolve) 382var symbol = symbolToResolve(sourceCompilation);
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (1)
257foreach (var local in df.VariablesDeclared)
SymbolKey\SymbolKeyTestBase.cs (27)
41internal static void ResolveAndVerifySymbolList(IEnumerable<ISymbol> newSymbols, IEnumerable<ISymbol> originalSymbols, CSharpCompilation originalComp) 60internal static void ResolveAndVerifySymbol(ExpressionSyntax node, ISymbol sourceSymbol, SemanticModel model, CSharpCompilation sourceComp, SymbolKeyComparison comparison = SymbolKeyComparison.None) 66internal static void ResolveAndVerifySymbol(ISymbol symbol1, ISymbol symbol2, Compilation compilation2, SymbolKeyComparison comparison = SymbolKeyComparison.None) 71var resolvedSymbol = ResolveSymbol(symbol1, compilation2, comparison); 80internal static ISymbol ResolveSymbol(ISymbol originalSymbol, Compilation targetCompilation, SymbolKeyComparison comparison) 94internal static void AssertSymbolKeysEqual(ISymbol symbol1, ISymbol symbol2, SymbolKeyComparison comparison, bool expectEqual = true) 149internal static IEnumerable<ISymbol> GetSourceSymbols(Microsoft.CodeAnalysis.CSharp.CSharpCompilation compilation, SymbolCategory category) 198internal static IList<ISymbol> GetSourceSymbols(CSharpCompilation compilation, bool includeLocal) 200var list = new List<ISymbol>(); 218private static void GetSourceMemberSymbols(INamespaceOrTypeSymbol symbol, List<ISymbol> list, LocalSymbolDumper localDumper) 220foreach (var memberSymbol in symbol.GetMembers()) 248private static void GetSourceAliasSymbols(CSharpCompilation comp, List<ISymbol> list) 259var sym = model.GetDeclaredSymbol(u); 277public void GetLocalSymbols(FieldSymbol symbol, List<ISymbol> list) 294public void GetLocalSymbols(MethodSymbol symbol, List<ISymbol> list) 336private static void GetLocalAndType(DataFlowAnalysis df, List<ISymbol> list) 338foreach (var v in df.VariablesDeclared) 348private static void GetLabelSymbols(BlockSyntax body, SemanticModel model, List<ISymbol> list) 354var sym = model.GetDeclaredSymbol(n); 365var sym = model.GetDeclaredSymbol(n); 370private static void GetAnonymousTypeOrFuncSymbols(BlockSyntax body, SemanticModel model, List<ISymbol> list) 387private static void GetAnonymousExprSymbols(ExpressionSyntax expr, SemanticModel model, List<ISymbol> list) 413foreach (var m in tinfo.Type.GetMembers())
SymbolKey\SymbolKeyTests.cs (10)
51var resolved = symbolKey.Resolve(compilation).Symbol; 90var resolved = symbolKey.Resolve(compilation).Symbol; 123var type = compilation.GlobalNamespace.GetMembers("C").Single().GetMembers("Inner").Single(); 126var resolved = symbolKey.Resolve(compilation).Symbol; 175var resolved = symbolKey.Resolve(compilation).Symbol; 270async Task<(ISymbol bodyLocalSymbol, ISymbol referenceAssemblySymbol)> GetSymbolsAsync(Compilation bodyCompilation, Compilation referenceCompilation) 273ISymbol bodyLocalSymbol, referenceAssemblySymbol; 302(ProjectId bodyLocalProjectId, ProjectId referenceAssemblyProjectId) GetOriginatingProjectIds(Solution solution, ISymbol bodyLocalSymbol, ISymbol referenceAssemblySymbol)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (71)
CodeGen\CodeGenDeconstructTests.cs (41)
3579var symbol = model.GetDeclaredSymbol(decl); 4135var symbol = model.GetDeclaredSymbol(x1); 4407var symbol = model.GetSymbolInfo(collection).Symbol; 5022var xSymbol = model.GetDeclaredSymbol(x); 5028var ySymbol = model.GetDeclaredSymbol(y); 5174var x1Symbol = model.GetDeclaredSymbol(x1); 5180var x2Symbol = model.GetDeclaredSymbol(x2); 5311var x1Symbol = model.GetDeclaredSymbol(x1); 5316var x2Symbol = model.GetDeclaredSymbol(x2); 5347var x1Symbol = model.GetDeclaredSymbol(x1); 5352var x2Symbol = model.GetDeclaredSymbol(x2); 5402var xSymbol = model.GetDeclaredSymbol(x); 5409var ySymbol = model.GetDeclaredSymbol(y); 5435var xSymbol = model.GetDeclaredSymbol(x); 5442var ySymbol = model.GetDeclaredSymbol(y); 5473var firstX1Symbol = model.GetDeclaredSymbol(firstX1); 5478var secondX1Symbol = model.GetDeclaredSymbol(secondX1); 5505var firstYSymbol = model.GetDeclaredSymbol(firstY); 5510var secondYSymbol = model.GetDeclaredSymbol(secondY); 5536var firstXSymbol = model.GetDeclaredSymbol(firstX); 5541var secondXSymbol = model.GetDeclaredSymbol(secondX); 5565var xSymbol = model.GetDeclaredSymbol(x); 5605var xSymbol = model.GetDeclaredSymbol(x); 5615var ySymbol = model.GetDeclaredSymbol(y); 5644var x1Symbol = model.GetDeclaredSymbol(x1); 5653var x2Symbol = model.GetDeclaredSymbol(x2); 5688var x1Symbol = model.GetDeclaredSymbol(x1); 5697var x2Symbol = model.GetDeclaredSymbol(x2); 5727var x1Symbol = model.GetDeclaredSymbol(x1); 5733var x3Symbol = model.GetDeclaredSymbol(x3); 5769var x1Symbol = model.GetDeclaredSymbol(x1); 5775var x3Symbol = model.GetDeclaredSymbol(x3); 5805var x1Symbol = model.GetDeclaredSymbol(x1); 5811var x3Symbol = model.GetDeclaredSymbol(x3); 5855var x1Symbol = model.GetDeclaredSymbol(x1); 5862var x3Symbol = model.GetDeclaredSymbol(x3); 6004var isymbol = (ISymbol)symbol; 6035var set = new HashSet<ISymbol>(); 6088var set = new HashSet<ISymbol>(); 6136var set = new HashSet<ISymbol>();
CodeGen\CodeGenTupleTest.cs (19)
4020var resultSymbol = model.GetDeclaredSymbol(result); 17413var bobField = x1Symbol.Type.GetMember("Bob"); 19237var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First()); 19240var x2 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(5).First()); 19299var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(2)); 19302var x2 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(3)); 19305var x3 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(4)); 19308var x4 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(5)); 19311var x5 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(6)); 19314var x6 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(7)); 19317var x7 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(8)); 19320var x8 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(9)); 19323var x9 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(10)); 19326var x6double = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().ElementAt(11)); 19402var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First()); 19405var x2 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(2).First()); 19432var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First()); 19486var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().First()); 19544var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().First());
Emit\EditAndContinue\EditAndContinueTest.cs (2)
156var oldSymbol = e.SymbolProvider(oldCompilation); 157var newSymbol = e.NewSymbolProvider(newCompilation);
Emit\EditAndContinue\EditAndContinueTestBase.cs (2)
134Func<Compilation, ISymbol> symbolProvider, 135Func<Compilation, ISymbol> newSymbolProvider = null,
Emit\EditAndContinue\EditAndContinueTests.cs (3)
11463var isAddedSymbol = new Func<ISymbol, bool>(s => false); 11548var isAddedSymbol = new Func<ISymbol, bool>(s => false); 11708var allAddedSymbols = new ISymbol[] { mA1.GetPublicSymbol(), mX1.GetPublicSymbol() };
Emit\EditAndContinue\SemanticEditDescription.cs (4)
13public readonly Func<Compilation, ISymbol> SymbolProvider; 14public readonly Func<Compilation, ISymbol> NewSymbolProvider; 19Func<Compilation, ISymbol> symbolProvider, 20Func<Compilation, ISymbol>? newSymbolProvider = null,
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (24)
Attributes\AttributeTests_RefReadOnly.cs (2)
1455var localFunctionSymbol = newModel.GetDeclaredSymbol(localfunction); 1482var localFunctionSymbol = newModel.GetDeclaredSymbol(localfunction);
Diagnostics\DiagnosticAnalyzerTests.cs (3)
2763void verifyFlowGraphs(ImmutableArray<(ControlFlowGraph Graph, ISymbol AssociatedSymbol)> flowGraphs) 2768(ControlFlowGraph actualFlowGraph, ISymbol associatedSymbol) = flowGraphs[i]; 4055var symbol = Assert.Single(analyzer.CallbackSymbols);
Diagnostics\GetDiagnosticsTests.cs (2)
284var symbol = symbolDeclaredEvent.Symbol; 950static void analyzeNode(SyntaxNode node, ISymbol containingSymbol, Action<Diagnostic> reportDiagnostic)
FlowAnalysis\FlowTestBase.cs (1)
206protected static string GetSymbolNamesJoined<T>(IEnumerable<T> symbols, bool sort = false) where T : ISymbol
Semantics\PatternMatchingTestBase.cs (11)
81var symbol = model.GetDeclaredSymbol(designation); 87var other = model.LookupSymbols(designation.SpanStart, name: designation.Identifier.ValueText).Single(); 142var symbol = model.GetDeclaredSymbol(designation); 168var symbol = model.GetDeclaredSymbol(declarator); 182var symbol = model.GetDeclaredSymbol(designation); 193var symbol = model.GetSymbolInfo(reference).Symbol; 203var symbol = model.GetSymbolInfo(reference).Symbol; 210var other = model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Single(); 244var symbol = model.GetDeclaredSymbol(designation); 375var symbol = (ISymbol)model.GetDeclaredSymbol(designation);
Semantics\PatternMatchingTests_ListPatterns.cs (3)
3647var symbol = model.GetDeclaredSymbol(designation); 3727var symbol = model.GetDeclaredSymbol(itemDesignation); 4418var symbol = model.GetDeclaredSymbol(designation);
Semantics\PatternMatchingTests_Scope.cs (1)
12158var y1 = model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single();
Semantics\PatternMatchingTests2.cs (1)
727var symbol = model.GetDeclaredSymbol(designation);
Microsoft.CodeAnalysis.CSharp.Features (283)
AddImport\CSharpAddImportFeatureService.cs (1)
281private static bool InfoBoundSuccessfully(ISymbol operation)
AddInheritdocCodeFixProvider.cs (1)
72var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
ChangeSignature\CSharpChangeSignatureService.cs (15)
105public override async Task<(ISymbol? symbol, int selectedIndex)> GetInvocationSymbolAsync( 145var symbol = semanticModel.GetDeclaredSymbol(matchingNode, cancellationToken); 155var typeSymbol = semanticModel.GetSymbolInfo(objectCreation.Type, cancellationToken).Symbol; 281ISymbol declarationSymbol, 503ISymbol declarationSymbol, 540ISymbol declarationSymbol, 681ISymbol declarationSymbol, 704ISymbol declarationSymbol, 720ISymbol declarationSymbol, 758Document document, CSharpSyntaxNode node, ISymbol declarationSymbol, SignatureChange updatedSignature, LineFormattingOptionsProvider fallbackOptions, CancellationToken cancellationToken) 780private ImmutableArray<SyntaxNode> VerifyAndPermuteParamNodes(IEnumerable<XmlElementSyntax> paramNodes, ISymbol declarationSymbol, SignatureChange updatedSignature) 840public override async Task<ImmutableArray<ISymbol>> DetermineCascadedSymbolsFromDelegateInvokeAsync( 858var convertedType = (ISymbol?)semanticModel.GetTypeInfo(node, cancellationToken).ConvertedType; 914protected override ImmutableArray<IParameterSymbol> GetParameters(ISymbol declarationSymbol)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (4)
99ISymbol targetSymbol, 128SyntaxNode targetNode, ISymbol targetSymbol, INamedTypeSymbol suppressMessageAttribute, Diagnostic diagnostic) 150ISymbol targetSymbol, 175private static AttributeArgumentListSyntax CreateAttributeArguments(ISymbol targetSymbol, Diagnostic diagnostic, bool isAssemblyAttribute)
CodeLens\CSharpCodeLensDisplayInfoService.cs (6)
107var symbol = semanticModel.GetDeclaredSymbol(node); 122var symbol = semanticModel.GetDeclaredSymbol(node); 135var symbol = semanticModel.GetDeclaredSymbol(node); 148var symbol = semanticModel.GetDeclaredSymbol(node); 175var symbol = semanticModel.GetDeclaredSymbol(node); 194var scopeSymbol = semanticModel.GetDeclaredSymbol(scopeNode);
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (5)
116var containerSymbol = semanticModel.GetDeclaredSymbol(container, cancellationToken); 291private static void AddCapturedTypeParameters(ISymbol symbol, List<ITypeParameterSymbol> typeParameters) 293var containingSymbol = symbol.ContainingSymbol; 312var symbol = semanticModel.GetSymbolInfo(id).Symbol; 322private static string GenerateUniqueMethodName(ISymbol declaredSymbol)
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (3)
224var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken); 234private static IEnumerable<ISymbol> GetAttributeNamedParameters( 240var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken);
Completion\CompletionProviders\AwaitCompletionProvider.cs (1)
106var symbol = semanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol;
Completion\CompletionProviders\CompletionUtilities.cs (2)
146ISymbol symbol, SyntaxContext context) 154public static string GetInsertionText(ISymbol symbol, SyntaxContext context)
Completion\CompletionProviders\CrefCompletionProvider.cs (14)
93protected override async Task<(SyntaxToken, SemanticModel?, ImmutableArray<ISymbol>)> GetSymbolsAsync( 168private static ImmutableArray<ISymbol> GetSymbols( 180return ImmutableArray<ISymbol>.Empty; 183private static ImmutableArray<ISymbol> GetUnqualifiedSymbols( 186using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 199foreach (var member in baseType.GetMembers()) 214private static ImmutableArray<ISymbol> GetQualifiedSymbols( 218var leftSymbol = semanticModel.GetSymbolInfo(parent.Container, cancellationToken).Symbol; 222using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 241SemanticModel semanticModel, ImmutableArray<ISymbol> symbols, SyntaxToken token, int position, ImmutableDictionary<string, string> options) 249foreach (var symbol in group) 266SemanticModel semanticModel, ISymbol symbol, SyntaxToken token, int position, StringBuilder builder, 284ISymbol symbol, 333private static CompletionItem CreateItemFromBuilder(ISymbol symbol, int position, StringBuilder builder, ImmutableDictionary<string, string> options)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (3)
34public readonly ISymbol? Symbol; 44ISymbol? symbol = null) 198var symbol = semanticModel.GetSymbolInfo(expression, cancellationToken).GetAnySymbol();
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
335private static bool IsRelevantSymbolKind(ISymbol symbol)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (6)
162var alias = await type.FindApplicableAliasAsync(position, semanticModel, cancellationToken).ConfigureAwait(false); 169var symbol = alias ?? type; 205symbols: ImmutableArray.Create<ISymbol>(field), 217foreach (var member in type.GetMembers()) 219ISymbol staticSymbol; 297var symbol = semanticModel.GetSymbolInfo(previousToken.Parent, cancellationToken).Symbol;
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.CompletionSymbolDisplay.cs (1)
17public static string ToDisplayString(ISymbol symbol)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (2)
80foreach (var member in symbol.GetMembers()) 102symbols: ImmutableArray.Create<ISymbol>(member),
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (2)
44protected override (string displayText, string suffix, string insertionText) GetDisplayAndSuffixAndInsertionText(ISymbol symbol, CSharpSyntaxContext context) 112using var _ = PooledHashSet<ISymbol>.GetInstance(out var interfaceSet);
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (4)
190var expressionSymbol = semanticModel.GetSymbolInfo(elementAccessExpression.Expression, cancellationToken).GetAnySymbol(); 196var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken); 237var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken); 256var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken);
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (3)
92var enclosingSymbol = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken); 200protected override bool IsInitializable(ISymbol member, INamedTypeSymbol containingType) 210protected override string EscapeIdentifier(ISymbol symbol)
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (2)
72var alias = await type.FindApplicableAliasAsync(position, context.SemanticModel, cancellationToken).ConfigureAwait(false); 80protected override (string displayText, string suffix, string insertionText) GetDisplayAndSuffixAndInsertionText(ISymbol symbol, CSharpSyntaxContext context)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (2)
124CompletionContext context, int position, SemanticModel semanticModel, ImmutableArray<ISymbol> unnamedSymbols, CancellationToken cancellationToken) 134foreach (var symbol in unnamedSymbols)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (5)
57private static (ImmutableArray<ISymbol> symbols, ImmutableDictionary<string, string> properties) GetConversionSymbolsAndProperties( 62return (ImmutableArray.Create<ISymbol>(conversion), s_conversionProperties); 68var symbols = ImmutableArray.Create<ISymbol>(conversion.ContainingType, conversion.Parameters.First().Type, conversion.ReturnType); 130var conversion = await TryRehydrateAsync(document, item, cancellationToken).ConfigureAwait(false); 138private static async Task<ISymbol?> TryRehydrateAsync(Document document, CompletionItem item, CancellationToken cancellationToken)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Indexers.cs (1)
19private void AddIndexers(CompletionContext context, ImmutableArray<ISymbol> indexers)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Operators.cs (1)
100private void AddOperatorGroup(CompletionContext context, string opName, IEnumerable<ISymbol> operators)
Completion\CompletionProviders\OverrideCompletionProvider.cs (2)
197public override ImmutableArray<ISymbol> FilterOverrides(ImmutableArray<ISymbol> members, ITypeSymbol? returnType)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (3)
84foreach (var member in members) 136static ImmutableArray<ISymbol> GetCandidatePropertiesAndFields(Document document, SemanticModel semanticModel, int position, ITypeSymbol? type) 146private static bool IsFieldOrReadableProperty(ISymbol symbol)
Completion\CompletionProviders\SymbolCompletionProvider.cs (4)
80protected override string GetFilterText(ISymbol symbol, string displayText, CSharpSyntaxContext context) 105protected override bool IsInstrinsic(ISymbol s) 179protected override (string displayText, string suffix, string insertionText) GetDisplayAndSuffixAndInsertionText(ISymbol symbol, CSharpSyntaxContext context) 208var symbol = symbols[0].Symbol;
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (2)
71ISymbol? declaredSymbol = null; 369protected override ImmutableArray<IParameterSymbol> GetParameters(ISymbol declarationSymbol)
ConvertLinq\ConvertForEachToLinqQuery\AbstractToMethodConverter.cs (1)
114var expresisonSymbol = ForEachInfo.SemanticModel.GetSymbolInfo(_modifyingExpression, cancellationToken).Symbol;
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
281var memberDeclarationSymbol = semanticModel.GetEnclosingSymbol(
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (2)
748var memberDeclarationNode = FindParentMemberDeclarationNode(returnStatement, out var declaredSymbol); 786private SyntaxNode FindParentMemberDeclarationNode(SyntaxNode node, out ISymbol declaredSymbol)
ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (2)
82private (VariableDeclaratorSyntax, ISymbol)? TryGetVariableDeclaratorAndSymbol(SemanticModel semanticModel) 89var symbol = semanticModel.GetSymbolInfo(_assignmentTargetOpt).Symbol;
ConvertToRecordHelpers.cs (26)
312var positionalParam = param.ContainingSymbol.ContainingType.GetMembers().FirstOrDefault(member 376var dictionaryBuilder = ImmutableDictionary<ISymbol, ExpressionSyntax>.Empty.ToBuilder(); 401ImmutableDictionary<ISymbol, ExpressionSyntax> assignmentValues) 417private static ImmutableDictionary<ISymbol, T> GetAssignmentValuesForConstructor<T>( 422var dictionaryBuilder = ImmutableDictionary<ISymbol, T>.Empty.ToBuilder(); 428return ImmutableDictionary<ISymbol, T>.Empty; 443ISymbol? symbol = assignee switch 459return ImmutableDictionary<ISymbol, T>.Empty; 505ISymbol? otherC = null; 531value, successRequirement: true, type, fields, out var _2)) 568[NotNullWhen(true)] out ISymbol? assignedVariable) 608private static ISymbol? GetReferencedSymbolObject(IOperation reference) 656ISymbol otherObject) 725ISymbol currentObject, 726ISymbol otherObject, 784ISymbol currentObject, 786[NotNullWhen(true)] out ISymbol? boundVariable, 832bool TryGetBoundVariableForIsPattern(IPatternOperation isPattern, [NotNullWhen(true)] out ISymbol? boundVariable) 853DeclaredSymbol: ISymbol otherVar, 879ISymbol otherC, 917ISymbol currentObject, 918ISymbol otherObject, 921var leftObject = GetReferencedSymbolObject(memberReference1.Instance!); 922var rightObject = GetReferencedSymbolObject(memberReference2.Instance!); 959[NotNullWhen(true)] out ISymbol? otherC, 1123private static IFieldSymbol? UnwrapPropertyToField(ISymbol propertyOrField)
CSharpAddYieldCodeFixProvider.cs (1)
110var symbol = model.GetEnclosingSymbol(node.Span.Start, cancellationToken);
CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (2)
120var symbol = semanticModel.GetSymbolInfo(conditionalAccessExpression.WhenNotNull, cancellationToken).GetAnySymbol(); 165var symbol = semanticModel.GetSymbolInfo(conditionalAccessExpression.WhenNotNull, cancellationToken).GetAnySymbol();
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
165var asOperand = semanticModel.GetSymbolInfo(asExpression.Left, cancellationToken).Symbol;
CSharpDeclarationComputer.cs (2)
36ISymbol associatedSymbol, 58ISymbol associatedSymbol,
CSharpDeclareAsNullableCodeFixProvider.cs (3)
79var symbol = model.GetSymbolInfo(assignment.Left).Symbol; 192var symbol = model.GetSymbolInfo(assignment.Left, cancellationToken).Symbol; 234var symbol = model.GetSymbolInfo(invocation.Expression, cancellationToken).Symbol;
CSharpDisambiguateSameVariableCodeFixProvider.cs (4)
59[NotNullWhen(true)] out ISymbol? matchingMember, 81var leftSymbol = semanticModel.GetSymbolInfo(left, cancellationToken).GetAnySymbol(); 82var rightSymbol = semanticModel.GetSymbolInfo(right, cancellationToken).GetAnySymbol(); 148out var nameNode, out var matchingMember, out _))
CSharpInlineDeclarationCodeFixProvider.cs (1)
348var previousSymbol = semanticModel.GetSymbolInfo(nodeToReplace, cancellationToken).Symbol;
CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
323ISymbol outSymbol, 358var symbol = semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol;
CSharpMakeMemberRequiredCodeFixProvider.cs (1)
61var fieldOrPropertySymbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
101foreach (var member in typeSymbol.GetMembers())
CSharpNamingStyleDiagnosticAnalyzer.cs (1)
27protected override bool ShouldIgnore(ISymbol symbol)
CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (2)
30protected override bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node) 47private static bool IsInPropertyOrFieldInitialization(ISymbol containingSymbol, SyntaxNode node)
CSharpUseAutoPropertyAnalyzer.cs (3)
114var exprSymbol = semanticModel.GetSymbolInfo(memberAccess.Expression, cancellationToken).GetAnySymbol(); 126foreach (var symbol in symbolInfo.CandidateSymbols) 129void AddIneligibleField(ISymbol? symbol)
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
196var symbol = semanticModel.GetSymbolInfo(binaryExpression, cancellationToken).Symbol; 213var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
CSharpUseDeconstructionDiagnosticAnalyzer.cs (3)
254var symbol = semanticModel.GetSymbolInfo(identifierName, cancellationToken).GetAnySymbol(); 264var member = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).GetAnySymbol(); 285private static IEnumerable<ISymbol> GetExistingSymbols(
CSharpUseLocalFunctionCodeFixProvider.cs (1)
143var localSymbol = semanticModel.GetDeclaredSymbol(
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (3)
107var local = semanticModel.GetDeclaredSymbol(localDeclaration.Declaration.Variables[0], cancellationToken); 202SemanticModel semanticModel, INamedTypeSymbol? expressionTypeOpt, ISymbol local, BlockSyntax block, 366var localEnclosingSymbol = semanticModel.GetEnclosingSymbol(localDeclaration.SpanStart, cancellationToken);
Debugging\BreakpointResolver.cs (1)
27protected override IEnumerable<ISymbol> GetMembers(INamedTypeSymbol type, string name)
DocumentHighlighting\CSharpDocumentHighlightsService.cs (3)
38Document document, ISymbol symbol, CancellationToken cancellationToken) 52var originalSymbol = symbol.OriginalDefinition; 66var boundSymbol = semanticModel.GetSymbolInfo(type, cancellationToken).Symbol;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (33)
178protected override ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model, SyntaxNode memberBody) 192internal override bool HasParameterClosureScope(ISymbol member) 198protected override IEnumerable<SyntaxNode> GetVariableUseSites(IEnumerable<SyntaxNode> roots, ISymbol localOrParameter, SemanticModel model, CancellationToken cancellationToken) 664internal override void ReportDeclarationInsertDeleteRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, SyntaxNode oldNode, SyntaxNode newNode, ISymbol oldSymbol, ISymbol newSymbol, EditAndContinueCapabilitiesGrantor capabilities, CancellationToken cancellationToken) 1244protected override OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol, EditKind editKind)> GetSymbolEdits( 1253var oldSymbol = (oldNode != null) ? GetSymbolForEdit(oldNode, oldModel!, cancellationToken) : null; 1254var newSymbol = (newNode != null) ? GetSymbolForEdit(newNode, newModel, cancellationToken) : null; 1267return new OneOrMany<(ISymbol?, ISymbol?, EditKind)>((oldSymbol.ContainingSymbol, newSymbol.ContainingSymbol, EditKind.Update)); 1273return new OneOrMany<(ISymbol?, ISymbol?, EditKind)>((oldSymbol, newSymbol, EditKind.Update)); 1284return OneOrMany<(ISymbol?, ISymbol?, EditKind)>.Empty; 1321using var _ = ArrayBuilder<(ISymbol?, ISymbol?, EditKind)>.GetInstance(out var builder); 1353OneOrMany<(ISymbol?, ISymbol?, EditKind)> GetFieldSymbolUpdates(SeparatedSyntaxList<VariableDeclaratorSyntax> oldVariables, SeparatedSyntaxList<VariableDeclaratorSyntax> newVariables) 1381return OneOrMany<(ISymbol?, ISymbol?, EditKind)>.Empty; 1420? OneOrMany<(ISymbol?, ISymbol?, EditKind)>.Empty 1425OneOrMany<(ISymbol?, ISymbol?, EditKind)>.Empty : new OneOrMany<(ISymbol?, ISymbol?, EditKind)>((oldSymbol, newSymbol, editKind)); 1428private static ISymbol? GetSymbolForEdit( 1451var symbol = model.GetDeclaredSymbol(node, cancellationToken); 2479internal override void ReportInsertedMemberSymbolRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, ISymbol newSymbol, SyntaxNode newNode, bool insertingIntoExistingContainingType) 3090protected override bool IsRudeEditDueToPrimaryConstructor(ISymbol symbol, CancellationToken cancellationToken) 3101var container = symbol.ContainingSymbol; 3126static bool IsTypeWithPrimaryConstructor(ISymbol container, CancellationToken cancellationToken)
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
202var containingTypeMemberNames = containingType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(containingType).Select(m => m.Name);
ExtractInterface\CSharpExtractInterfaceService.cs (3)
61internal override bool IsExtractableMember(ISymbol m) 73IEnumerable<ISymbol> includedMembers, ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationMap,
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (2)
38ISymbol symbol, 135protected override ITypeSymbol GetSymbolType(SemanticModel semanticModel, ISymbol symbol)
ExtractMethod\CSharpSelectionResult.ExpressionResult.cs (1)
133private static bool IsCoClassImplicitConversion(TypeInfo info, Conversion conversion, ISymbol? coclassSymbol)
Formatting\CSharpAccessibilityModifiersNewDocumentFormattingProvider.cs (1)
68var type = semanticModel.GetDeclaredSymbol(declaration, cancellationToken);
GenerateMember\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
56protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
GenerateMember\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (1)
41protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
GenerateMember\GenerateParameterizedMember\CSharpGenerateMethodService.cs (1)
48protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
GenerateType\CSharpGenerateTypeService.cs (4)
64var symbol = symbolInfo.GetAnySymbol(); 225var leftSymbol = semanticModel.GetSymbolInfo(((MemberAccessExpressionSyntax)nameOrMemberAccessExpression).Expression, cancellationToken).Symbol; 273var leftSymbol = semanticModel.GetSymbolInfo(parent.Left, cancellationToken).Symbol; 465var expressionSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol;
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (3)
23protected override ISymbol FindRelatedExplicitlyDeclaredSymbol(ISymbol symbol, Compilation compilation) 60var symbol = semanticModel.GetDeclaredSymbol(foundReturnableConstruct);
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (11)
28using MemberImplementationMap = OrderedMultiDictionary<ISymbol, ISymbol>; 44protected abstract bool CheckMemberCanBeConverted(ISymbol member); 45protected abstract SyntaxNode ChangeImplementation(SyntaxGenerator generator, SyntaxNode currentDecl, ISymbol implMember, ISymbol interfaceMember); 46protected abstract Task UpdateReferencesAsync(Project project, SolutionEditor solutionEditor, ISymbol implMember, INamedTypeSymbol containingType, CancellationToken cancellationToken); 59var member = semanticModel.GetDeclaredSymbol(container, cancellationToken); 192foreach (var interfaceMember in interfaceType.GetMembers()) 194var impl = containingType.FindImplementationForInterfaceMember(interfaceMember); 228var documentToImplDeclarations = new OrderedMultiDictionary<Document, (SyntaxNode, ISymbol impl, SetWithInsertionOrder<ISymbol> interfaceMembers)>();
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (6)
42protected override bool CheckMemberCanBeConverted(ISymbol member) 47ISymbol implMember, INamedTypeSymbol interfaceType, CancellationToken cancellationToken) 148protected override SyntaxNode ChangeImplementation(SyntaxGenerator generator, SyntaxNode decl, ISymbol implMember, ISymbol interfaceMember) 157private static bool AllDefaultValuesMatch(ISymbol implMember, ISymbol interfaceMember)
ImplementInterface\CSharpImplementImplicitlyCodeRefactoringProvider.cs (4)
37protected override bool CheckMemberCanBeConverted(ISymbol member) 49protected override Task UpdateReferencesAsync(Project project, SolutionEditor solutionEditor, ISymbol implMember, INamedTypeSymbol containingType, CancellationToken cancellationToken) 52protected override SyntaxNode ChangeImplementation(SyntaxGenerator generator, SyntaxNode decl, ISymbol _1, ISymbol _2)
InitializeParameter\CSharpInitializeMemberFromParameterCodeRefactoringProvider.cs (1)
112ISymbol fieldOrProperty,
InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
303var initializerSymbol = semanticModel.GetSymbolInfo(initializer, cancellationToken).GetAnySymbol();
J\s\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs\Helpers.cs (1)
33public static bool IsPublicInstance(ISymbol symbol)
LanguageServices\CSharpSymbolDisplayService.SymbolDescriptionBuilder.cs (5)
97ISymbol symbol) 116protected override ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat format) 119protected override string GetNavigationHint(ISymbol symbol) 174private async Task<T> GetFirstDeclarationAsync<T>(ISymbol symbol) where T : SyntaxNode 205protected override void AddCaptures(ISymbol symbol)
MakeLocalFunctionStaticCodeFixHelper.cs (5)
31ImmutableArray<ISymbol> captures, 44ImmutableArray<ISymbol> captures, 51var localFunctionSymbol = semanticModel.GetRequiredDeclaredSymbol(localFunction, cancellationToken); 215private static ImmutableArray<(IParameterSymbol symbol, ISymbol capture)> CreateParameterSymbols(ImmutableArray<ISymbol> captures)
MakeLocalFunctionStaticHelper.cs (2)
30static bool IsChildOrSelf(LocalFunctionStatementSyntax containingLocalFunction, ISymbol calledLocationFunction) 43public static bool CanMakeLocalFunctionStaticByRefactoringCaptures(LocalFunctionStatementSyntax localFunction, SemanticModel semanticModel, out ImmutableArray<ISymbol> captures)
MetadataAsSource\CSharpMetadataAsSourceService.cs (1)
37protected override async Task<Document> AddAssemblyInfoRegionAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken)
NavigationBar\CSharpNavigationBarItemService.cs (6)
68foreach (var member in type.GetMembers()) 139var type = GetType(semanticModel, node, cancellationToken); 166private static ISymbol? GetType(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 174private static bool IsAccessor(ISymbol member) 187Solution solution, ISymbol member, SyntaxTree tree, CancellationToken cancellationToken) 202Solution solution, ISymbol symbol, SyntaxTree tree, CancellationToken cancellationToken)
PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
69Func<Document, LocalFunctionStatementSyntax, ImmutableArray<ISymbol>, Task> fixer,
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
78protected override NullableFlowState GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken)
Rename\CSharpRenameIssuesService.cs (2)
25SemanticModel semanticModel, ISymbol symbol, SyntaxToken triggerToken, [NotNullWhen(true)] out string? langError) 40var symbolForVar = semanticModel.GetSpeculativeSymbolInfo(
SignatureHelp\AttributeSignatureHelpProvider.cs (4)
87var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken); 129ISymbol within, 160IList<ISymbol> namedParameters, 174var namedParameter = namedParameters[i];
SignatureHelp\ConstructorInitializerSignatureHelpProvider.cs (1)
96var currentConstructor = semanticModel.GetDeclaredSymbol(constructorInitializer.Parent!, cancellationToken);
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (2)
61var expressionSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).GetAnySymbol(); 88var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken);
SignatureHelp\GenericNameSignatureHelpProvider.cs (2)
114var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken); 169ISymbol symbol,
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (2)
81var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken); 133ISymbol within,
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_DelegateAndFunctionPointerInvoke.cs (2)
20InvocationExpressionSyntax invocationExpression, SemanticModel semanticModel, ISymbol within, 30var expressionSymbol = semanticModel.GetSymbolInfo(invocationExpression.Expression, cancellationToken).GetAnySymbol();
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (2)
38ISymbol within, 46var throughSymbol = semanticModel.GetSymbolInfo(throughExpression, cancellationToken).GetAnySymbol();
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (2)
81var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken); 101var currentConstructor = semanticModel.GetSymbolInfo(baseTypeSyntax, cancellationToken).Symbol;
Snippets\CSharpForEachLoopSnippetProvider.cs (1)
42var enumerationSymbol = semanticModel.LookupSymbols(position).FirstOrDefault(symbol => symbol.GetSymbolType() != null &&
UseExpressionBodyForLocalFunctionHelper.cs (1)
60var symbol = semanticModel.GetDeclaredSymbol(statement);
UseSimpleUsingStatementDiagnosticAnalyzer.cs (1)
151private static bool DeclaredLocalCausesCollision(ILookup<string, ISymbol> symbolNameToExistingSymbol, ImmutableArray<ILocalSymbol> locals)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IFieldReferenceExpression.cs (1)
709var fieldSym = classSym.GetMembers("_field").Single();
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (2)
InteractiveSessionTests.cs (2)
490var c2X = lookupMember(compilation1, "Submission#0", "X"); 508ISymbol lookupMember(Compilation c, string typeName, string memberName)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (244)
Semantics\AccessCheckTests.cs (2)
766ISymbol nullSymbol = null; 1523var b = comp2.GetMember("B").GetPublicSymbol();
Semantics\AccessibilityTests.cs (1)
21private static readonly ISymbol s_testSymbol;
Semantics\BindingTests.cs (4)
2895var symbol1 = model.GetDeclaredSymbol(param); 2899var symbol2 = model.GetSymbolInfo(id).Symbol; 2937var symbol1 = model.GetDeclaredSymbol(param); 2941var symbol2 = model.GetSymbolInfo(id).Symbol;
Semantics\ColorColorTests.cs (1)
1249var candidate = info.CandidateSymbols.Single();
Semantics\DeconstructionTests.cs (27)
3947var symbol = si.Symbol; 4176var x1 = model.GetDeclaredSymbol(designations[0]); 4181var x2 = model.GetDeclaredSymbol(designations[1]); 4243var a = model.GetDeclaredSymbol(designations[0]); 4247var b = model.GetDeclaredSymbol(designations[1]); 4251var c = model.GetDeclaredSymbol(designations[2]); 4255var d = model.GetDeclaredSymbol(designations[3]); 4378var a = model.GetDeclaredSymbol(designations[0]); 4382var b = model.GetDeclaredSymbol(designations[1]); 4386var c = model.GetDeclaredSymbol(designations[2]); 4390var d = model.GetDeclaredSymbol(designations[3]); 5192var a = model.GetDeclaredSymbol(designations[0]); 5196var b = model.GetDeclaredSymbol(designations[1]); 5200var c = model.GetDeclaredSymbol(designations[2]); 5204var d = model.GetDeclaredSymbol(designations[3]); 5336var a = model.GetDeclaredSymbol(designations[0]); 5340var b = model.GetDeclaredSymbol(designations[1]); 5344var c = model.GetDeclaredSymbol(designations[2]); 5348var d = model.GetDeclaredSymbol(designations[3]); 5660var a = model.GetDeclaredSymbol(designations[0]); 5664var b = model.GetDeclaredSymbol(designations[1]); 5668var c = model.GetDeclaredSymbol(designations[2]); 5672var d = model.GetDeclaredSymbol(designations[3]); 5770var a = model.GetDeclaredSymbol(designations[0]); 5774var b = model.GetDeclaredSymbol(designations[1]); 5778var c = model.GetDeclaredSymbol(designations[2]); 5782var d = model.GetDeclaredSymbol(designations[3]);
Semantics\DelegateTypeTests.cs (2)
7682var symbol = model.GetDeclaredSymbol(variable); 11061var symbol = model.GetSymbolInfo(variable).Symbol;
Semantics\ExpressionBodiedMemberTests.cs (5)
79var semanticSymbol = semanticInfo.Symbol; 208var sym = semanticInfo.Symbol; 230var semanticSymbol = semanticInfo.Symbol; 286var semanticSymbol = semanticInfo.Symbol; 319var semanticSymbol = semanticInfo.Symbol;
Semantics\ForEachTests.cs (8)
2132Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerable__GetEnumerator).GetPublicSymbol(), loopInfo.GetEnumeratorMethod); 2133Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__Current).GetPublicSymbol(), loopInfo.CurrentProperty); 2134Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__MoveNext).GetPublicSymbol(), loopInfo.MoveNextMethod); 2135Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_IDisposable__Dispose).GetPublicSymbol(), loopInfo.DisposeMethod); 2184Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerable__GetEnumerator).GetPublicSymbol(), loopInfo0.GetEnumeratorMethod); 2185Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__Current).GetPublicSymbol(), loopInfo0.CurrentProperty); 2186Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__MoveNext).GetPublicSymbol(), loopInfo0.MoveNextMethod); 2187Assert.Equal<ISymbol>(comp.GetSpecialTypeMember(SpecialMember.System_IDisposable__Dispose).GetPublicSymbol(), loopInfo0.DisposeMethod);
Semantics\InteractiveSemanticModelTests.cs (2)
127var symbol = bindInfo.Symbol; 142var symbol = bindInfo.Symbol;
Semantics\InteractiveUsingTests.cs (4)
83var typeSymbol = sub.ScriptClass.GetMember("Type"); 113var typeSymbol = ((Compilation)sub3).ScriptClass.GetMember("C"); 232var typeSymbol = ((Compilation)sub3).ScriptClass.GetMember("C"); 580private static ISymbol GetSpeculativeSymbol(Compilation comp, string name)
Semantics\LambdaDiscardParametersTests.cs (5)
451var localSymbol = model.GetSymbolInfo(underscores[0]).Symbol; 455var parameterSymbol = model.GetSymbolInfo(underscores[1]).Symbol; 484var localSymbol = model.GetSymbolInfo(underscore).Symbol; 516var localSymbol = model.GetSymbolInfo(underscores[0]).Symbol; 520var parameterSymbol = model.GetSymbolInfo(underscores[1]).Symbol;
Semantics\LambdaTests.cs (10)
851var sym = model.GetSymbolInfo(expr).Symbol; 3004ISymbol symbol = model.GetSymbolInfo(b).Symbol; 3626static string getAttributesInternal(LambdaExpressionSyntax expr, ISymbol symbol) 3632static string getAttributesPublic(LambdaExpressionSyntax expr, ISymbol symbol) 3935var symbol = model.GetSymbolInfo(attributeSyntax).Symbol; 3965var attrCtor = attrType.GetMember(".ctor"); 4078var symbol = model.GetSymbolInfo(expr).Symbol; 8088var constSymbol = model.GetDeclaredSymbol(decls[0].Declaration.Variables.Single()); 8094var defaultValueSymbol = model.GetSymbolInfo(defaultValue).Symbol; 8099var lhsSymbol = model.GetSymbolInfo(lhs).Symbol;
Semantics\LocalFunctionTests.cs (10)
399var attrCtor = attrType.GetMember(".ctor"); 4884var b1Symbol = model.GetSymbolInfo(b1).Symbol; 6279var symbol = model.GetSymbolInfo(expr).Symbol; 6300var symbol = model.GetSymbolInfo(expr).Symbol; 6328var symbol = model.GetSymbolInfo(expr).Symbol; 6364var symbol = model.GetSymbolInfo(exprs[0]).Symbol; 6408var symbol = model.GetSymbolInfo(exprs[0]).Symbol; 6455var symbol = model.GetSymbolInfo(exprs[0]).Symbol; 7564var symbol = model.GetSymbolInfo(tParameterUsage).Symbol; 8609var symbol = model.GetSymbolInfo(parameterUsage).Symbol;
Semantics\LookupTests.cs (2)
34internal List<ISymbol> GetLookupSymbols(string testSrc, NamespaceOrTypeSymbol container = null, string name = null, int? arity = null, bool isScript = false, IEnumerable<string> globalUsings = null) 1522private void TestLookupSymbolsNestedNamespaces(List<ISymbol> actual_lookupSymbols)
Semantics\NativeIntegerTests.cs (10)
267Assert.False(((IEquatable<ISymbol>)underlyingType).Equals(nativeIntegerType)); 311static bool includeUnderlyingMember(ISymbol underlyingMember) 343static bool includeNativeIntegerMember(ISymbol nativeIntegerMember) 514foreach (var member in allMembers) 527static void verifyMembers(INamedTypeSymbol type, ImmutableArray<ISymbol> allMembers, ImmutableArray<ISymbol> members) 529foreach (var member in members) 536static void verifyMember(INamedTypeSymbol type, ISymbol member) 654private static int SymbolComparison(ISymbol x, ISymbol y) => SymbolComparison(x.ToTestDisplayString(), y.ToTestDisplayString());
Semantics\NullableReferenceTypesTests.cs (27)
3684var symbol1 = model.GetDeclaredSymbol(param); 3688var symbol2 = model.GetSymbolInfo(id).Symbol; 4515var firstCrefSymbol = model.GetSymbolInfo(firstCref).Symbol; 4519var lastCrefSymbol = model.GetSymbolInfo(lastCref).Symbol; 4551var lastCrefSymbol = model.GetSymbolInfo(lastCref).Symbol; 4583var lastCrefSymbol = model.GetSymbolInfo(lastCref).Symbol; 63438var objectSymbol2 = model2.GetSymbolInfo(object2).Symbol; 68366var discard1 = model.GetSymbolInfo(discards[0]).Symbol; 68370var discard2 = model.GetSymbolInfo(discards[1]).Symbol; 68374var discard3 = model.GetSymbolInfo(discards[2]).Symbol; 68378var discard4 = model.GetSymbolInfo(discards[3]).Symbol; 68382var discard5 = model.GetSymbolInfo(discards[4]).Symbol; 90554var symbol = model.GetDeclaredSymbol(localDeclaration); 153175var field1 = model.GetSymbolInfo(declarators[0].Value).Symbol; 153177var field2 = model.GetSymbolInfo(declarators[1].Value).Symbol; 153179var field3 = model.GetSymbolInfo(declarators[2].Value).Symbol; 153225var method2 = model.GetSymbolInfo(invocations[0]).Symbol; 153228var method3 = model.GetSymbolInfo(invocations[1]).Symbol; 153657var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 153826var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 153866var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 153907var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 153942var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 154076var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Get"); 154118var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 154162var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 154199var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item");
Semantics\OperatorTests.cs (8)
7543var symbol2 = semanticModel.GetSymbolInfo(node2).Symbol; 7545var symbol4 = semanticModel.GetSymbolInfo(node4).Symbol; 8113var symbol2 = semanticModel.GetSymbolInfo(node2).Symbol; 8114var symbol3 = semanticModel.GetSymbolInfo(node3).Symbol; 8115var symbol4 = semanticModel.GetSymbolInfo(node4).Symbol; 8117var symbol6 = semanticModel.GetSymbolInfo(node6).Symbol; 8118var symbol7 = semanticModel.GetSymbolInfo(node7).Symbol; 8119var symbol8 = semanticModel.GetSymbolInfo(node8).Symbol;
Semantics\OutVarTests.cs (9)
965var symbol = model.GetDeclaredSymbol(variableDeclaratorSyntax); 973var other = model.LookupSymbols(decl.SpanStart, name: decl.Identifier().ValueText).Single(); 1006ISymbol expectedSymbol = null, 1088private static void VerifyDataFlow(SemanticModel model, DeclarationExpressionSyntax decl, bool isDelegateCreation, bool isExecutableCode, IdentifierNameSyntax[] references, ISymbol symbol) 1140var symbol = model.GetDeclaredSymbol(variableDesignationSyntax); 1162var symbol = model.GetSymbolInfo(reference).Symbol; 1172var symbol = model.GetSymbolInfo(reference).Symbol; 21297var y1 = model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single(); 32673var symbol = model.GetDeclaredSymbol(variableDesignationSyntax);
Semantics\OverloadResolutionTests.cs (2)
7436var symbol = model.GetSymbolInfo(syntax).Symbol; 7477var symbol = model.GetSymbolInfo(syntax).Symbol;
Semantics\PrimaryConstructorTests.cs (14)
854var outVar = model.GetDeclaredSymbol(outVarSyntax); 901var symbol = model.GetSymbolInfo(x).Symbol; 967var symbol = model.GetSymbolInfo(x).Symbol; 1195var symbol = model.GetSymbolInfo(x).Symbol; 1424var symbol = model.GetSymbolInfo(x).Symbol; 1513var symbol = model.GetSymbolInfo(x).Symbol; 1862var symbol = model.GetSymbolInfo(x).Symbol; 2536var symbol = model.GetSymbolInfo(x).Symbol; 2574var symbol = model.GetSymbolInfo(x).Symbol; 2611var symbol = model.GetSymbolInfo(x).Symbol; 2647var symbol = model.GetSymbolInfo(x).Symbol; 7182var symbol = symbolInfo.Symbol; 7751var symbol = model.GetSymbolInfo(p1).Symbol; 8157var symbol = model.GetSymbolInfo(p1).Symbol;
Semantics\QueryTests.cs (2)
2273var symbol = semanticModel.GetDeclaredSymbol(queryContinuation); 2326var symbol = semanticModel.GetDeclaredSymbol(joinInto);
Semantics\RecordStructTests.cs (6)
2597var symbol = model.GetSymbolInfo(x).Symbol; 2632var symbol = model.GetSymbolInfo(x).Symbol; 2666var symbol = model.GetSymbolInfo(x).Symbol; 2701var symbol = model.GetSymbolInfo(x).Symbol; 5826var initializer = model.GetSymbolInfo(initializerSyntax.Value).Symbol!; 5862var outVar = model.GetDeclaredSymbol(outVarSyntax)!;
Semantics\RecordTests.cs (14)
455var initializer = model.GetSymbolInfo(initializerSyntax.Value).Symbol!; 481var outVar = model.GetDeclaredSymbol(outVarSyntax)!; 2496var symbol = model.GetSymbolInfo(x).Symbol; 7660var clone = verifier.Compilation.GetMember("C." + WellKnownMemberNames.CloneMethodName); 15658var deconstruct = verifier.Compilation.GetMember("B.Deconstruct"); 21158var symbol = model.GetSymbolInfo(x).Symbol; 21388var symbol = model.GetSymbolInfo(x).Symbol; 21617var symbol = model.GetSymbolInfo(x).Symbol; 21706var symbol = model.GetSymbolInfo(x).Symbol; 22093var symbol = model.GetSymbolInfo(x).Symbol; 24657var symbol = model.GetSymbolInfo(x).Symbol; 24692var symbol = model.GetSymbolInfo(x).Symbol; 24726var symbol = model.GetSymbolInfo(x).Symbol; 24761var symbol = model.GetSymbolInfo(x).Symbol;
Semantics\RefFieldTests.cs (4)
16101var method = model.GetSymbolInfo(anonymousMethod).Symbol; 16141var method = model.GetSymbolInfo(anonymousMethod).Symbol; 16287var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 28094var symbol = model.GetDeclaredSymbol(fieldInitializerSyntax.Parent);
Semantics\ScriptSemanticsTests.cs (4)
525var symbol1 = model.GetSymbolInfo(((GotoStatementSyntax)statements[1]).Expression).Symbol; 539var symbol0 = model.GetDeclaredSymbol(declarations[0]); 541var symbol1 = model.GetSymbolInfo(declarations[1].Initializer.Value).Symbol; 595foreach (var symbol in symbols)
Semantics\TopLevelStatementsTests.cs (42)
195var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 236var declSymbol = model1.GetDeclaredSymbol(localDecl); 320var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 359var declSymbol = model2.GetDeclaredSymbol(localDecl); 482var declSymbol = model1.GetDeclaredSymbol(localDecl); 501var refSymbol = model2.GetSymbolInfo(localRef).Symbol; 534var declSymbol = model1.GetDeclaredSymbol(localDecl); 545var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 574var declSymbol = model1.GetDeclaredSymbol(localDecl); 592var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 701var local = model.GetDeclaredSymbol(declarator); 871var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single()); 877var symbol2 = model2.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single()); 985var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First()); 989var symbol2 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Skip(1).Single()); 1040var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First()); 1396var symbol2 = model2.GetSymbolInfo(nameRef).Symbol; 1666var getHashCode = ((Compilation)comp).GetMember("System.Object." + nameof(GetHashCode)); 1674var declSymbol = model1.GetDeclaredSymbol(localDecl); 1747void verifyModel(ISymbol declSymbol, SemanticModel model, IdentifierNameSyntax nameRef) 1839var getHashCode = ((Compilation)comp).GetMember("System.Object." + nameof(GetHashCode)); 1847var declSymbol = model1.GetDeclaredSymbol(localDecl); 1915void verifyModel(ISymbol declSymbol, SemanticModel model2, IdentifierNameSyntax nameRef) 2073var declSymbol = model1.GetDeclaredSymbol(localDecl); 2128void verifyModel(ISymbol declSymbol, SemanticModel model2, IdentifierNameSyntax nameRef) 2237var declSymbol = model1.GetDeclaredSymbol(localDecl); 2294void verifyModel(ISymbol declSymbol, SemanticModel model2, IdentifierNameSyntax nameRef) 3945var parameter = model.GetSymbolInfo(nameRef).Symbol; 3987void verifyModel(ISymbol declSymbol, SemanticModel model, IdentifierNameSyntax nameRef) 4206var local = model.GetDeclaredSymbol(declarator); 4498var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Single()); 4504var symbol2 = model2.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().First()); 4562var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().First()); 4566var symbol2 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Skip(1).First()); 4611var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().First()); 6019var declSymbol = model1.GetDeclaredSymbol(localDecl); 6027var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 6269var x = semanticModel.GetDeclaredSymbol(localDecl); 6314var xDecl = semanticModel1.GetDeclaredSymbol(localDecl); 6316var xRef = semanticModel1.GetSymbolInfo(localRef).Symbol; 6365var xDecl = semanticModel1.GetDeclaredSymbol(localDecl); 6371var xRef = semanticModel2.GetSymbolInfo(localRef).Symbol;
Semantics\UnsafeTests.cs (9)
4436var declaredSymbol = model.GetDeclaredSymbol(syntax.Ancestors().OfType<VariableDeclaratorSyntax>().First()); 5020var receiverSymbol = receiverSummary.Symbol; 5087var receiverSymbol = receiverSummary.Symbol; 5331var receiverSymbol = receiverSummary.Symbol; 5343var indexSymbol = indexSummary.Symbol; 5398var receiverSymbol = receiverSummary.Symbol; 5410var indexSymbol = indexSummary.Symbol; 5456var receiverSymbol = receiverSummary.Symbol; 5468var indexSymbol = indexSummary.Symbol;
Semantics\UsingStatementTests.cs (10)
62var declaredSymbol = model.GetDeclaredSymbol(usingStatement.Declaration.Variables.Single()); 75var lookupSymbol = model.LookupSymbols(memberAccessExpression.SpanStart, name: declaredLocal.Name).Single(); 1342var declaredSymbol = model.GetDeclaredSymbol(usingStatement.Declaration.Variables.Single()); 1377var firstDeclaredSymbol = model.GetDeclaredSymbol(usingStatement.Declaration.Variables.First()); 1381var secondDeclaredSymbol = model.GetDeclaredSymbol(usingStatement.Declaration.Variables.Last()); 1868var symbol = model.GetDeclaredSymbol(x); 1875private SymbolInfo VerifySymbolInfoForUsingStatements(CSharpCompilation compilation, ISymbol symbol, int index = 1) 1889private ISymbol VerifyLookUpSymbolForUsingStatements(CSharpCompilation compilation, ISymbol symbol, int index = 1) 1895var actualSymbol = model.LookupSymbols(usingStatements[index - 1].SpanStart, name: symbol.Name).Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (332)
Compilation\CompilationAPITests.cs (12)
2844var symbol = semanticModel.GetSymbolInfo(expr).Symbol; 2879var symbol = semanticModel.GetSymbolInfo(expr).Symbol; 2911var symbol = semanticModel.GetSymbolInfo(expr).Symbol; 3478var assembly1 = comp.GetAssemblyOrModuleSymbol(reference).GetPublicSymbol(); 3504var assembly1 = comp.GetAssemblyOrModuleSymbol(reference).GetPublicSymbol(); 3534var assembly1 = comp.GetAssemblyOrModuleSymbol(reference1).GetPublicSymbol(); 3537var assembly2 = comp.GetAssemblyOrModuleSymbol(reference2).GetPublicSymbol(); 3574var assembly1 = comp.GetAssemblyOrModuleSymbol(reference1).GetPublicSymbol(); 3577var assembly2 = comp.GetAssemblyOrModuleSymbol(reference2).GetPublicSymbol(); 3614var corlibAssembly = current.GetAssemblyOrModuleSymbol(corlibReference).GetPublicSymbol(); 3617var otherAssembly = current.GetAssemblyOrModuleSymbol(otherReference).GetPublicSymbol(); 3644var corlibAssembly = current.GetAssemblyOrModuleSymbol(corlibReference).GetPublicSymbol();
Compilation\GetSemanticInfoTests.cs (20)
1072var baseConstructor = bindInfo.Symbol; 1091var baseConstructor = bindInfo.Symbol; 1457var candidateIndexers = ImmutableArray.Create<ISymbol>(indexerSymbol1, indexerSymbol2); 1460Assert.True(bindInfo.CandidateSymbols.SetEquals(candidateIndexers, EqualityComparer<ISymbol>.Default)); 1532var candidate = bindInfo.CandidateSymbols.Single(); 1560var symbol = bindInfo.Symbol; 1582var symbol = bindInfo.Symbol; 1610var symbol = bindInfo.Symbol; 1706var symbol = bindInfo.Symbol; 1741var symbol = bindInfo.Symbol; 1776var symbol = bindInfo.Symbol; 1812var symbol = bindInfo.Symbol; 2204private IEnumerable<ISymbol> LookupTypeParameterMembers(string types, string constraints, string memberName, out ITypeParameterSymbol typeParameter) 2539var symbol = info.Symbol; 2726var symbol = symbolInfo.Symbol; 2848Assert.True(candidates.SetEquals(conversions, EqualityComparer<ISymbol>.Default)); 2939Assert.True(candidates.SetEquals(operators, EqualityComparer<ISymbol>.Default)); 3031Assert.True(candidates.SetEquals(operators, EqualityComparer<ISymbol>.Default)); 3105Assert.True(candidates.SetEquals(operators, EqualityComparer<ISymbol>.Default)); 3179Assert.True(candidates.SetEquals(operators, EqualityComparer<ISymbol>.Default));
Compilation\QueryClauseInfoTests.cs (36)
36new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible), 37new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible)), 39new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible), 40new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible))); 52new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 53new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible)), 55new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 56new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible))); 68new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 69new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible)), 71new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 72new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible))); 84new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible), 85new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible)), 87new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 88new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible))); 92new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, obj), CandidateReason.Inaccessible), 93new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible)), 95new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 96new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible))); 100new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 101new SymbolInfo(ImmutableArray.Create<ISymbol>(obj, int32), CandidateReason.Inaccessible)), 103new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 104new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible))); 108new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 109new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, obj), CandidateReason.Inaccessible)), 111new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 112new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible))); 116new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Ambiguous), 117new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible)), 119new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 120new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible))); 124new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 125new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Ambiguous)), 127new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible), 128new SymbolInfo(ImmutableArray.Create<ISymbol>(int32, int32), CandidateReason.Inaccessible)));
Compilation\SemanticModelAPITests.cs (38)
257var symbol1 = model1.GetDeclaredSymbol(vardecl); 258var symbol2 = model2.GetDeclaredSymbol(vardecl); 277var symbol1 = model1.GetDeclaredSymbol(vardecl); 278var symbol2 = model2.GetDeclaredSymbol(vardecl); 335var symbol1 = model1.GetSymbolInfo(statement.Expression).Symbol; 336var symbol2 = model2.GetSymbolInfo(statement.Expression).Symbol; 539var a = comp.GlobalNamespace.GetTypeMembers("A", 0).Single().ISymbol; 565var b = comp.GlobalNamespace.GetTypeMembers("B", 0).Single().ISymbol; 797Assert.Equal<ISymbol>(abType, xSym.Type); 823var cBaseType = model.GetSymbolInfo(cBase).Symbol; 868var pMethodSym = pTypeSym.GetMembers("PM").Single(); 1202var argsym1 = model.GetSymbolInfo(args.First().Expression).Symbol; 1203var argsym2 = model.GetSymbolInfo(args.Last().Expression).Symbol; 1366var symbol = info.Symbol; 1741var fieldSymbol = model.GetDeclaredSymbol(fieldDecl.Declaration.Variables.Single()); 1787var local = speculativeModel.GetDeclaredSymbol(declarator); 1840var local = speculativeModel.GetDeclaredSymbol(declarator); 1886var label = statModel.GetDeclaredSymbol(labeledStatement); 2082var symbol = info.Symbol; 2284var symbol = speculativeModel.GetDeclaredSymbol(declarator); 2393var local = speculativeModel.GetDeclaredSymbol(declarator); 2576var local = speculativeModel.GetDeclaredSymbol(declarator); 2610var param = speculativeModel.GetSymbolInfo(declarator.Initializer.Value).Symbol; 2647var label = speculativeModel.GetDeclaredSymbol(labeledStatement); 2713var symbol = speculativeModel.GetSymbolInfo(speculatedTypeSyntax).Symbol; 2924var symbol = model.GetSymbolInfo(cref.Type).Symbol; 2964var symbol = model.GetSymbolInfo(cref.Type).Symbol; 3009var symbol = model.GetSymbolInfo(cref.Type).Symbol; 3131var symbol = model.GetSymbolInfo(syntax).Symbol; 3615var oldSymbol = symbolInfo.Symbol; 3622var newSymbol = speculativeSymbolInfo.Symbol; 3754var firstParamType = ((ISymbol)exprInfo.CandidateSymbols.Single()).GetParameters().First().Type; 3848var symbol = model.LookupSymbols(syntax.SpanStart, name: "Alias").Single(); 3875var symbol = model.LookupSymbols(endPosition, name: "M0").Single(); 4031var discarded = model.GetEnclosingSymbol(match.Index); 4060var discarded = model.GetEnclosingSymbol(match.Index); 4085var discarded1 = model.GetEnclosingSymbol(source.LastIndexOf(" => x")); 4086var discarded2 = model.GetEnclosingSymbol(source.IndexOf(" => x"));
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (49)
62ISymbol rx = model.GetDeclaredSymbol(rxDecl.Variables.Single()); 81var symbol = model.GetDeclaredSymbol(decl); 127var symbol = model.GetDeclaredSymbol(cdns); 409var eventSymbol = model.GetDeclaredSymbol(eventDecl.Declaration.Variables[0]); 431var symbol = model.GetDeclaredSymbol(node); 453var symbol = model.GetDeclaredSymbol(node); 475var symbol = model.GetDeclaredSymbol(node); 570var symbol = model.GetDeclaredSymbol(localDecl.Declaration.Variables[0]); 592var symbol = model.GetDeclaredSymbol(localDecl.Declaration.Variables[0]); 620var symbol1 = (ISymbol)model.GetDeclaredSymbol(labeled1); 625var symbol2 = (ISymbol)model.GetDeclaredSymbol(labeled2); 691var symbol = model.GetDeclaredSymbol(node); 720var symbol = (ISymbol)model.GetDeclaredSymbol(switchLabel); 752var symbol1 = (ISymbol)model.GetDeclaredSymbol(switchLabel); 778var symbol = model.GetDeclaredSymbol(fieldDecl.Declaration.Variables[0]); 800var symbol = model.GetDeclaredSymbol(fieldDecl.Declaration.Variables[0]); 952Assert.Equal<ISymbol>(structSymbol, fSymbol.ContainingSymbol); 977Assert.Equal<ISymbol>(enumSymbol, mSymbol.ReturnType.OriginalDefinition); 985Assert.Equal<ISymbol>(structSymbol, mSymbol.Parameters[1].Type.OriginalDefinition); 1721Func<ISymbol, bool> isExtensionMethod = symbol => 1884Func<ISymbol, bool> isExtensionMethod = symbol => 2024private static void CheckSymbols(ImmutableArray<ISymbol> symbols, params string[] descriptions) 2029private static void CheckSymbolsUnordered(ImmutableArray<ISymbol> symbols, params string[] descriptions) 2167Func<int, INamespaceOrTypeSymbol, string, bool, ImmutableArray<ISymbol>> lookupAttributeTypeWithQualifier = (pos, qualifierOpt, name, isVerbatim) => 2186Func<int, string, bool, ImmutableArray<ISymbol>> lookupAttributeType = (pos, name, isVerbatim) => 2817var n1 = info.Symbol; 2976var dsyma2 = model.GetDeclaredSymbol(node1.Members[1]); 3317var symbol = model.GetDeclaredSymbol(paramNode); 3344var symbol = model.GetDeclaredSymbol(paramNode); 3370var symbol = model.GetDeclaredSymbol(paramNode); 3387var symbol = model.GetDeclaredSymbol(node); 3411var symbol = model.GetDeclaredSymbol(foreachNode); 3432var symbol = model.GetDeclaredSymbol(delegateNode); 3451var symbol = model.GetDeclaredSymbol(usingNode); 3481var symbol = model.GetDeclaredSymbol(foreachNode); 3504var symbol = model.GetDeclaredSymbol(foreachNode); 3531var symbol1 = model.GetDeclaredSymbol(foreachNode1); 3537var symbol2 = model.GetDeclaredSymbol(foreachNode2); 3568var symbol = model.GetDeclaredSymbol(catchDeclaration); 3589var symbol = model.GetDeclaredSymbol(methodDecl); 3614var symbol = model.GetDeclaredSymbol(methodDecl); 3642var symbol = model.GetDeclaredSymbol(enumMemberDecl); 3688var symbol = model.GetDeclaredSymbol(globalStmt); 3712var symbol = model.GetSemanticInfoSummary(gotoStatement.Expression).Symbol; 5132var symbol = model.GetDeclaredSymbol(node);
Compilation\SemanticModelGetSemanticInfoTests.cs (10)
343var symbol = semanticInfo.Symbol; 431var symbol = semanticInfo.Symbol; 4546var symbol = semanticInfo.Symbol; 6253var symbol = semanticInfo.Symbol; 6370var symbol = semanticInfo.Symbol; 13137var symbol = semanticInfo.CandidateSymbols[0]; 13171var symbol = semanticInfo.CandidateSymbols[0]; 13205var symbol = semanticInfo.CandidateSymbols[0]; 15377var infoSymbol = semanticModel.GetQueryClauseInfo(qc).OperationInfo.Symbol; 15381var infoSymbol2 = semanticModel.GetSymbolInfo(qe.Body.SelectOrGroup).Symbol;
Compilation\SymbolVisitorTests.cs (7)
27where T : ISymbol 31where T : ISymbol 39public override void DefaultVisit(ISymbol symbol) 195where T : ISymbol 199where T : ISymbol 207public override string DefaultVisit(ISymbol symbol) 382where T : ISymbol
DocumentationComments\CrefTests.cs (48)
915var expected = new ISymbol[] 1011var expected = new ISymbol[] 1110var expected = new ISymbol[] 2946var actualSymbol = model.GetSymbolInfo(crefSyntax).Symbol; 2970var actualTypeSymbol = model.GetSymbolInfo(crefSyntax.Container).Symbol; 2973var actualMethodSymbol1 = model.GetSymbolInfo(crefSyntax.Member).Symbol; 2976var actualMethodSymbol2 = model.GetSymbolInfo(((NameMemberCrefSyntax)crefSyntax.Member).Name).Symbol; 3017var actualTypeArgument = model.GetSymbolInfo(left.TypeArgumentList.Arguments.Single()).Symbol; 3032var actualTypeArgument = model.GetSymbolInfo(right.TypeArgumentList.Arguments.Single()).Symbol; 3074var expectedIndexer = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single().ISymbol; 3075var actualIndexer = model.GetSymbolInfo(crefSyntax).Symbol; 3078var expectedParameterType = compilation.GetSpecialType(SpecialType.System_Int32).ISymbol; 3079var actualParameterType = model.GetSymbolInfo(crefSyntax.Parameters.Parameters.Single().Type).Symbol; 3101var expectedOperator = typeC.GetMember<MethodSymbol>(WellKnownMemberNames.UnaryPlusOperatorName).ISymbol; 3102var actualOperator = model.GetSymbolInfo(crefSyntax).Symbol; 3105var expectedParameterType = typeC.ISymbol; 3106var actualParameterType = model.GetSymbolInfo(crefSyntax.Parameters.Parameters.Single().Type).Symbol; 3128var expectedOperator = typeC.GetMember<MethodSymbol>(WellKnownMemberNames.ImplicitConversionName).ISymbol; 3129var actualOperator = model.GetSymbolInfo(crefSyntax).Symbol; 3132var expectedParameterType = typeC.ISymbol; 3133var actualParameterType = model.GetSymbolInfo(crefSyntax.Parameters.Parameters.Single().Type).Symbol; 3136var expectedReturnType = compilation.GetSpecialType(SpecialType.System_Int32).ISymbol; 3137var actualReturnType = model.GetSymbolInfo(crefSyntax.Type).Symbol; 5088var expectedSymbols = new ISymbol[] { null, null, outerCtor, outerCtor }; 5235var m1a = type.GetMembers("M1").First(); 5236var m1b = type.GetMembers("M1").Last(); 5237var m2a = type.GetMembers("M2").First(); 5238var m2b = type.GetMembers("M2").Last(); 5598var actualSymbol = model.GetSymbolInfo(cref).Symbol; 5628var actualSymbol = model.GetSymbolInfo(cref).Symbol; 5716var symbol = model.GetSymbolInfo(cref).Symbol; 5798var typeSymbol = model.GetSymbolInfo(typeSyntax).Symbol; 5854var symbol = model.GetSymbolInfo(cref).Symbol; 5903var actualSymbol = model.GetSymbolInfo(cref).Symbol; 5927var actualSymbol = model.GetSymbolInfo(cref).Symbol; 5976var actualSymbol = model.GetSymbolInfo(cref).Symbol; 6028var actualSymbol = model.GetSymbolInfo(cref).Symbol; 6050var typeParameterSymbol = model.GetSymbolInfo(typeParameterSyntax).Symbol; 6074var methodSymbol = model.GetSymbolInfo(methodNameSyntax).Symbol; 6111var actualReturnTypeSymbol = model.GetSymbolInfo(returnTypeSyntax).Symbol; 6115var actualCrefSymbol = model.GetSymbolInfo(crefSyntax).Symbol; 6149var actualParameterTypeSymbol = model.GetSymbolInfo(parameterTypeSyntax).Symbol; 6153var actualCrefSymbol = model.GetSymbolInfo(crefSyntax).Symbol; 6191var parameterTypeSymbol = model.GetSymbolInfo(parameterTypeSyntax).Symbol; 6535var actualSymbol0 = model.GetSymbolInfo(crefs[0]).Symbol; 6538var actualSymbol1 = model.GetSymbolInfo(crefs[1]).Symbol; 6645private static ISymbol[] GetCrefOriginalDefinitions(SemanticModel model, IEnumerable<CrefSyntax> crefs) 6871var symbol = model.GetSymbolInfo(crefSyntaxes.Single()).Symbol;
DocumentationComments\DocumentationCommentIDTests.cs (2)
145var symbol = model.GetSymbolInfo(syntax).Symbol; 166var symbol = model.GetDeclaredSymbol(syntax);
DocumentationComments\ParameterTests.cs (12)
39var typeParameter = type.TypeParameters.Single().ISymbol; 63var parameter = method.Parameters.Single().ISymbol; 87var typeParameter = method.TypeParameters.Single().ISymbol; 111var parameter = indexer.Parameters.Single().ISymbol; 140var parameter = property.SetMethod.Parameters.Single().ISymbol; 165var parameter = indexer.SetMethod.Parameters.Last().ISymbol; 278var parameter = method.Parameters.Single().ISymbol; 379var typeParameter = method.TypeParameters.Single().ISymbol; 380var parameter = method.Parameters.Single().ISymbol; 802var expectedTypeParameter = type.TypeParameters.Single().ISymbol; 803var expectedParameter = indexer.Parameters.Single().ISymbol; 804var expectedValueParameter = indexer.SetMethod.Parameters.Last().ISymbol;
SymbolDisplay\SymbolDisplayTests.cs (21)
4539var goo = a.GetMembers("Goo").Single(); 4731var type = outer.GetMembers("Inner").Single(); 4732var method = outer.GetMembers("M").Single(); 4733var property = outer.GetMembers("P").Single(); 4734var field = outer.GetMembers("F").Single(); 4735var @event = outer.GetMembers("E").Single(); 4736var @delegate = outer.GetMembers("D").Single(); 4737var error = outer.GetMembers("Error").Single(); 5274var symbol = comp.GetMember("C.f"); 5380var method = type.GetMembers("F").Single(); 5381var property = type.GetMembers("P").Single(); 5382var indexer = type.GetMembers().Where(m => m.Kind == SymbolKind.Property && ((IPropertySymbol)m).IsIndexer).Single(); 5584var method = type.GetMembers("F").Single(); 5585var property = type.GetMembers("P").Single(); 5586var indexer = type.GetMembers().Where(m => m.Kind == SymbolKind.Property && ((IPropertySymbol)m).IsIndexer).Single(); 5933var member = comp.GetMember("C.F1"); 6067var member = comp.GetMember(memberName); 7603var symbol = model.GetSymbolInfo(variable).Symbol; 7697var symbol = model.GetSymbolInfo(constructor).Symbol; 7757var symbol = model.GetSymbolInfo(constructor).Symbol; 8557var op = model.GetSymbolInfo(binaryExpression).Symbol;
Symbols\AnonymousTypesSemanticsTests.cs (5)
589var method = info.Symbol; 657var method = info.Symbol; 678var method = info.Symbol; 699var method = info.Symbol; 1878private void AssertCannotConstruct(ISymbol type)
Symbols\AnonymousTypesSymbolTests.cs (1)
1651foreach (var m in mems)
Symbols\ConversionTests.cs (2)
1799var symbol = model.GetSymbolInfo(syntax).Symbol; 1833var symbol = model.GetSymbolInfo(syntax).Symbol;
Symbols\ExtensionMethodTests.cs (7)
2441var symbol = info.Symbol; 3150var firstInvocationSymbol = model.GetSymbolInfo(firstInvocation).Symbol; 3151var firstInvocationExpressionSymbol = model.GetSymbolInfo(firstInvocationExpression).Symbol; 3155var secondInvocationSymbol = model.GetSymbolInfo(secondInvocation).Symbol; 3156var secondInvocationExpressionSymbol = model.GetSymbolInfo(secondInvocationExpression).Symbol; 3877var setMember = model.LookupSymbols(instance.Position, baseClass, "SetMember", includeReducedExtensionMethods: true).Single(); 3969var setMember = model.LookupSymbols(instance.Position, baseClass, "SetMember", includeReducedExtensionMethods: true).Single();
Symbols\LocalFunctionTests.cs (3)
35var local = semanticModel.GetDeclaredSymbol(localSyntax); 56var local = semanticModel.GetDeclaredSymbol(localSyntax); 77var local = semanticModel.GetDeclaredSymbol(localSyntax);
Symbols\Source\DeclaringSyntaxNodeTests.cs (15)
24ISymbol symbol, 53ISymbol symbol, 78ISymbol symbol, 141var sym = model.GetDeclaredSymbol(node); 196foreach (ISymbol s in types) 208foreach (ISymbol s in c1.GetTypeMembers()) 272foreach (ISymbol memb in localA1Type.GetMembers()) 344Assert.Equal<ISymbol>(localType, symbol); 354foreach (var member in localType.GetMembers()) 377Assert.Equal<ISymbol>(member, propSymbol); 454foreach (ISymbol s in c1.TypeParameters) 521foreach (ISymbol memb in e1.GetMembers()) 532foreach (ISymbol memb in c1.GetMembers()) 555foreach (ISymbol memb in constructedC1.GetMembers()) 575foreach (ISymbol memb in c2.GetMembers())
Symbols\Source\FileModifierTests.cs (3)
3090var classC = compilation.GetMember("NS.C").GetPublicSymbol(); 3162var classC = compilation.GetMember("NS.C").GetPublicSymbol(); 3224var classC = compilation.GetMember("C").GetPublicSymbol();
Symbols\Source\NullablePublicAPITests.cs (18)
2840var event1 = model.GetSymbolInfo(memberAccess[2]).Symbol; 2841var event2 = model.GetSymbolInfo(memberAccess[3]).Symbol; 3113foreach (var symbol in symbolInfo.CandidateSymbols) 3539var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 3600var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 3669var o2Symbol = model.GetSymbolInfo(o2Reference).Symbol; 3856var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 3858var o2Symbol = model.GetDeclaredSymbol(o2Declaration); 3878var localFunctionSymbol = model.GetDeclaredSymbol(localFunction); 3915var fieldLambdaSymbol = model.GetSymbolInfo(fieldLambda).Symbol; 3929var propertyLambdaSymbol = model.GetSymbolInfo(propertyLambda).Symbol; 3980var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 4052var o2Symbol = model.GetDeclaredSymbol(o2Decl); 4055var o1RefSymbol = model.GetSymbolInfo(o1Ref).Symbol; 4058var o2RefSymbol = model.GetSymbolInfo(o2Ref).Symbol; 4116var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 4119var localFunctionSymbol = model.GetDeclaredSymbol(localFunction); 4179var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol;
Symbols\Source\UsingAliasTests.cs (8)
58var b2 = info2.Symbol; 64var b3 = info3.Symbol; 118var b2 = info2.Symbol; 124var b3 = info3.Symbol; 173var b2 = info2.Symbol; 179var b3 = info3.Symbol; 231var b2 = info2.Symbol; 237var b3 = info3.Symbol;
Symbols\SymbolEqualityTests.cs (14)
126var nonNullM = model.GetSymbolInfo(invocations[0]).Symbol; 127var nullM = model.GetSymbolInfo(invocations[1]).Symbol; 132var nonNullOriginal = nonNullM.OriginalDefinition; 133var nullOriginal = nullM.OriginalDefinition; 170var nonNullSubstituted = nonNullM.ContainingType.GetMembers("M").Single(); 171var nullSubstituted = nullM.ContainingType.GetMembers("M").Single(); 377ISymbol symbol2 = null; 378ISymbol symbol3 = null; 416var member1 = model.GetDeclaredSymbol(member1Syntax.Declaration.Variables[0]); 417var member2 = model.GetDeclaredSymbol(member2Syntax.Declaration.Variables[0]); 595var create1Symbol = model.GetSymbolInfo(create1Syntax).Symbol; 596var create2Symbol = model.GetSymbolInfo(create2Syntax).Symbol; 971private void VerifyEquality(ISymbol symbol1, ISymbol symbol2, bool expectedIncludeNullability)
Symbols\TypeTests.cs (1)
1854var symbol = info.Symbol;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Diagnostics\DiagnosticTest.cs (1)
2818public override string GetErrorDisplayString(ISymbol symbol)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (25)
CompilationTestUtils.cs (10)
30where TSymbol : ISymbol 60where TSymbol : ISymbol 67where TSymbol : ISymbol 72public static void CheckSymbol(ISymbol symbol, string description) 165Assert.Equal<ISymbol>(typeParameter.ContainingSymbol, constructedFrom); 207public ISymbol Symbol; 209public ImmutableArray<ISymbol> CandidateSymbols = ImmutableArray.Create<ISymbol>(); 218public ImmutableArray<ISymbol> MemberGroup = ImmutableArray.Create<ISymbol>();
CSharpTestBase.cs (1)
2014(ControlFlowGraph graph, ISymbol associatedSymbol) = ControlFlowGraphVerifier.GetControlFlowGraph(syntaxNode, model);
Extensions.cs (10)
170public static ISymbol GetMember(this Compilation compilation, string qualifiedName) 180public static T GetMember<T>(this Compilation compilation, string qualifiedName) where T : ISymbol 220private static ImmutableArray<ISymbol> GetMembers(INamespaceOrTypeSymbol container, string qualifiedName, out INamespaceOrTypeSymbol lastContainer) 259public static ISymbol GetMember(this INamespaceOrTypeSymbol container, string qualifiedName) 280public static T GetMember<T>(this INamespaceOrTypeSymbol symbol, string qualifiedName) where T : ISymbol 696public static ISymbol GetSpecialTypeMember(this Compilation compilation, SpecialMember specialMember) 711public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol member) 770public static ITypeSymbol GetTypeOrReturnType(this ISymbol symbol) 804public static ISymbol ConstructedFrom(this ISymbol symbol)
FunctionPointerUtilities.cs (1)
253Assert.Equal<ISymbol>(signatureType, semanticInfo.Type, SymbolEqualityComparer.Default);
SymbolUtilities.cs (3)
80public static string ListToSortedString<TSymbol>(this List<TSymbol> listOfSymbols) where TSymbol : ISymbol 116public static string[] ToTestDisplayStrings(this IEnumerable<ISymbol> symbols) 127public static string ToTestDisplayString(this ISymbol symbol, bool includeNonNullable)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
CodeGen\WinRTCollectionTests.cs (1)
7424var addMethod = model.GetSymbolInfo(add).Symbol;
Microsoft.CodeAnalysis.CSharp.Workspaces (200)
ArgumentSyntaxExtensions.cs (1)
59foreach (var symbol in symbols)
AttributeArgumentSyntaxExtensions.cs (1)
43foreach (var symbol in symbols)
CastSimplifier.cs (16)
559var castedSymbol = semanticModel.GetSymbolInfo(castedExpressionNode, cancellationToken).GetAnySymbol(); 569var memberSymbol = semanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).GetAnySymbol(); 810foreach (var sym in type.GetMembers(opName)) 949var symbol = semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken); 1022var oldSymbolInfo = originalSemanticModel.GetSymbolInfo(currentOld, cancellationToken).Symbol; 1023var newSymbolInfo = rewrittenSemanticModel.GetSymbolInfo(currentNew, cancellationToken).Symbol; 1075var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1080var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1146var implementationMember = rewrittenContainingType.FindImplementationForInterfaceMember(originalMemberSymbol); 1160for (var current = rewrittenMemberSymbol; current != null; current = current.GetOverriddenMember()) 1184var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1189var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1196private static bool IsComplementaryDelegateInvoke(ISymbol originalMemberSymbol, ISymbol rewrittenMemberSymbol) 1259ISymbol originalMemberSymbol, ISymbol rewrittenMemberSymbol, CancellationToken cancellationToken)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (5)
82var symbol = TryGetSymbol(name, symbolInfo); 110foreach (var symbol in symbolInfo.CandidateSymbols) 137[NotNullWhen(returnValue: true)] ISymbol? symbol, 365var symbol = symbolInfo.GetAnySymbol(); 381private static bool IsSymbolWithName([NotNullWhen(true)] ISymbol? symbol, string name)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
1782ImmutableArray<ISymbol> explicitInterfaceImplementations, 1820private static ExplicitInterfaceSpecifierSyntax CreateExplicitInterfaceSpecifier(ImmutableArray<ISymbol> explicitInterfaceImplementations)
CSharpCodeGenerationHelpers.cs (4)
207IEnumerable<ISymbol> implementations) 209var implementation = implementations.FirstOrDefault(); 245ISymbol symbol, 266public static T? GetReuseableSyntaxNodeForSymbol<T>(ISymbol symbol, CSharpCodeGenerationContextInfo info) where T : SyntaxNode
CSharpCodeGenerationService.cs (3)
76var newDestinationSymbol = destination.GetSymbolKey(cancellationToken).Resolve(compilation, cancellationToken: cancellationToken).Symbol; 198var members = new List<ISymbol>(); 887public override TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken)
CSharpSemanticFacts.cs (15)
56public ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 62var symbol = semanticModel.GetDeclaredSymbol(ancestor, cancellationToken); 243public IEnumerable<ISymbol> GetDeclaredSymbols( 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) 280return ImmutableArray<ISymbol>.Empty; 284AssignmentExpressionSyntax _ when token.Kind() == SyntaxKind.EqualsToken => GetDeconstructionAssignmentMethods(semanticModel, node).As<ISymbol>(), 285ForEachVariableStatementSyntax _ when token.Kind() == SyntaxKind.InKeyword => GetDeconstructionForEachMethods(semanticModel, node).As<ISymbol>(), 296private static ImmutableArray<ISymbol> GetSymbolInfo(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 346return ImmutableArray<ISymbol>.Empty; 352var symbol = semanticModel.GetSymbolInfo(node, cancellationToken).GetAnySymbol(); 358return ImmutableArray.Create<ISymbol>(type); 368public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken) 378var localFunctionSymbol = semanticModel.GetDeclaredSymbol(localFunction, cancellationToken);
CSharpSemanticFactsService.cs (1)
40protected override IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken)
CSharpSymbolDeclarationService.cs (1)
24public ImmutableArray<SyntaxReference> GetDeclarations(ISymbol symbol)
CSharpTypeInferenceService.TypeInferrer.cs (8)
1502foreach (var symbol in this.SemanticModel.GetSymbolInfo(subpattern.ExpressionColon.Expression).GetAllSymbols()) 2031var memberSymbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration); 2087var symbol = GetDeclaredMemberSymbolFromOriginalSemanticModel(declaration); 2096private ISymbol GetDeclaredMemberSymbolFromOriginalSemanticModel(SyntaxNode declarationInCurrentTree) 2231var symbol = SemanticModel.GetDeclaredSymbol(variableDeclarator); 2260private ImmutableArray<TypeInferenceInfo> InferTypeBasedOnLaterUsage(ISymbol symbol, SyntaxNode afterNode) 2277var descendantSymbol = SemanticModel.GetSymbolInfo(descendant, CancellationToken).GetAnySymbol(); 2306var symbol = SemanticModel.GetRequiredDeclaredSymbol(variable, CancellationToken);
CSharpUseImplicitTypeHelper.cs (1)
100var conflict = semanticModel.GetSpeculativeSymbolInfo(typeName.SpanStart, candidateReplacementNode, SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol;
Editing\CSharpImportAdder.cs (4)
57var symbol = model.GetSymbolInfo(fullName).Symbol; 137foreach (var member in type.GetMembers()) 202var symbol = _model.GetSymbolInfo(node, _cancellationToken).GetAnySymbol(); 226var symbol = _model.GetSymbolInfo(node.Name, _cancellationToken).GetAnySymbol();
ExternalAccess\Pythia\Api\PythiaSymbolExtensions.cs (11)
11public static string ToNameDisplayString(this ISymbol symbol) 14public static ITypeSymbol? GetMemberType(this ISymbol symbol) 17public static ITypeSymbol? GetSymbolType(this ISymbol? symbol) 20public static ISymbol? GetAnySymbol(this SymbolInfo info) 23public static ImmutableArray<T> FilterToVisibleAndBrowsableSymbols<T>(this ImmutableArray<T> symbols, bool hideAdvancedMembers, Compilation compilation) where T : ISymbol 26public static bool IsAccessibleWithin(this ISymbol symbol, ISymbol within, ITypeSymbol? throughType = null) 32public static ISymbol? GetOriginalUnreducedDefinition(this ISymbol? symbol) 35public static bool IsAwaitableNonDynamic(this ISymbol? symbol, SemanticModel semanticModel, int position) 38public static bool IsExtensionMethod(this ISymbol symbol)
ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (3)
26public override ExpressionSyntax DefaultVisit(ISymbol symbol) 29private static TExpressionSyntax AddInformationTo<TExpressionSyntax>(TExpressionSyntax syntax, ISymbol symbol) 105ISymbol symbol, ExpressionSyntax container, SimpleNameSyntax syntax)
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
35public override TypeSyntax DefaultVisit(ISymbol node) 38private static TTypeSyntax AddInformationTo<TTypeSyntax>(TTypeSyntax syntax, ISymbol symbol)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs\ExpressionSyntaxExtensions.cs (3)
369var symbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol; 422private static bool CanReplace(ISymbol symbol) 645var instanceSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).GetAnySymbol();
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs\SyntaxNodeExtensions.cs (1)
1008foreach (var symbol in info.GetAllSymbols())
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (4)
2006var enclosingSymbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 2508var containingSymbol = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken); 2835var symbol = semanticModel.GetSymbolInfo(expression, cancellationToken).GetAnySymbol(); 3039var symbol = leftHandBinding.GetBestOrAllSymbols().FirstOrDefault();
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (1)
112public static async Task<ISymbol?> FindApplicableAliasAsync(this ITypeSymbol type, int position, SemanticModel semanticModel, CancellationToken cancellationToken)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs\TypeSyntaxExtensions.cs (1)
45var firstSymbol = symbols.FirstOrDefault();
NamedTypeGenerator.cs (3)
102ImmutableArray<ISymbol> members, 106members = ImmutableArray<ISymbol>.Empty; 139IList<ISymbol> newMembers,
NamespaceGenerator.cs (2)
87IList<ISymbol> newMembers, 149private static UsingDirectiveSyntax? GenerateUsingDirective(ISymbol symbol)
NullableHelpers.cs (4)
18/// <see cref="IsSymbolAssignedPossiblyNullValue(SemanticModel, IOperation, ISymbol)"/>. Note 24var declaredSymbol = semanticModel.GetRequiredDeclaredSymbol(declarationSyntax, cancellationToken); 45public static bool? IsSymbolAssignedPossiblyNullValue(SemanticModel semanticModel, IOperation operation, ISymbol symbol) 98private static bool IsSymbolReferencedByOperation(IOperation operation, ISymbol symbol)
ParenthesizedExpressionSyntaxExtensions.cs (1)
311var exprSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol;
Recommendations\CSharpRecommendationServiceRunner.cs (17)
77private ImmutableArray<ISymbol> GetSymbolsForCurrentContext() 108return symbol == null ? ImmutableArray<ISymbol>.Empty : ImmutableArray.Create<ISymbol>(symbol); 115return ImmutableArray<ISymbol>.Empty; 176private ImmutableArray<ISymbol> GetSymbolsForGlobalStatementContext() 207private ImmutableArray<ISymbol> GetSymbolsForTypeArgumentOfConstraintClause() 209var enclosingSymbol = _context.LeftToken.GetRequiredParent() 219return ImmutableArray<ISymbol>.CastUp(symbols); 233private ImmutableArray<ISymbol> GetSymbolsForLabelContext() 244private ImmutableArray<ISymbol> GetSymbolsForTypeOrNamespaceContext() 261private ImmutableArray<ISymbol> GetSymbolsForExpressionOrStatementContext() 428ISymbol? containerSymbol = containerType; 430var symbol = leftHandBinding.GetAnySymbol(); 537private ImmutableArray<ISymbol> GetUnnamedSymbols(ExpressionSyntax originalExpression) 542return ImmutableArray<ISymbol>.Empty; 550using var _ = ArrayBuilder<ISymbol>.GetInstance(out var symbols); 566private void AddIndexers(ITypeSymbol container, ArrayBuilder<ISymbol> symbols)
Recommendations\CSharpRecommendationServiceRunner_Conversions.cs (6)
126private void AddConversions(ITypeSymbol container, ArrayBuilder<ISymbol> symbols) 144ITypeSymbol container, INamedTypeSymbol containerWithoutNullable, ArrayBuilder<ISymbol> symbols) 151foreach (var member in type.GetMembers(WellKnownMemberNames.ExplicitConversionName)) 192ITypeSymbol container, INamedTypeSymbol containerWithoutNullable, ArrayBuilder<ISymbol> symbols) 220ITypeSymbol container, INamedTypeSymbol containerWithoutNullable, ArrayBuilder<ISymbol> symbols, ImmutableArray<SpecialType> specialTypes) 257ITypeSymbol container, INamedTypeSymbol containerWithoutNullable, ArrayBuilder<ISymbol> symbols)
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (2)
19private static void AddOperators(ITypeSymbol container, ArrayBuilder<ISymbol> symbols) 31foreach (var member in type.GetMembers())
Rename\CSharpRenameRewriterLanguageService.cs (24)
61private readonly ISymbol _renamedSymbol; 361var symbol = symbols[0]; 368var sourceDefinition = await SymbolFinder.FindSourceDefinitionAsync(symbol, _solution, _cancellationToken).ConfigureAwait(false); 474IEnumerable<ISymbol> symbols; 549var symbol = _speculativeModel.GetSymbolInfo(token.Parent, _cancellationToken).Symbol; 751IEnumerable<ISymbol> newReferencedSymbols) 776var matchingLocal = relevantLocals.Single(); 791ISymbol renamedSymbol, 792ISymbol renameSymbol, 793IEnumerable<ISymbol> referencedSymbols, 858var properties = new List<ISymbol>(); 859foreach (var referencedSymbol in referencedSymbols) 861var property = await RenameUtilities.TryGetPropertyFromAccessorOrAnOverrideAsync( 938private static async Task<ISymbol?> GetVBPropertyFromAccessorOrAnOverrideAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 944var property = ((IMethodSymbol)symbol).AssociatedSymbol!; 951var originalSourceSymbol = await SymbolFinder.FindSourceDefinitionAsync(symbol.GetOverriddenMember(), solution, cancellationToken).ConfigureAwait(false); 967ArrayBuilder<Location> conflicts, IEnumerable<ISymbol> symbols, 970foreach (var symbol in symbols) 987ISymbol renameSymbol, ISymbol renamedSymbol, IEnumerable<ReferenceLocation> implicitReferenceLocations, CancellationToken cancellationToken) 1032ISymbol renamedSymbol, 1053foreach (var symbol in implicitSymbols) 1100public override void TryAddPossibleNameConflicts(ISymbol symbol, string replacementText, ICollection<string> possibleNameConflicts)
SemanticModelExtensions.cs (5)
39public static ImmutableArray<ISymbol> LookupName( 49return ImmutableArray.Create<ISymbol>(); 102public static ImmutableArray<ISymbol> LookupName( 286var symbol = semanticModel.GetDeclaredSymbol(type.Parent.Parent.Parent, cancellationToken); 298var symbol = semanticModel.GetDeclaredSymbol(variableDeclaration.Variables[0], cancellationToken);
Simplification\CSharpSimplificationService.Expander.cs (15)
546var symbol = _semanticModel.GetSymbolInfo(originalSimpleName.Identifier).Symbol; 739private static ExpressionSyntax TryAddTypeArgumentToIdentifierName(ExpressionSyntax newNode, ISymbol symbol) 766private IList<ISymbol> TypeArgumentSymbolsPresentInName(SimpleNameSyntax simpleName) 768var typeArgumentSymbols = new List<ISymbol>(); 775var symbol = _semanticModel.GetSymbolInfo(typeArgument).Symbol; 812private bool IsTypeArgumentDefinedRecursive(ISymbol symbol, IList<ISymbol> typeArgumentSymbols, bool enterContainingSymbol) 819var typeArgumentsInSymbol = new List<ISymbol>(); 822var typeArgumentsInOriginalDefinition = new List<ISymbol>(); 833private void TypeArgumentsInAllContainingSymbol(ISymbol symbol, IList<ISymbol> typeArgumentSymbols, bool enterContainingSymbol, bool isRecursive) 894ISymbol symbol, 926: (symbol.ContainingType ?? (ISymbol)symbol.ContainingNamespace).ToDisplayParts(s_typeNameFormatWithGenerics); 1052var targetSymbol = SimplificationHelpers.GetOriginalSymbolInfo(_semanticModel, memberAccess.Name); 1102var newContainingType = _semanticModel.GetSpeculativeSymbolInfo(speculationPosition, containingTypeSyntax, SpeculativeBindingOption.BindAsExpression).Symbol;
Simplification\Reducers\CSharpExtensionMethodReducer.cs (2)
115var oldSymbol = semanticModel.GetSymbolInfo(node).Symbol; 116var newSymbol = semanticModel.GetSpeculativeSymbolInfo(
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (2)
80ISymbol symbol, CancellationToken cancellationToken, out IAliasSymbol aliasReplacement) 263private static bool ValidateAliasForTarget(IAliasSymbol aliasReplacement, SemanticModel semanticModel, ExpressionSyntax node, ISymbol symbol)
Simplification\Simplifiers\ExpressionSimplifier.CandidateSymbolEqualityComparer.cs (4)
16private sealed class CandidateSymbolEqualityComparer : IEqualityComparer<ISymbol> 24public bool Equals(ISymbol x, ISymbol y) 34public int GetHashCode(ISymbol obj)
Simplification\Simplifiers\ExpressionSimplifier.cs (16)
122var symbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, memberAccess); 129semanticModel.GetMemberGroup(memberAccess, cancellationToken) is [ISymbol member, ..] 227ISymbol actualSymbol, 228out ImmutableArray<ISymbol> speculativeSymbols, 229out ImmutableArray<ISymbol> speculativeNamespacesAndTypes) 236: ImmutableArray<ISymbol>.Empty; 239: ImmutableArray<ISymbol>.Empty; 246private static bool IsReplacementCandidate(ISymbol actualSymbol, ImmutableArray<ISymbol> speculativeSymbols, ImmutableArray<ISymbol> speculativeNamespacesAndTypes) 318ISymbol symbol, 373var leftSymbol = semanticModel.GetSymbolInfo(memberAccess.Expression, cancellationToken).GetAnySymbol(); 417var leftSymbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, left); 420var rightSymbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, right); 426var enclosingSymbol = semanticModel.GetEnclosingSymbol(left.SpanStart); 427var enclosingTypeParametersInsideOut = new List<ISymbol>();
Simplification\Simplifiers\NameSimplifier.cs (2)
72var symbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, name); 259var typeSymbol = semanticModel.GetSymbolInfo(name, cancellationToken).Symbol;
Simplification\Simplifiers\QualifiedCrefSimplifier.cs (3)
44var symbol = symbolInfo.Symbol; 84var oldSymbol = semanticModel.GetSymbolInfo(crefSyntax, cancellationToken).Symbol; 91var newSymbol = semanticModel.GetSpeculativeSymbolInfo(crefSyntax.SpanStart, replacement, speculativeBindingOption).Symbol;
SpeculationAnalyzer.cs (4)
555var originalSymbol = this.OriginalSemanticModel.GetSymbolInfo(ctorInitializer, CancellationToken).Symbol; 556var newSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(newCtorInitializer, CancellationToken).Symbol; 562var originalSymbol = this.OriginalSemanticModel.GetCollectionInitializerSymbolInfo(originalInitializer, CancellationToken).Symbol; 563var newSymbol = this.SpeculativeSemanticModel.GetCollectionInitializerSymbolInfo(newInitializer, CancellationToken).Symbol;
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (47)
CodeGeneration\AddImportsTests.cs (1)
50var symbol = model.GetSymbolInfo(o).Symbol;
CodeGeneration\SymbolEditorTests.cs (28)
48private static async Task<IEnumerable<ISymbol>> GetSymbolsAsync(Solution solution, string name) 79var symbol = (await GetSymbolsAsync(solution, "C")).First(); 111var symbol = (await GetSymbolsAsync(solution, "C")).First(); 148var symbol = (await GetSymbolsAsync(solution, "C")).First(); 280var symbol = (await GetSymbolsAsync(solution, "C")).First(); 355var symbol = (await GetSymbolsAsync(solution, "C")).First(); 392var symbol = (await GetSymbolsAsync(solution, "C")).First(); 433var symbol = (await GetSymbolsAsync(solution, "C")).First(); 479var symbol = (await GetSymbolsAsync(solution, "C")).First(); 530var member = symbol.GetMembers("m").First(); 556var symbol = (await GetSymbolsAsync(solution, "C")).First(); 563var reboundSymbol = await editor.GetCurrentSymbolAsync(symbol); 593var symbol = (await GetSymbolsAsync(solution, "C")).First(); 600var reboundSymbol = await editor.GetCurrentSymbolAsync(symbol); 620var symbol = (await GetSymbolsAsync(solution, "C")).First(); 650var symbol = (await GetSymbolsAsync(solution, "C")).First(); 679var symbol = (await GetSymbolsAsync(solution, "C")).First(); 712var symbolX = symbol.GetMembers("X").First(); 713var symbolY = symbol.GetMembers("Y").First(); 767var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => g.IdentifierName("A")); 808var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => g.IdentifierName("A")); 841var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => g.IdentifierName("A")); 907var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => null); 948var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => null); 981var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => null); 1006var newSymbolC = await editor.SetBaseTypeAsync(symbol, g => null); 1034var property = typeC.GetMembers().First(m => m.Kind == SymbolKind.Property); 1044var iproperty = typeI.GetMembers().First(m => m.Kind == SymbolKind.Property);
CodeGeneration\SyntaxGeneratorTests.cs (18)
2227var method = type.GetMembers("M").Single(); 2248var method = type.GetMembers("M").Single(); 2269var method = type.GetMembers("M").Single(); 2290var method = type.GetMembers("M").Single(); 2311var method = type.GetMembers(WellKnownMemberNames.InstanceConstructorName).Single(); 2333var property = type.GetMembers("Prop").Single(); 2351var property = type.GetMembers("Prop").Single(); 2374var property = type.GetMembers("Accept").Single(); 2402var property = type.GetMembers("Accept").Single(); 2430var property = type.GetMembers("Accept").Single(); 2461var property = type.GetMembers("Accept").Single(); 2495var method = type.GetMembers().Single(m => m is IMethodSymbol { MethodKind: MethodKind.ExplicitInterfaceImplementation }); 2496var property = type.GetMembers().Single(m => m is IPropertySymbol { IsIndexer: false }); 2497var indexer = type.GetMembers().Single(m => m is IPropertySymbol { IsIndexer: true }); 2498var ev = type.GetMembers().Single(m => m is IEventSymbol); 2538var field = type.GetMembers("F").Single(); 2558var method = type.GetMembers(WellKnownMemberNames.DestructorName).Single(); 4705var declaration = semanticModel.GetDeclaredSymbol(node);
Microsoft.CodeAnalysis.EditorFeatures (26)
CodeDefinitionWindow\DefinitionContextTracker.cs (1)
190var symbol = await SymbolFinder.FindSymbolAtPositionAsync(
GoToDefinition\AbstractGoToDefinitionService.cs (4)
96Project project, int position, ISymbol symbol, Document originalDocument, CancellationToken cancellationToken) 126foreach (var impl in interfaceImpls) 139ISymbol symbolToNavigateTo, int caretPosition, Document document, CancellationToken cancellationToken) 156var candidateTypeSymbol = symbolToNavigateTo is ITypeSymbol
GoToDefinition\GoToDefinitionHelpers.cs (6)
25ISymbol? symbol, 71public static async Task<ISymbol?> TryGetPreferredSymbolAsync( 72Solution solution, ISymbol? symbol, CancellationToken cancellationToken) 96var definition = await SymbolFinder.FindSourceDefinitionAsync(symbol, solution, cancellationToken).ConfigureAwait(false); 110ISymbol symbol, 124ISymbol symbol,
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (1)
56public ISymbol RenameSymbol => _info.Symbol!;
IRefactorNotifyService.cs (2)
25bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure); 35bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure);
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (3)
87var symbol = await TryGetSymbolAsync(solutionWithOriginalName, document.Id, cancellationToken).ConfigureAwait(false); 205private async Task<ISymbol> TryGetSymbolAsync(Solution solutionWithOriginalName, DocumentId documentId, CancellationToken cancellationToken) 259ISymbol symbol,
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingSolutionSet.cs (2)
16public ISymbol Symbol { get; } 21ISymbol symbolToRename,
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (5)
210private async Task<TriggerIdentifierKind> DetermineIfRenamableSymbolsAsync(IEnumerable<ISymbol> symbols, Document document) 212foreach (var symbol in symbols) 215var sourceSymbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, document.Project.Solution, _cancellationToken).ConfigureAwait(false) ?? symbol; 226private async Task<TriggerIdentifierKind> DetermineIfRenamableSymbolAsync(ISymbol symbol, Document document, SyntaxToken token) 229var sourceSymbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, document.Project.Solution, _cancellationToken).ConfigureAwait(false) ?? symbol;
Shared\Extensions\IRefactorNotifyServiceExtensions.cs (2)
15ISymbol symbol, 34ISymbol symbol,
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (19)
NavigationCommandHandlers\FindBaseSymbolsCommandHandler.cs (1)
81var overriddenSymbol = relevantSymbol?.symbol.GetOverriddenMember();
NavigationCommandHandlers\FindDerivedSymbolsCommandHandler.cs (3)
60private static async Task<IEnumerable<ISymbol>> GatherSymbolsAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 106foreach (var candidate in candidates)
NavigationCommandHandlers\FindExtensionMethodsCommandHandler.cs (1)
109var sourceDefinition = await SymbolFinder.FindSourceDefinitionAsync(reducedMethod, solution, cancellationToken).ConfigureAwait(false);
NavigationCommandHandlers\FindImplementingMembersCommandHandler.cs (2)
140foreach (var interfaceMember in interfaceSymbol.GetMembers()) 145var impl = namedTypeSymbol.FindImplementationForInterfaceMember(interfaceMember);
NavigationCommandHandlers\FindMemberOverloadsCommandHandler.cs (2)
77var symbol = candidateSymbolProjectPair?.symbol; 83foreach (var curSymbol in symbol.ContainingType.GetMembers()
NavigationCommandHandlers\FindReferencesOfOverloadsCommandHandler.cs (9)
74private static async Task<ISymbol[]> GatherSymbolsAsync(ISymbol symbol, Microsoft.CodeAnalysis.Solution solution, CancellationToken token) 77var result = new ISymbol[implementations.Count() + 1]; 80foreach (var item in implementations) 95var symbol = relevantSymbol?.symbol; 111var symbolsToLookup = new List<ISymbol>(); 113foreach (var curSymbol in symbol.ContainingType.GetMembers() 122foreach (var sym in SymbolFinder.FindSimilarSymbols(curSymbol, compilation, cancellationToken)) 130foreach (var candidate in symbolsToLookup)
Snippets\SnippetFunctions\AbstractSnippetFunctionGenerateSwitchCases.cs (1)
63foreach (var member in enumFields)
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (2)
CodeActions\AbstractCodeActionTest.cs (1)
225ImmutableArray<ISymbol> members,
Diagnostics\AbstractSuppressionAllCodeTests.cs (1)
53var set = new HashSet<ISymbol>();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (20)
ChangeSignature\TestChangeSignatureOptionsService.cs (1)
31ISymbol symbol,
Completion\AbstractArgumentProviderTests`1.cs (1)
100var symbol = symbols.Single();
EditAndContinue\EditAndContinueTestHelpers.cs (4)
46public abstract ImmutableArray<SyntaxNode> GetDeclarators(ISymbol method); 292var expectedOldSymbol = (editKind is SemanticEditKind.Update or SemanticEditKind.Delete) ? expectedSemanticEdit.SymbolProvider(oldCompilation) : null; 293var expectedNewSymbol = expectedSemanticEdit.SymbolProvider(newCompilation); 324var deletedSymbolContainer = actualSemanticEdit.DeletedSymbolContainer?.Resolve(newCompilation, ignoreAssemblyKey: true).Symbol;
EditAndContinue\SemanticEditDescription.cs (4)
15public readonly Func<Compilation, ISymbol> SymbolProvider; 17public readonly Func<Compilation, ISymbol>? DeletedSymbolContainerProvider; 28Func<Compilation, ISymbol> symbolProvider, 32Func<Compilation, ISymbol>? deletedSymbolContainerProvider)
ExtractInterface\TestExtractInterfaceOptions.cs (3)
32public IEnumerable<ISymbol> AllExtractableMembers { get; private set; } 41public IEnumerable<ISymbol> ChosenMembers { get; set; } 47List<ISymbol> extractableMembers,
MoveStaticMembers\TestMoveStaticMembersService.cs (1)
37public MoveStaticMembersOptions GetMoveMembersToTypeOptions(Document document, INamedTypeSymbol selectedType, ImmutableArray<ISymbol> selectedNodeSymbols)
PullMemberUp\TestPullMemberUpService.cs (1)
29public PullMembersUpOptions GetPullMemberUpOptions(Document document, ImmutableArray<ISymbol> selectedNodeSymbols)
RenameTracking\MockRefactorNotifyService.cs (2)
23public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 35public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure)
Workspaces\TestSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (3)
24public CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution) 29public ISymbol _symbol; 34public Operation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (6)
Utilities\GoToHelpers\MockSymbolNavigationService.vb (2)
19Public Function GetNavigableLocationAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of INavigableLocation) Implements ISymbolNavigationService.GetNavigableLocationAsync 24Public Function TrySymbolNavigationNotifyAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of Boolean) Implements ISymbolNavigationService.TrySymbolNavigationNotifyAsync
Utilities\MockSymbolNavigationServiceProvider.vb (4)
36Public TryNavigateToSymbolProvidedSymbol As ISymbol 39Public TrySymbolNavigationNotifyProvidedSymbol As ISymbol 48Public Function GetNavigableLocationAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of INavigableLocation) Implements ISymbolNavigationService.GetNavigableLocationAsync 55symbol As ISymbol,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (128)
CodeGeneration\CodeGenerationTests.cs (14)
43IList<ISymbol> imports = null, 523ImmutableArray<Func<SemanticModel, ISymbol>> members = default, 567var attributeTarget = testContext.SemanticModel.GetDeclaredSymbol(taggedNode); 584ImmutableArray<Func<SemanticModel, ISymbol>> getNewMembers = default, 611var allMembers = new List<ISymbol>(); 695internal static ImmutableArray<Func<SemanticModel, ISymbol>> Members(params Func<SemanticModel, ISymbol>[] m) 712private static ImmutableArray<ISymbol> GetSymbols(ImmutableArray<Func<SemanticModel, ISymbol>> members, TestContext context) 719private static Func<SemanticModel, ISymbol> CreateEnumField(string name, object value) 726internal static Func<SemanticModel, ISymbol> CreateField(Accessibility accessibility, Editing.DeclarationModifiers modifiers, Type type, string name) 909public IEnumerable<ISymbol> GetAnnotatedDeclaredSymbols(string key, SemanticModel semanticModel) 914yield return GetSelectedSymbol<ISymbol>(span, semanticModel); 919where T : class, ISymbol
MetadataAsSource\AbstractMetadataAsSourceTests.cs (2)
57var navigationSymbol = await context.GetNavigationSymbolAsync(); 107var metadataSymbol = await context.ResolveSymbolAsync(symbolName);
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (6)
74public Task<MetadataAsSourceFile> GenerateSourceAsync(ISymbol symbol, Project? project = null, bool signaturesOnly = true) 96var symbol = await ResolveSymbolAsync(symbolMetadataName, compilation); 180public async Task<ISymbol?> ResolveSymbolAsync(string symbolMetadataName, Compilation? compilation = null) 225var memberSymbol = namedTypeSymbol.GetMembers() 321internal async Task<ISymbol> GetNavigationSymbolAsync() 328var symbol = semanticModel.GetSymbolInfo(syntaxRoot.FindNode(testDocument.SelectedSpans.Single())).Symbol;
MetadataAsSource\MetadataAsSourceTests.cs (22)
2701var navigationSymbol = await context.GetNavigationSymbolAsync(); 2743var navigationSymbol = await context.GetNavigationSymbolAsync(); 3208var navigationSymbol = await context.GetNavigationSymbolAsync(); 3248var navigationSymbol = await context.GetNavigationSymbolAsync(); 3277var navigationSymbol = await context.GetNavigationSymbolAsync(); 4757var navigationSymbol = await context.GetNavigationSymbolAsync(); 4799var navigationSymbol = await context.GetNavigationSymbolAsync(); 4830var navigationSymbol = await context.GetNavigationSymbolAsync(); 4888var navigationSymbol = await context.GetNavigationSymbolAsync(); 4943var navigationSymbol = await context.GetNavigationSymbolAsync(); 5006var navigationSymbol = await context.GetNavigationSymbolAsync(); 5056var navigationSymbol = await context.GetNavigationSymbolAsync(); 5107var navigationSymbol = await context.GetNavigationSymbolAsync(); 5155var navigationSymbol = await context.GetNavigationSymbolAsync(); 5203var navigationSymbol = await context.GetNavigationSymbolAsync(); 5249var navigationSymbol = await context.GetNavigationSymbolAsync(); 5295var navigationSymbol = await context.GetNavigationSymbolAsync(); 5341var navigationSymbol = await context.GetNavigationSymbolAsync(); 5385var navigationSymbol = await context.GetNavigationSymbolAsync(); 5449var navigationSymbol = await context.GetNavigationSymbolAsync(); 5523var navigationSymbol = await context.GetNavigationSymbolAsync(); 5567var navigationSymbol = await context.GetNavigationSymbolAsync();
StackTraceExplorer\StackTraceExplorerTests.cs (1)
53var expectedSymbol = semanticModel.GetDeclaredSymbol(node);
SymbolFinder\DependentTypeFinderTests.cs (2)
758var methodSymbol = classSymbol.GetMembers("M").Single(); 763var interfaceMember = Assert.Single(interfaceMembers);
SymbolFinder\FindSymbolAtPositionTests.cs (2)
19private static Task<ISymbol> FindSymbolAtPositionAsync(TestWorkspace workspace) 40var symbol = await FindSymbolAtPositionAsync(workspace);
SymbolKey\SymbolKeyCrossLanguageTests.cs (1)
48var methodSymbol = semanticModel.GetDeclaredSymbol(method);
Utilities\SymbolEquivalenceComparerTests.cs (78)
200var field1_v1 = type1_v1.GetMembers("field1").Single(); 201var field1_v2 = type1_v2.GetMembers("field1").Single(); 202var field2_v1 = type1_v1.GetMembers("field2").Single(); 203var field2_v2 = type2_v2.GetMembers("field2").Single(); 204var field3_v1 = type2_v1.GetMembers("field3").Single(); 205var field3_v2 = type2_v2.GetMembers("field3").Single(); 206var field4_v1 = type2_v1.GetMembers("field4").Single(); 207var field4_v2 = type1_v2.GetMembers("field4").Single(); 251var field1_v1 = type1_v1.GetMembers("field1").Single(); 252var field1_v2 = type1_v2.GetMembers("field1").Single(); 253var field2_v1 = type1_v1.GetMembers("field2").Single(); 254var field2_v2 = type2_v2.GetMembers("field2").Single(); 255var field3_v1 = type2_v1.GetMembers("field3").Single(); 256var field3_v2 = type2_v2.GetMembers("field3").Single(); 257var field4_v1 = type2_v1.GetMembers("field4").Single(); 258var field4_v2 = type1_v2.GetMembers("field4").Single(); 293var goo = typeC.GetMembers("goo").Single(); 294var goo_intInstantiation1 = intInstantiation1.Type.GetMembers("goo").Single(); 295var goo_stringInstantiation = stringInstantiation.Type.GetMembers("goo").Single(); 296var goo_instanceInstantiation = instanceInstantiation.Type.GetMembers("goo").Single(); 297var goo_intInstantiation2 = intInstantiation2.Type.GetMembers("goo").Single(); 332var method_v1 = type1_v1.GetMembers("Goo").Single(); 333var method_v2 = type1_v2.GetMembers("Goo").Single(); 357var method_v1 = type1_v1.GetMembers("Goo").Single(); 358var method_v2 = type1_v2.GetMembers("Goo1").Single(); 382var method_v1 = type1_v1.GetMembers("Goo").Single(); 383var method_v2 = type1_v2.GetMembers("Goo").Single(); 407var method_v1 = type1_v1.GetMembers("Goo").Single(); 408var method_v2 = type1_v2.GetMembers("Goo").Single(); 432var method_v1 = type1_v1.GetMembers("Goo").Single(); 433var method_v2 = type1_v2.GetMembers("Goo").Single(); 459var method_v1 = type1_v1.GetMembers("Goo").Single(); 460var method_v2 = type1_v2.GetMembers("Goo").Single(); 486var method_v1 = type1_v1.GetMembers("Goo").Single(); 487var method_v2 = type1_v2.GetMembers("Goo").Single(); 513var method_v1 = type1_v1.GetMembers("Goo").Single(); 514var method_v2 = type1_v2.GetMembers("Goo").Single(); 538var method_v1 = type1_v1.GetMembers("Goo").Single(); 539var method_v2 = type1_v2.GetMembers("Goo").Single(); 563var method_v1 = type1_v1.GetMembers("Goo").Single(); 564var method_v2 = type1_v2.GetMembers("Goo").Single(); 590var method_v1 = type1_v1.GetMembers("Goo").Single(); 591var method_v2 = type1_v2.GetMembers("Goo").Single(); 624var csharpGooMethod = csharpType1.GetMembers("Goo").Single(); 625var csharpBarMethod = csharpType1.GetMembers("Bar").Single(); 626var vbGooMethod = vbType1.GetMembers("Goo").Single(); 627var vbQuuxMethod = vbType1.GetMembers("Quux").Single(); 669var csharpGooMethod = csharpType1.GetMembers("Goo").Single(); 670var csharpBarMethod = csharpType1.GetMembers("Bar").Single(); 671var vbGooMethod = vbType1.GetMembers("Goo").Single(); 672var vbBarMethod = vbType1.GetMembers("Bar").Single(); 699var field1_v1 = type1_v1.GetMembers("field1").Single(); 700var field2_v1 = type1_v1.GetMembers("field2").Single(); 726var method_v1 = type1_v1.GetMembers("Goo").Single(); 727var method_v2 = type1_v2.GetMembers("Goo").Single(); 761var method_v1 = type1_v1.GetMembers("Goo").Single(); 762var method_v2 = type1_v2.GetMembers("Goo").Single(); 794var method_v1 = type1_v1.GetMembers("Goo").Single(); 795var method_v2 = type1_v2.GetMembers("Goo").Single(); 829var method_v1 = type1_v1.GetMembers("Goo").Single(); 830var method_v2 = type1_v2.GetMembers("Goo").Single(); 1085var method_v1 = type1_v1.GetMembers("Goo").Single(); 1086var method_v2 = type1_v2.GetMembers("Goo").Single(); 1116var method_v1 = type1_v1.GetMembers("M").Single(); 1117var method_v2 = type1_v2.GetMembers("M").Single(); 1156var method_v1 = type1_v1.GetMembers("M").Single(); 1157var method_v2 = type1_v2.GetMembers("M").Single(); 1186var method_v1 = type1_v1.GetMembers("M").Single(); 1187var method_v2 = type1_v2.GetMembers("M").Single(); 1216var method_v1 = type1_v1.GetMembers("M").Single(); 1217var method_v2 = type1_v2.GetMembers("M").Single(); 1247var method_v1 = type1_v1.GetMembers("M").Single(); 1248var method_v2 = type1_v2.GetMembers("M").Single(); 1278var method_v1 = type1_v1.GetMembers("M").Single(); 1279var method_v2 = type1_v2.GetMembers("M").Single(); 1310var method_v1 = type1_v1.GetMembers("M").Single(); 1311var method_v2 = type1_v2.GetMembers("M").Single(); 1759var method = type1.GetMembers(methodName).Single();
Microsoft.CodeAnalysis.EditorFeatures.Wpf (5)
Peek\DefinitionPeekableItem.cs (1)
80var symbol = _peekableItem._symbolKey.Resolve(compilation, ignoreAssemblyKey: true, cancellationToken: cancellationToken).Symbol;
Peek\IPeekableItemFactory.cs (1)
16Task<IEnumerable<IPeekableItem>> GetPeekableItemsAsync(ISymbol symbol, Project project, IPeekResultFactory peekResultFactory, CancellationToken cancellationToken);
Peek\PeekableItemFactory.cs (1)
48ISymbol symbol,
Peek\PeekableItemSource.cs (1)
103var symbol = semanticInfo.GetAnySymbol(includeType: true);
Peek\PeekHelpers.cs (1)
47internal static LinePositionSpan GetEntityOfInterestSpan(ISymbol symbol, Workspace workspace, Location identifierLocation, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
Diagnostics\DiagnosticServiceTests.vb (1)
1630Dim symbols = New HashSet(Of ISymbol)
Rename\RenameEngineResult.vb (1)
123symbol As ISymbol,
Workspaces\TryFindSourceDefinitionTests.vb (1)
261Assert.Equal(Of ISymbol)(originalClass, mappedMember)
Microsoft.CodeAnalysis.ExternalAccess.Debugger (1)
DebuggerFindReferencesService.cs (1)
32public async Task FindSymbolReferencesAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (19)
CodeRefactorings\WorkspaceServices\IOmniSharpSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (1)
11CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution);
ExtractClass\IOmniSharpExtractClassOptionsService.cs (3)
12Task<OmniSharpExtractClassOptions?> GetExtractClassOptionsAsync(Document document, INamedTypeSymbol originalType, ImmutableArray<ISymbol> selectedMembers); 39public ISymbol Member { get; } 47ISymbol member,
ExtractInterface\IOmniSharpExtractInterfaceOptionsService.cs (3)
15List<ISymbol> extractableMembers, 28public ImmutableArray<ISymbol> IncludedMembers { get; } 33public OmniSharpExtractInterfaceOptionsResult(bool isCancelled, ImmutableArray<ISymbol> includedMembers, string interfaceName, string fileName, OmniSharpExtractLocation location)
Internal\CodeRefactorings\WorkspaceServices\OmniSharpSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (1)
27public CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution)
Internal\ExtractClass\OmniSharpExtractClassOptionsService.cs (1)
30public async Task<ExtractClassOptions?> GetExtractClassOptionsAsync(Document document, INamedTypeSymbol originalType, ImmutableArray<ISymbol> selectedMembers, CancellationToken cancellationToken)
Internal\ExtractInterface\OmniSharpExtractInterfaceOptionsService.cs (1)
40List<ISymbol> extractableMembers,
Internal\PickMembers\OmniSharpPickMembersService.cs (1)
27public PickMembersResult PickMembers(string title, ImmutableArray<ISymbol> members, ImmutableArray<PickMembersOption> options = default, bool selectAll = true)
MetadataAsSource\OmniSharpMetadataAsSourceHelpers.cs (1)
19public static Task<Location> GetLocationInGeneratedSourceAsync(ISymbol symbol, Document generatedDocument, CancellationToken cancellationToken)
MetadataAsSource\OmniSharpMetadataAsSourceService.cs (2)
33public static async Task<Document> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken) 59public static Task<Document> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, OmniSharpSyntaxFormattingOptionsWrapper formattingOptions, CancellationToken cancellationToken)
PickMembers\IOmniSharpPickMembersService.cs (3)
13string title, ImmutableArray<ISymbol> members, 34public readonly ImmutableArray<ISymbol> Members; 39ImmutableArray<ISymbol> members,
Rename\OmniSharpRenamer.cs (2)
22ISymbol symbol, 25ImmutableHashSet<ISymbol>? nonConflictSymbols,
Microsoft.CodeAnalysis.Features (1084)
AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
53var symbol = semanticModel.GetDeclaredSymbol(declarator, cancellationToken);
AbstractAddParameterCodeFixProvider.cs (1)
153var symbol = semanticModel.GetSymbolInfo(typeNode, cancellationToken).GetAnySymbol();
AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
114for (ISymbol current = symbol; current != null; current = current.ContainingSymbol)
AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (2)
112foreach (var member in members) 205private static bool IsFieldWrite(IFieldReferenceOperation fieldReference, ISymbol owningSymbol)
AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
90var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken) ?? semanticModel.GetSymbolInfo(node, cancellationToken).GetAnySymbol();
AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
138ImmutableArray.Create<ISymbol>(methodSymbol), document.Project.Solution, cancellationToken).ConfigureAwait(false);
AbstractMakeTypePartialCodeFixProvider.cs (1)
38var symbol = semanticModel.GetDeclaredSymbol(declaration, cancellationToken);
AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
71var symbol = context.SemanticModel.GetDeclaredSymbol(namespaceDecl); 177var symbol = semanticModel.GetDeclaredSymbol(typeDecl);
AbstractObjectCreationExpressionAnalyzer.cs (1)
34private ISymbol _initializedSymbol;
AbstractPopulateSwitchCodeFixProvider.cs (1)
40protected abstract ICollection<ISymbol> GetMissingEnumMembers(TSwitchOperation switchOperation);
AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
39protected abstract ICollection<ISymbol> GetMissingEnumMembers(TSwitchOperation operation);
AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
46protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchExpressionOperation switchOperation)
AbstractPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
29protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchExpressionOperation operation)
AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
62protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation switchOperation)
AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
29protected sealed override ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation operation)
AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (2)
51protected abstract bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node); 153static bool IsStaticMemberOrIsLocalFunctionHelper(ISymbol symbol)
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
746using var _ = PooledHashSet<ISymbol>.GetInstance(out var processedPartialSymbols); 757foreach (var symbol in symbols)
AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
58var symbol = semanticModel.GetDeclaredSymbol(diagnosticNode, cancellationToken);
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (17)
71protected virtual void HandleNamedTypeSymbolStart(SymbolStartAnalysisContext context, Action<ISymbol, ValueUsageInfo> onSymbolUsageFound) 81private readonly Dictionary<ISymbol, ValueUsageInfo> _symbolValueUsageStateMap = new(); 178Action<ISymbol, ValueUsageInfo> onSymbolUsageFound = OnSymbolUsage; 206var symbol = symbolContext.Symbol.OriginalDefinition; 242private void OnSymbolUsage(ISymbol memberSymbol, ValueUsageInfo usageInfo) 261private bool TryRemove(ISymbol memberSymbol, out ValueUsageInfo valueUsageInfo) 278var memberSymbol = memberReference.Member.OriginalDefinition; 364foreach (var symbol in symbolInfo.GetAllSymbols()) 403PooledHashSet<ISymbol> symbolsReferencedInDocComments = null; 410foreach (var member in namedType.GetMembers()) 494ISymbol member) 536private PooledHashSet<ISymbol> GetCandidateSymbolsReferencedInDocComments(INamedTypeSymbol namedTypeSymbol, Compilation compilation, CancellationToken cancellationToken) 538var builder = PooledHashSet<ISymbol>.GetInstance(); 547var symbol = lazyModel.GetSymbolInfo(node, cancellationToken).Symbol?.OriginalDefinition; 569foreach (var member in namedTypeSymbol.GetMembers()) 585private void AddDebuggerDisplayAttributeArgumentsCore(ISymbol symbol, ArrayBuilder<string> builder) 610private bool IsCandidateSymbol(ISymbol memberSymbol)
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
268public bool IsComputingUnusedParams(ISymbol symbol) 273ISymbol symbol,
AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (7)
31/// We use this value in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/> to determine whether to bail from analysis or not. 44/// We use this value in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/> to determine whether to bail from analysis or not. 50/// We use this value in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/> to determine whether to bail from analysis or not. 219/// delegate escape, and corresponding bail out from flow analysis in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/>. 267/// delegate escape, and corresponding bail out from flow analysis in <see cref="ShouldAnalyze(IOperation, ISymbol, ref bool)"/>. 332private bool ShouldAnalyze(IOperation operationBlock, ISymbol owningSymbol, ref bool hasOperationNoneDescendant) 551ISymbol symbol,
AbstractUnsealClassCodeFixProvider.cs (1)
42var definition = await SymbolFinder.FindSourceDefinitionAsync(
AbstractUseAutoPropertyAnalyzer.cs (1)
110foreach (var member in namedType.GetMembers())
AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
180var symbol = semanticModel.GetSymbolInfo(identifier, cancellationToken).GetAnySymbol();
AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
35protected abstract (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol);
AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
28protected override (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol)
AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
55var containingSymbol = semanticModel.GetRequiredEnclosingSymbol(ifStatement.SpanStart, cancellationToken);
AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
28protected override (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol)
AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
101var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
303var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
79var memberSymbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).GetAnySymbol();
AbstractUseThrowExpressionDiagnosticAnalyzer.cs (6)
106if (!TryDecomposeIfCondition(ifOperation, out var localOrParameter)) 138private static bool ValueIsAccessed(SemanticModel semanticModel, IConditionalOperation ifOperation, IBlockOperation containingBlock, ISymbol localOrParameter, IExpressionStatementOperation expressionStatement, IAssignmentOperation assignmentExpression) 169IBlockOperation containingBlock, IConditionalOperation ifOperation, ISymbol localOrParameter, 191if (!TryGetLocalOrParameterSymbol(assignmentExpression.Value, out var assignmentValue)) 211[NotNullWhen(true)] out ISymbol? localOrParameter) 243[NotNullWhen(true)] out ISymbol? localOrParameter)
AddAccessibilityModifiersHelpers.cs (2)
15SyntaxEditor editor, ISymbol symbol, SyntaxNode declaration) 41private static Accessibility GetPreferredAccessibility(ISymbol symbol)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (2)
27private readonly ISymbol _containingType; 41ISymbol containingType,
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.ConstructorCandidate.cs (2)
14public readonly ImmutableArray<ISymbol> MissingMembers; 17public ConstructorCandidate(IMethodSymbol constructor, ImmutableArray<ISymbol> missingMembers, ImmutableArray<IParameterSymbol> missingParameters)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (5)
28ImmutableArray<ISymbol> selectedMembers, 44ImmutableArray<ISymbol> selectedMembers, 79ImmutableArray<ISymbol> selectedMembers, 122private static ConstructorCandidate CreateConstructorCandidate(ImmutableArray<IParameterSymbol> parametersForSelectedMembers, ImmutableArray<ISymbol> selectedMembers, IMethodSymbol constructor) 125using var _1 = ArrayBuilder<ISymbol>.GetInstance(out var missingMembersBuilder);
AddImport\SearchScopes\AllSymbolsProjectSearchScope.cs (1)
32protected override async Task<ImmutableArray<ISymbol>> FindDeclarationsAsync(
AddImport\SearchScopes\MetadataSymbolsSearchScope.cs (2)
47protected override async Task<ImmutableArray<ISymbol>> FindDeclarationsAsync( 53return ImmutableArray<ISymbol>.Empty;
AddImport\SearchScopes\SearchScope.cs (3)
38protected abstract Task<ImmutableArray<ISymbol>> FindDeclarationsAsync(SymbolFilter filter, SearchQuery query); 41public async Task<ImmutableArray<SymbolResult<ISymbol>>> FindDeclarationsAsync( 46return ImmutableArray<SymbolResult<ISymbol>>.Empty;
AddImport\SearchScopes\SourceSymbolsProjectSearchScope.cs (2)
35protected override async Task<ImmutableArray<ISymbol>> FindDeclarationsAsync( 43return ImmutableArray<ISymbol>.Empty;
AddImport\SymbolReferenceFinder.cs (3)
315var symbol = _semanticModel.GetSymbolInfo(expression, searchScope.CancellationToken).GetAnySymbol(); 611private static ImmutableArray<SymbolResult<T>> OfType<T>(ImmutableArray<SymbolResult<ISymbol>> symbols) where T : ISymbol
AddImport\SymbolResult.cs (3)
78private readonly struct SymbolResult<T> where T : ISymbol 101public SymbolResult<T2> WithSymbol<T2>(T2 symbol) where T2 : ISymbol 110public static SymbolResult<T> Create<T>(string desiredName, TSimpleNameSyntax nameNode, T symbol, double weight) where T : ISymbol
ChangeSignature\AbstractChangeSignatureService.cs (17)
40public abstract Task<(ISymbol? symbol, int selectedIndex)> GetInvocationSymbolAsync(Document document, int position, bool restrictToDeclarations, CancellationToken cancellationToken); 48public abstract Task<ImmutableArray<ISymbol>> DetermineCascadedSymbolsFromDelegateInvokeAsync( 53ISymbol declarationSymbol, 86protected abstract ImmutableArray<IParameterSymbol> GetParameters(ISymbol declarationSymbol); 225ISymbol symbol, 253var declaredSymbol = context.Symbol; 256var definitionToUse = new Dictionary<SyntaxNode, ISymbol>(); 289var symbolWithSyntacticParameters = symbol.Definition; 290var symbolWithSemanticParameters = symbol.Definition; 438private static void AddUpdatableNodeToDictionaries(Dictionary<DocumentId, List<SyntaxNode>> nodesToUpdate, DocumentId documentId, SyntaxNode nodeToUpdate, Dictionary<SyntaxNode, ISymbol> definitionToUse, ISymbol symbolWithSemanticParameters) 441if (definitionToUse.TryGetValue(nodeToUpdate, out var sym) && sym != symbolWithSemanticParameters) 464ISymbol declarationSymbol, 574private SignatureChange UpdateSignatureChangeToIncludeExtraParametersFromTheDeclarationSymbol(ISymbol declarationSymbol, SignatureChange updatedSignature) 754ISymbol declarationSymbol, 944foreach (var symbol in fullyOrderedSymbols) 1035protected static bool IsParamsArrayExpandedHelper(ISymbol symbol, int argumentCount, bool lastArgumentIsNamed, SemanticModel semanticModel, SyntaxNode lastArgumentExpression, CancellationToken cancellationToken)
ChangeSignature\ChangeSignatureAnalyzedContext.cs (2)
16public readonly ISymbol Symbol; 22Document document, int positionForTypeBinding, ISymbol symbol, ParameterConfiguration parameterConfiguration, CodeCleanupOptionsProvider fallbackOptions)
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (5)
35protected override async ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 41using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 43var beginInvoke = symbol.ContainingType.GetMembers(WellKnownMemberNames.DelegateBeginInvokeName).FirstOrDefault(); 92var convertedType = (ISymbol?)state.SemanticModel.GetTypeInfo(node, cancellationToken).ConvertedType;
ChangeSignature\IChangeSignatureOptionsService.cs (1)
24ISymbol symbol,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (5)
52ISymbol targetSymbol, 61SyntaxNode targetNode, ISymbol targetSymbol, INamedTypeSymbol suppressMessageAttribute, Diagnostic diagnostic); 258public ISymbol TargetSymbol { get; set; } 294ISymbol targetSymbol = null; 377protected static string GetTargetString(ISymbol targetSymbol)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs (3)
20private readonly ISymbol _targetSymbol; 26ISymbol targetSymbol, INamedTypeSymbol suppressMessageAttribute, 53internal ISymbol TargetSymbol_TestOnly => _targetSymbol;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (13)
29private readonly IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>> _diagnosticsBySymbol; 35IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>> diagnosticsBySymbol, 160private static async Task<IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>> CreateDiagnosticsBySymbolAsync(AbstractSuppressionCodeFixProvider fixer, IEnumerable<KeyValuePair<Document, ImmutableArray<Diagnostic>>> diagnosticsByDocument, CancellationToken cancellationToken) 162var diagnosticsMapBuilder = ImmutableDictionary.CreateBuilder<ISymbol, List<Diagnostic>>(); 171var targetSymbol = suppressionTargetInfo.TargetSymbol; 181private static async Task<IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>> CreateDiagnosticsBySymbolAsync(Project project, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 183var diagnosticsMapBuilder = ImmutableDictionary.CreateBuilder<ISymbol, List<Diagnostic>>(); 198private static void AddDiagnosticForSymbolIfNeeded(ISymbol targetSymbol, Diagnostic diagnostic, ImmutableDictionary<ISymbol, List<Diagnostic>>.Builder diagnosticsMapBuilder) 214private static IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>> CreateDiagnosticsBySymbol(ImmutableDictionary<ISymbol, List<Diagnostic>>.Builder diagnosticsMapBuilder) 218return SpecializedCollections.EmptyEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>(); 221var builder = new List<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>();
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.LocalSuppressMessageCodeAction.cs (2)
17private readonly ISymbol _targetSymbol; 25ISymbol targetSymbol,
CodeLens\CodeLensFindReferenceProgress.cs (7)
30private readonly ISymbol _queriedSymbol; 50ISymbol queriedDefinition, 79private static bool FilterDefinition(ISymbol definition) 86private IEnumerable<Location> GetPartialLocations(ISymbol symbol, CancellationToken cancellationToken) 97public void OnDefinitionFound(ISymbol symbol) 126private bool FilterReference(ISymbol definition, ReferenceLocation reference) 140public void OnReferenceFound(ISymbol symbol, ReferenceLocation location)
CodeLens\CodeLensReferencesService.cs (6)
57var symbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken); 146var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken); 218private static ISymbol GetEnclosingMethod(SemanticModel semanticModel, Location location, CancellationToken cancellationToken) 220var enclosingSymbol = semanticModel.GetEnclosingSymbol(location.SourceSpan.Start, cancellationToken); 222for (var current = enclosingSymbol; current != null; current = current.ContainingSymbol) 282var declaredSymbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken);
CodeRefactorings\AddAwait\AbstractAddAwaitCodeRefactoringProvider.cs (1)
86var symbol = model.GetSymbolInfo(node, cancellationToken).GetAnySymbol();
CodeRefactorings\MoveType\AbstractMoveTypeService.RenameTypeEditor.cs (1)
31var symbol = State.SemanticDocument.SemanticModel.GetDeclaredSymbol(State.TypeNode, CancellationToken);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (6)
332var memberSymbol = semanticModel.GetDeclaredSymbol(memberDecl, cancellationToken); 366private async Task<ImmutableArray<ISymbol>> GetDeclaredSymbolsInContainerAsync( 373var builder = ArrayBuilder<ISymbol>.GetInstance(); 377var symbol = semanticModel.GetDeclaredSymbol(declaration, cancellationToken); 517Document document, ISymbol symbol, CancellationToken cancellationToken) 550private static async Task<ImmutableArray<ReferencedSymbol>> FindReferencesAsync(ISymbol symbol, Document document, CancellationToken cancellationToken)
CodeRefactorings\WorkspaceServices\ISymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (1)
13CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution);
Common\TaggedText.cs (3)
91public static ImmutableArray<TaggedText> ToTaggedText(this IEnumerable<SymbolDisplayPart> displayParts, Func<ISymbol, string> getNavigationHint = null, bool includeNavigationHints = true) 95this IEnumerable<SymbolDisplayPart> displayParts, TaggedTextStyle style, Func<ISymbol, string> getNavigationHint = null, bool includeNavigationHints = true) 126private static string GetNavigationTarget(ISymbol symbol)
Completion\CommonCompletionUtilities.cs (8)
91ISymbol symbol, 98SolutionServices workspaceServices, SemanticModel semanticModel, int position, SymbolDescriptionOptions options, IReadOnlyList<ISymbol> symbols) 104SolutionServices workspaceServices, SemanticModel semanticModel, int position, IReadOnlyList<ISymbol> symbols, SymbolDescriptionOptions options, SupportedPlatformData supportedPlatforms) 110SolutionServices workspaceServices, SemanticModel semanticModel, int position, ISymbol symbol, int overloadCount, SymbolDescriptionOptions options, SupportedPlatformData? supportedPlatforms, CancellationToken cancellationToken) 175SolutionServices workspaceServices, SemanticModel semanticModel, int position, IReadOnlyList<ISymbol> symbols, SymbolDescriptionOptions options, SupportedPlatformData? supportedPlatforms, CancellationToken cancellationToken) 179var symbol = symbols.FirstOrDefault(s => !s.IsObsolete()) ?? symbols[0]; 198List<TaggedText> textContentBuilder, ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter, CancellationToken cancellationToken) 232public static bool TryRemoveAttributeSuffix(ISymbol symbol, SyntaxContext context, [NotNullWhen(true)] out string? name)
Completion\Providers\AbstractContextVariableArgumentProvider.cs (8)
35ISymbol? bestSymbol = null; 38foreach (var symbol in symbols) 40ISymbol candidate; 58foreach (var symbol in symbols) 60ISymbol candidate; 89var enclosingSymbol = context.SemanticModel.GetEnclosingSymbol(targetToken.SpanStart, context.CancellationToken); 110void CheckCandidate(ISymbol candidate, string? overridingName = null) 153bool IsNewNameSameOrBetter(ISymbol symbol)
Completion\Providers\AbstractCrefCompletionProvider.cs (1)
44protected abstract Task<(SyntaxToken, SemanticModel?, ImmutableArray<ISymbol>)> GetSymbolsAsync(
Completion\Providers\AbstractDocCommentCompletionProvider.cs (7)
101protected abstract ImmutableArray<IParameterSymbol> GetParameters(ISymbol symbol); 138protected IEnumerable<CompletionItem> GetNestedItems(ISymbol? symbol, bool includeKeywords) 156private IEnumerable<CompletionItem> GetParamRefItems(ISymbol symbol) 166private IEnumerable<CompletionItem> GetTypeParamRefItems(ISymbol symbol) 176protected IEnumerable<CompletionItem> GetAttributeValueItems(ISymbol? symbol, string tagName, string attributeName) 208protected ImmutableArray<CompletionItem> GetTopLevelItems(ISymbol? symbol, TSyntax syntax) 256private IEnumerable<CompletionItem> GetParameterItems<TSymbol>(ImmutableArray<TSymbol> symbols, TSyntax syntax, string tagName) where TSymbol : ISymbol
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (4)
30protected abstract Task<ISymbol> GenerateMemberAsync(ISymbol member, INamedTypeSymbol containingType, Document document, CompletionItem item, CancellationToken cancellationToken); 134var overriddenMember = symbols.FirstOrDefault(); 149var generatedMember = await GenerateMemberAsync(overriddenMember, containingType, document, completionItem, cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (6)
22protected abstract string EscapeIdentifier(ISymbol symbol); 55IEnumerable<ISymbol> members = semanticModel.LookupSymbols(position, initializedType); 71foreach (var uninitializedMember in uninitializedMembers) 99private static bool IsLegalFieldOrProperty(ISymbol symbol) 108protected virtual bool IsInitializable(ISymbol member, INamedTypeSymbol containingType) 116private static bool CanSupportObjectInitializer(ISymbol symbol)
Completion\Providers\AbstractOverrideCompletionProvider.cs (5)
25public abstract ImmutableArray<ISymbol> FilterOverrides(ImmutableArray<ISymbol> members, ITypeSymbol? returnType); 40protected override Task<ISymbol> GenerateMemberAsync(ISymbol newOverriddenMember, INamedTypeSymbol newContainingType, Document newDocument, CompletionItem completionItem, CancellationToken cancellationToken) 76protected static ITypeSymbol GetReturnType(ISymbol symbol)
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (2)
89ISymbol symbol, SemanticModel semanticModel, 111out ImmutableArray<ISymbol> overridableMembers)
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (2)
63protected override async Task<ISymbol> GenerateMemberAsync(ISymbol member, INamedTypeSymbol containingType, Document document, CompletionItem item, CancellationToken cancellationToken)
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (7)
27protected abstract bool IsInstrinsic(ISymbol symbol); 30protected abstract string GetFilterText(ISymbol symbol, string displayText, TSyntaxContext context); 62foreach (var symbol in recommendedSymbols.NamedSymbols) 75private static bool IsValidForTaskLikeTypeOnlyContext(ISymbol symbol, TSyntaxContext context) 101private static bool IsValidForGenericConstraintContext(ISymbol symbol) 126private static ITypeSymbol? GetSymbolType(ISymbol symbol) 179private static int ComputeSymbolMatchPriority(ISymbol symbol)
Completion\Providers\AbstractSymbolCompletionProvider.cs (7)
31protected abstract (string displayText, string suffix, string insertionText) GetDisplayAndSuffixAndInsertionText(ISymbol symbol, TSyntaxContext context); 52ISymbol symbol, 104Dictionary<ISymbol, List<ProjectId>>? invalidProjectMap, 170private static SupportedPlatformData? ComputeSupportedPlatformData(CompletionContext completionContext, ImmutableArray<SymbolAndSelectionInfo> symbols, Dictionary<ISymbol, List<ProjectId>>? invalidProjectMap, List<ProjectId>? totalProjects) 211protected static string GetFilterTextDefault(ISymbol symbol, string displayText, TSyntaxContext context) 361private static Dictionary<ISymbol, List<ProjectId>> FindSymbolsMissingInLinkedContexts( 365var missingSymbols = new Dictionary<ISymbol, List<ProjectId>>(LinkedFilesSymbolEquivalenceComparer.Instance);
Completion\Providers\AbstractSymbolCompletionProvider.SymbolAndSelectionInfo.cs (1)
14protected readonly record struct SymbolAndSelectionInfo(ISymbol Symbol, bool Preselect)
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (1)
103private static ITypeSymbol? GetSymbolType(ISymbol symbol)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionProvider.cs (1)
84var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(aliasNode, cancellationToken);
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (1)
425static bool IsAccessible(ISymbol symbol, bool internalsVisible)
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
170private static (ISymbol? symbol, int overloadCount) GetSymbolAndOverloadCount(CompletionItem item, Compilation compilation)
Completion\Providers\MemberInsertingCompletionItem.cs (1)
20ISymbol symbol,
Completion\Providers\SymbolCompletionItem.cs (21)
23private static readonly Func<IReadOnlyList<ISymbol>, CompletionItem, CompletionItem> s_addSymbolEncoding = AddSymbolEncoding; 24private static readonly Func<IReadOnlyList<ISymbol>, CompletionItem, CompletionItem> s_addSymbolInfo = AddSymbolInfo; 30IReadOnlyList<ISymbol> symbols, 33Func<IReadOnlyList<ISymbol>, CompletionItem, CompletionItem> symbolEncoder, 54var firstSymbol = symbols[0]; 73public static CompletionItem AddSymbolEncoding(IReadOnlyList<ISymbol> symbols, CompletionItem item) 76public static CompletionItem AddSymbolInfo(IReadOnlyList<ISymbol> symbols, CompletionItem item) 78var symbol = symbols[0]; 100public static string EncodeSymbols(IReadOnlyList<ISymbol> symbols) 116public static string EncodeSymbol(ISymbol symbol) 124public static async Task<ImmutableArray<ISymbol>> GetSymbolsAsync(CompletionItem item, Document document, CancellationToken cancellationToken) 129using var _ = ArrayBuilder<ISymbol>.GetInstance(out var symbols); 152return ImmutableArray<ISymbol>.Empty; 155private static void DecodeSymbols(List<string> ids, Compilation compilation, ArrayBuilder<ISymbol> symbols) 160var symbol = DecodeSymbol(id, compilation); 173private static ISymbol? DecodeSymbol(string id, Compilation compilation) 184CompletionItem item, Document document, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken) 268IReadOnlyList<ISymbol> symbols, 300IReadOnlyList<ISymbol> symbols, 324IReadOnlyList<ISymbol> symbols, 355CompletionItem item, IReadOnlyList<ISymbol> symbols, Document document, SemanticModel semanticModel, SymbolDescriptionOptions options, CancellationToken cancellationToken)
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (4)
261using var _ = ArrayBuilder<ISymbol>.GetInstance(out var members); 292var readonlyProperties = ImmutableArray<ISymbol>.CastUp( 315string className, bool isRecord, ImmutableArray<ITypeParameterSymbol> capturedTypeParameters, ImmutableArray<ISymbol> members) 384var parameterToPropMap = new Dictionary<string, ISymbol>();
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
393private bool CheckIfForEachVariableIsWrittenInside(SemanticModel semanticModel, ISymbol foreachVariable, TForEachStatement foreachStatement)
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (2)
232INamedTypeSymbol containingType, ITypeSymbol type, string memberName) where TSymbol : class, ISymbol 239INamedTypeSymbol containingType, ITypeSymbol type, string memberName) where TSymbol : class, ISymbol
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (6)
816document, namedTypeWithoutMembers, ImmutableArray<ISymbol>.CastUp(fields), 820ImmutableArray<ISymbol>.CastUp(fields), cancellationToken).ConfigureAwait(false); 822using var _ = ArrayBuilder<ISymbol>.GetInstance(out var members); 872SyntaxGenerator generator, ArrayBuilder<ISymbol> members, 903ImmutableArray<ITypeParameterSymbol> typeParameters, ImmutableArray<ISymbol> members) 920using var _ = PooledDictionary<string, ISymbol>.GetInstance(out var parameterToPropMap);
Debugging\AbstractBreakpointResolver.cs (10)
76protected abstract IEnumerable<ISymbol> GetMembers(INamedTypeSymbol type, string name); 79private BreakpointResolutionResult CreateBreakpoint(ISymbol methodSymbol) 123private async Task<IEnumerable<ISymbol>> FindMembersAsync( 133return SpecializedCollections.EmptyList<ISymbol>(); 155return ImmutableArray<ISymbol>.Empty; 201private IEnumerable<ISymbol> FindMembers(IEnumerable<INamespaceOrTypeSymbol> containers, params NameAndArity[] names) 212private IEnumerable<ISymbol> FindMembers(IEnumerable<INamedTypeSymbol> types, NameAndArity nameAndArity) 231private static IMethodSymbol GetPartialImplementationPartOrNull(ISymbol symbol) 237private bool IsApplicable(ISymbol methodOrProperty, int? parameterCount, CancellationToken cancellationToken) 281private static bool IsMismatch(ISymbol methodOrProperty, int? parameterCount)
DeclarationComputer.cs (4)
17var declaredSymbol = GetDeclaredSymbol(model, node, getSymbol, cancellationToken); 21internal static DeclarationInfo GetDeclarationInfo(SyntaxNode node, ISymbol? declaredSymbol, IEnumerable<SyntaxNode>? executableCodeBlocks) 42private static ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken) 49var declaredSymbol = model.GetDeclaredSymbol(node, cancellationToken);
DeclarationInfo.cs (2)
15internal DeclarationInfo(SyntaxNode declaredNode, ImmutableArray<SyntaxNode> executableCodeBlocks, ISymbol? declaredSymbol) 42public ISymbol? DeclaredSymbol { get; }
DecompiledSource\IDecompiledSourceService.cs (1)
26Task<Document?> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, MetadataReference? metadataReference, string? assemblyLocation, SyntaxFormattingOptions formattingOptions, CancellationToken cancellationToken);
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (5)
84internal ISymbol TypeResolutionSymbol { get; set; } 290public ImmutableArray<TaggedText> Format(string rawXmlText, ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat format, CancellationToken cancellationToken) 456var symbol = DocumentationCommentId.GetFirstSymbolForDeclarationId(crefAttribute.Value, semanticModel.Compilation); 510var symbol = DocumentationCommentId.GetFirstSymbolForDeclarationId(crefValue, semanticModel.Compilation); 529string 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 (7)
73var symbol = await SymbolFinder.FindSymbolAtPositionAsync( 110ISymbol symbol, 135private static bool ShouldConsiderSymbol(ISymbol symbol) 161IImmutableSet<Document> documentsToSearch, ISymbol symbol, 194Document document, ISymbol symbol, CancellationToken cancellationToken) 201ISymbol symbol, 279private static bool ShouldIncludeDefinition(ISymbol symbol)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (101)
274protected abstract OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol, EditKind editKind)> GetSymbolEdits( 287protected abstract ImmutableArray<ISymbol> GetCapturedVariables(SemanticModel model, SyntaxNode memberBody); 292protected abstract IEnumerable<SyntaxNode> GetVariableUseSites(IEnumerable<SyntaxNode> roots, ISymbol localOrParameter, SemanticModel model, CancellationToken cancellationToken); 328internal string GetDisplayName(ISymbol symbol) 418internal abstract void ReportInsertedMemberSymbolRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, ISymbol newSymbol, SyntaxNode newNode, bool insertingIntoExistingContainingType); 441internal abstract bool HasParameterClosureScope(ISymbol member); 736internal virtual void ReportDeclarationInsertDeleteRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, SyntaxNode oldNode, SyntaxNode newNode, ISymbol oldSymbol, ISymbol newSymbol, EditAndContinueCapabilitiesGrantor capabilities, CancellationToken cancellationToken) 949ISymbol oldSymbol, 950ISymbol newSymbol, 2281protected static bool SymbolsEquivalent(ISymbol oldSymbol, ISymbol newSymbol) 2342ISymbol? oldMember, 2343ISymbol? newMember, 2397protected virtual bool IsRudeEditDueToPrimaryConstructor(ISymbol symbol, CancellationToken cancellationToken) 2435using var _1 = PooledHashSet<ISymbol>.GetInstance(out var processedSymbols); 2460var symbol = newSymbol ?? oldSymbol; 2473var oldSymbolInNewCompilation = SymbolKey.Create(oldSymbol, cancellationToken).Resolve(newCompilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 2474var newSymbolInOldCompilation = SymbolKey.Create(newSymbol, cancellationToken).Resolve(oldCompilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 2738var newContainingSymbol = containingSymbolKey.Resolve(newCompilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 3339(SyntaxNode? oldDeclaration, SyntaxNode? newDeclaration) GetSymbolDeclarationNodes(ISymbol? oldSymbol, ISymbol? newSymbol, SyntaxNode? oldNode, SyntaxNode? newNode) 3356private bool TryAddParameterInsertOrDeleteEdits(ArrayBuilder<SemanticEditInfo> semanticEdits, ISymbol containingSymbol, SemanticModel? otherModel, EditAndContinueCapabilitiesGrantor capabilities, Func<SyntaxNode, SyntaxNode?>? syntaxMap, EditScript<SyntaxNode> editScript, HashSet<ISymbol> processedSymbols, CancellationToken cancellationToken, out bool notSupportedByRuntime) 3401var otherContainingSymbol = otherModel.GetDeclaredSymbol(otherContainingNode, cancellationToken); 3409var oldSymbol = (otherContainingNode == oldNode) ? otherContainingSymbol : containingSymbol; 3410var newSymbol = (otherContainingNode == oldNode) ? containingSymbol : otherContainingSymbol; 3435private static bool AllowsDeletion(ISymbol symbol) 3475private static void AddMemberOrAssociatedMemberSemanticEdits(ArrayBuilder<SemanticEditInfo> semanticEdits, SemanticEditKind editKind, ISymbol symbol, SymbolKey? containingSymbolKey, Func<SyntaxNode, SyntaxNode?>? syntaxMap, SymbolKey? partialType, HashSet<ISymbol>? processedSymbols, CancellationToken cancellationToken) 3541void AddEdit(ISymbol? symbol) 3551private ImmutableArray<(ISymbol? oldSymbol, ISymbol? newSymbol, EditKind editKind)> GetNamespaceSymbolEdits( 3556using var _1 = ArrayBuilder<(ISymbol? oldSymbol, ISymbol? newSymbol, EditKind editKind)>.GetInstance(out var builder); 3580var newType = SymbolKey.Create(oldType, cancellationToken).Resolve(newModel.Compilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 3613var oldType = SymbolKey.Create(newType, cancellationToken).Resolve(oldModel.Compilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 3686ISymbol oldSymbol, 3687ISymbol newSymbol, 4179ISymbol oldSymbol, 4180ISymbol newSymbol, 4188HashSet<ISymbol>? processedSymbols, 4235ISymbol oldSymbol, 4236ISymbol newSymbol, 4280private static void AddParameterUpdateSemanticEdit(ArrayBuilder<SemanticEditInfo> semanticEdits, IParameterSymbol oldParameterSymbol, IParameterSymbol newParameterSymbol, Func<SyntaxNode, SyntaxNode?>? syntaxMap, bool reportDeleteAndInsertEdits, HashSet<ISymbol>? processedSymbols, CancellationToken cancellationToken) 4282var newContainingSymbol = newParameterSymbol.ContainingSymbol; 4286var oldContainingSymbol = oldParameterSymbol.ContainingSymbol; 4308var beginInvokeMethod = delegateType.GetMembers("BeginInvoke").FirstOrDefault(); 4317ISymbol oldSymbol, 4318ISymbol newSymbol, 4348ISymbol oldSymbol, 4349ISymbol newSymbol, 4504private bool CanAddNewMember(ISymbol newSymbol, EditAndContinueCapabilitiesGrantor capabilities, CancellationToken cancellationToken) 4523foreach (var member in GetRecordUpdatedSynthesizedMembers(compilation, recordType)) 4530private static IEnumerable<ISymbol> GetRecordUpdatedSynthesizedMembers(Compilation compilation, INamedTypeSymbol record) 4577ISymbol oldSymbol, 4602private void ReportUpdateRudeEdit(ArrayBuilder<RudeEditDiagnostic> diagnostics, RudeEditKind rudeEdit, ISymbol newSymbol, SyntaxNode? newNode, CancellationToken cancellationToken) 4624private void ReportUpdateRudeEdit(ArrayBuilder<RudeEditDiagnostic> diagnostics, RudeEditKind rudeEdit, ISymbol oldSymbol, ISymbol newSymbol, SyntaxNode? newNode, Compilation newCompilation, CancellationToken cancellationToken) 4636private static SyntaxNode GetRudeEditDiagnosticNode(ISymbol symbol, CancellationToken cancellationToken) 4638var container = symbol; 4652private static SyntaxNode GetDeleteRudeEditDiagnosticNode(ISymbol oldSymbol, Compilation newCompilation, CancellationToken cancellationToken) 4654var oldContainer = oldSymbol.ContainingSymbol; 4658var newContainer = containerKey.Resolve(newCompilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 4674ISymbol newSymbol, 4709private void ReportTypeLayoutUpdateRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, ISymbol symbol, SyntaxNode syntax) 4861Roslyn.Utilities.IReadOnlySet<ISymbol> processedSymbols, 4904ISymbol? oldCtor; 5070foreach (var member in type.GetMembers()) 5087private static ISymbol? TryGetParameterlessConstructor(INamedTypeSymbol type, bool isStatic) 5100private static bool IsPartialEdit(ISymbol? oldSymbol, ISymbol? newSymbol, SyntaxTree oldSyntaxTree, SyntaxTree newSyntaxTree) 5120ISymbol newMember, 5233using var _11 = PooledDictionary<ISymbol, int>.GetInstance(out var oldCapturesIndex); 5234using var _12 = PooledDictionary<ISymbol, int>.GetInstance(out var newCapturesIndex); 5262var newCapture = newCaptures[newCaptureIndex]; 5415ImmutableArray<ISymbol> captures, 5416ImmutableArray<ISymbol> newCaptures, 5418PooledDictionary<ISymbol, int> capturesIndex, 5477private BitVector GetAccessedCaptures(SyntaxNode lambdaBody, SemanticModel model, ImmutableArray<ISymbol> captures, PooledDictionary<ISymbol, int> capturesIndex) 5491private static void MarkVariables(ref BitVector mask, ImmutableArray<ISymbol> variables, Dictionary<ISymbol, int> index) 5493foreach (var variable in variables) 5516private static TextSpan GetThisParameterDiagnosticSpan(ISymbol member) 5519private static TextSpan GetVariableDiagnosticSpan(ISymbol local) 5565ImmutableArray<ISymbol> oldCaptures, 5567ImmutableArray<ISymbol> newCaptures, 5568ISymbol newMember, 5614var oldCapture = oldCaptures[i]; 5628var newCapture = newCaptures[newCaptureIndex]; 5684var oldCapture = oldCaptures[oldCaptureIndex]; 5767var oldCapture = oldCaptures[oldCaptureIndex]; 5901private static ITypeSymbol GetType(ISymbol localOrParameter) 5909private SyntaxNode GetCapturedVariableScope(ISymbol localOrParameter, SyntaxNode memberBody, CancellationToken cancellationToken) 5915var member = localOrParameter.ContainingSymbol; 5957ISymbol oldMember, 6052private static bool IsGlobalMain(ISymbol symbol) 6055private static bool InGenericContext(ISymbol symbol, out bool isGenericMethod) 6057var current = symbol;
EditAndContinue\EditSession.cs (5)
670out ImmutableHashSet<ISymbol> addedSymbols, 674using var _1 = PooledHashSet<ISymbol>.GetInstance(out var addedSymbolsBuilder); 675using var _2 = ArrayBuilder<(ISymbol? oldSymbol, ISymbol? newSymbol)>.GetInstance(edits.Count, out var resolvedSymbols); 774using var _3 = PooledHashSet<ISymbol>.GetInstance(out var visitedSymbols);
EditAndContinue\ProjectChanges.cs (2)
27public readonly ImmutableHashSet<ISymbol> AddedSymbols; 42ImmutableHashSet<ISymbol> addedSymbols,
EditAndContinue\SemanticEditInfo.cs (2)
22/// We use <see cref="SymbolKey"/> to represent the symbol rather then <see cref="ISymbol"/>, 31/// We use <see cref="SymbolKey"/> to represent the symbol rather then <see cref="ISymbol"/>,
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (3)
129var method = symbolInfo.Symbol; 133foreach (var candidate in symbolInfo.CandidateSymbols) 176private bool TryAnalyzeInvocation(ISymbol? symbol, string? argName, int? argIndex)
EmbeddedLanguages\EmbeddedLanguageDetector.cs (9)
167var formatMethod = iformattable 174var impl = type.FindImplementationForInterfaceMember(formatMethod); 232var symbol = 242var symbol = semanticModel.GetDeclaredSymbol(property, cancellationToken); 272var fieldOrProperty = Info.SemanticFacts.FindFieldOrPropertyForAttributeArgument(semanticModel, argument, cancellationToken); 287var fieldOrProperty = Info.SemanticFacts.FindFieldOrPropertyForArgument(semanticModel, argument, cancellationToken); 301var symbol = semanticModel.GetSymbolInfo(left, cancellationToken).Symbol; 306ISymbol? symbol, [NotNullWhen(true)] out string? identifier) 314[NotNullWhen(true)] ISymbol? symbol,
EmbeddedLanguages\Json\LanguageServices\JsonLanguageDetector.cs (1)
151var symbol = semanticModel.GetSymbolInfo(invocationOrCreation, cancellationToken).GetAnySymbol();
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (5)
122var method = symbolInfo.Symbol; 126foreach (var candidate in symbolInfo.CandidateSymbols) 141var constructor = semanticModel.GetSymbolInfo(invocationOrCreation, cancellationToken).GetAnySymbol(); 152var constructor = semanticModel.GetSymbolInfo(invocationOrCreation, cancellationToken).GetAnySymbol(); 168ISymbol? method,
ExternalAccess\Pythia\Api\PythiaCompletionProviderBase.cs (1)
36IReadOnlyList<ISymbol> symbols,
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)
18where TSymbol : ISymbol
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (7)
111var symbol = model.GetDeclaredSymbol(declarationNode, CancellationToken); 121private async Task<bool> TryEnqueueFromTypeAsync(Document document, ISymbol symbol) 146private async Task<bool> TryEnqueueFromMemberAsync(Document document, ISymbol symbol) 171private Task EnqueueWorkItemAsync(Document document, ISymbol symbol) 191private static bool IsInternal(ISymbol symbol) 198private static bool IsType(ISymbol symbol) 201private static bool IsMember(ISymbol symbol)
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
144document, span, optionsService, selectedType, selectedClassNode, context.Options, selectedMembers: ImmutableArray<ISymbol>.Empty);
ExtractClass\ExtractClassOptions.cs (2)
37public ISymbol Member { get; } 45ISymbol member,
ExtractClass\ExtractClassWithDialogCodeAction.cs (4)
28private readonly ImmutableArray<ISymbol> _selectedMembers; 48ImmutableArray<ISymbol> selectedMembers) 156using var _1 = ArrayBuilder<(ISymbol member, bool makeAbstract)>.GetInstance(out var pullMembersBuilder); 197var currentSymbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
ExtractClass\IExtractClassOptionsService.cs (1)
14Task<ExtractClassOptions?> GetExtractClassOptionsAsync(Document document, INamedTypeSymbol originalType, ImmutableArray<ISymbol> selectedMembers, CancellationToken cancellationToken);
ExtractInterface\AbstractExtractInterfaceService.cs (11)
43IEnumerable<ISymbol> includedMembers, 44ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationAnnotationMap, 98var type = semanticModel.GetDeclaredSymbol(typeNode, cancellationToken); 266IEnumerable<ISymbol> extractableMembers, 329IEnumerable<ISymbol> includedMembers, 330ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationAnnotationMap, 380private static ImmutableArray<ISymbol> CreateInterfaceMembers(IEnumerable<ISymbol> includedMembers) 382using var _ = ArrayBuilder<ISymbol>.GetInstance(out var interfaceMembers); 384foreach (var member in includedMembers) 436internal virtual bool IsExtractableMember(ISymbol m)
ExtractInterface\ExtractInterfaceOptionsResult.cs (2)
24public ImmutableArray<ISymbol> IncludedMembers { get; } 30public ExtractInterfaceOptionsResult(bool isCancelled, ImmutableArray<ISymbol> includedMembers, string interfaceName, string fileName, ExtractLocation location, CleanCodeGenerationOptionsProvider fallbackOptions)
ExtractInterface\ExtractInterfaceTypeAnalysisResult.cs (2)
19public readonly IEnumerable<ISymbol> ExtractableMembers; 27IEnumerable<ISymbol> extractableMembers,
ExtractInterface\IExtractInterfaceOptionsService.cs (1)
23List<ISymbol> extractableMembers,
ExtractMethod\MethodExtractor.Analyzer.cs (40)
52protected abstract VariableInfo CreateFromSymbol(Compilation compilation, ISymbol symbol, ITypeSymbol type, VariableStyle variableStyle, bool variableDeclared); 235IDictionary<ISymbol, VariableInfo> variableInfoMap, 276SemanticModel model, Dictionary<ISymbol, List<SyntaxToken>> symbolMap, 277IList<VariableInfo> parameters, IList<ISymbol> failedVariables, 349private Dictionary<ISymbol, List<SyntaxToken>> GetSymbolMap(SemanticModel model) 357private static bool ContainsVariableUnsafeAddressTaken(DataFlowAnalysis dataFlowAnalysisData, IEnumerable<ISymbol> symbols) 360var map = new HashSet<ISymbol>(dataFlowAnalysisData.UnsafeAddressTaken); 412Dictionary<ISymbol, List<SyntaxToken>> symbolMap, 413out IDictionary<ISymbol, VariableInfo> variableInfoMap, 414out List<ISymbol> failedVariables) 419variableInfoMap = new Dictionary<ISymbol, VariableInfo>(); 420failedVariables = new List<ISymbol>(); 423var capturedMap = new HashSet<ISymbol>(dataFlowAnalysisData.Captured); 424var dataFlowInMap = new HashSet<ISymbol>(dataFlowAnalysisData.DataFlowsIn); 425var dataFlowOutMap = new HashSet<ISymbol>(dataFlowAnalysisData.DataFlowsOut); 426var alwaysAssignedMap = new HashSet<ISymbol>(dataFlowAnalysisData.AlwaysAssigned); 427var variableDeclaredMap = new HashSet<ISymbol>(dataFlowAnalysisData.VariablesDeclared); 428var readInsideMap = new HashSet<ISymbol>(dataFlowAnalysisData.ReadInside); 429var writtenInsideMap = new HashSet<ISymbol>(dataFlowAnalysisData.WrittenInside); 430var readOutsideMap = new HashSet<ISymbol>(dataFlowAnalysisData.ReadOutside); 431var writtenOutsideMap = new HashSet<ISymbol>(dataFlowAnalysisData.WrittenOutside); 432var unsafeAddressTakenMap = new HashSet<ISymbol>(dataFlowAnalysisData.UnsafeAddressTaken); 435var candidates = new HashSet<ISymbol>(readInsideMap); 439foreach (var symbol in candidates) 512private static void AddVariableToMap(IDictionary<ISymbol, VariableInfo> variableInfoMap, ISymbol localOrParameter, VariableInfo variableInfo) 517Dictionary<ISymbol, List<SyntaxToken>> symbolMap, 518ISymbol symbol, 580Dictionary<ISymbol, List<SyntaxToken>> symbolMap, SemanticModel model, ISymbol symbol, bool writtenInside) 640protected virtual ITypeSymbol GetSymbolType(SemanticModel model, ISymbol symbol) 674private static bool IsThisParameter(ISymbol localOrParameter) 684private static bool IsInteractiveSynthesizedParameter(ISymbol localOrParameter) 730IDictionary<ISymbol, VariableInfo> variableInfoMap, 733foreach (var symbol in variableInfoMap.Keys) 783private static void AppendMethodTypeParameterUsedDirectly(IDictionary<ISymbol, List<SyntaxToken>> symbolMap, IDictionary<int, ITypeParameterSymbol> sortedMap) 800IDictionary<ISymbol, VariableInfo> variableInfoMap, 801IDictionary<ISymbol, List<SyntaxToken>> symbolMap, 907private OperationStatus CheckReadOnlyFields(SemanticModel semanticModel, Dictionary<ISymbol, List<SyntaxToken>> symbolMap) 944ISymbol symbol,
ExtractMethod\MethodExtractor.Analyzer.SymbolMapBuilder.cs (3)
25private readonly Dictionary<ISymbol, List<SyntaxToken>> _symbolMap = new(); 28public static Dictionary<ISymbol, List<SyntaxToken>> Build( 70foreach (var sym in symbolInfo.GetAllSymbols())
ExtractMethod\MethodExtractor.TypeParameterCollector.cs (1)
27public override void DefaultVisit(ISymbol node)
FindUsages\AbstractFindUsagesService.ProgressAdapter.cs (1)
126public async ValueTask OnReferenceFoundAsync(SymbolGroup group, ISymbol definition, ReferenceLocation location, CancellationToken cancellationToken)
FindUsages\AbstractFindUsagesService_FindImplementations.cs (18)
41IFindUsagesContext context, ISymbol symbol, Project project, CancellationToken cancellationToken) 68ISymbol symbol, Project project, IFindUsagesContext context, CancellationToken cancellationToken) 84foreach (var implementation in implementations) 93private static async Task<ImmutableArray<ISymbol>> FindSourceImplementationsAsync( 94Solution solution, ISymbol symbol, CancellationToken cancellationToken) 96var builder = new HashSet<ISymbol>(SymbolEquivalenceComparer.Instance); 111foreach (var linkedSymbol in linkedSymbols) 115foreach (var implementation in implementations) 124static bool AddedAllLocations(ISymbol implementation, HashSet<(string filePath, TextSpan span)> seenLocations) 136private static async Task<ImmutableArray<ISymbol>> FindImplementationsWorkerAsync( 137Solution solution, ISymbol symbol, CancellationToken cancellationToken) 140var result = new HashSet<ISymbol>(implementations.Select(s => s.OriginalDefinition)); 146foreach (var ov in overrides) 148for (var overridden = ov.GetOverriddenMember(); overridden != null; overridden = overridden.GetOverriddenMember()) 158private static async Task<ImmutableArray<ISymbol>> FindSourceAndMetadataImplementationsAsync( 159Solution solution, ISymbol symbol, CancellationToken cancellationToken) 169var implementationsAndOverrides = new HashSet<ISymbol>(); 171foreach (var implementation in implementations)
FindUsages\AbstractFindUsagesService_FindReferences.cs (4)
112IFindUsagesContext context, ISymbol symbol, Project project, CancellationToken cancellationToken) 130ISymbol symbol, 161ISymbol symbol, 204var symbol = semanticModel.GetSymbolInfo(token.Parent, cancellationToken).Symbol ?? semanticModel.GetDeclaredSymbol(token.Parent, cancellationToken);
FindUsages\DefinitionItem.cs (2)
241ISymbol symbol, 307internal static ImmutableArray<TaggedText> GetOriginationParts(ISymbol symbol)
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (2)
63private async ValueTask<(Project? project, ISymbol? symbol)> TryResolveSymbolAsync(Solution solution, string symbolKey, CancellationToken cancellationToken) 76var symbol = SymbolKey.ResolveString(symbolKey, compilation, cancellationToken: cancellationToken).Symbol;
FindUsages\FindUsagesHelpers.cs (5)
18public static string GetDisplayName(ISymbol symbol) 31public static async Task<(ISymbol symbol, Project project)?> GetRelevantSymbolAndProjectAtPositionAsync( 36var symbol = await SymbolFinder.FindSymbolAtPositionAsync(document, position, cancellationToken: cancellationToken).ConfigureAwait(false); 52private static SymbolDisplayFormat GetFormat(ISymbol definition) 81public static ImmutableArray<TaggedText> GetDisplayParts(ISymbol definition)
FindUsages\IDefinitionsAndReferencesFactory.cs (8)
59this ISymbol definition, 65this ISymbol definition, 72ISymbol definition, 81this ISymbol definition, 99var definition = group.Symbols.First(); 109ISymbol definition, 161private static ImmutableArray<DocumentSpan> TryGetSourceLocations(ISymbol definition, Solution solution, ImmutableArray<Location> locations, bool includeHiddenLocations) 209private static ImmutableDictionary<string, string> GetProperties(ISymbol definition, bool isPrimary)
Fixer.cs (1)
50using var _ = ArrayBuilder<ISymbol>.GetInstance(out var candidateSymbols);
FullyQualify\AbstractFullyQualifyService.cs (7)
80var matchingAttributeTypes = inAttributeContext ? await FindAsync(name + nameof(Attribute), ignoreCase, SymbolFilter.Type).ConfigureAwait(false) : ImmutableArray<ISymbol>.Empty; 81var matchingNamespaces = inAttributeContext ? ImmutableArray<ISymbol>.Empty : await FindAsync(name, ignoreCase, SymbolFilter.Namespace).ConfigureAwait(false); 112async Task<ImmutableArray<ISymbol>> FindAsync(string name, bool ignoreCase, SymbolFilter filter) 122ImmutableArray<ISymbol> matchingTypes) 154ImmutableArray<ISymbol> symbols) 204var member = container.GetMembers(name).FirstOrDefault(); 265private static bool HasValidContainer(ISymbol symbol)
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (2)
124foreach (var member in comparableType.GetMembers(nameof(IComparable<int>.CompareTo))) 245foreach (var member in containingType.GetMembers(GetOperatorName(kind)))
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.FieldDelegatingCodeAction.cs (1)
48var parameterToExistingFieldMap = ImmutableDictionary.CreateBuilder<string, ISymbol>();
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.GenerateConstructorWithDialogCodeAction.cs (2)
33internal ImmutableArray<ISymbol> ViableMembers { get; } 44ImmutableArray<ISymbol> viableMembers,
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.State.cs (5)
28public ImmutableArray<ISymbol> SelectedMembers { get; private set; } 40ImmutableArray<ISymbol> selectedMembers, 57ImmutableArray<ISymbol> selectedMembers, 85private static ISymbol? TryMapToWritableInstanceFieldOrProperty( 87ISymbol symbol,
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (5)
41Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, 54ImmutableArray<ISymbol> members, INamedTypeSymbol constructedEquatableType, CancellationToken cancellationToken) 121ImmutableArray<ISymbol> members, CancellationToken cancellationToken) 131INamedTypeSymbol namedType, ImmutableArray<ISymbol> members) 151INamedTypeSymbol namedType, ImmutableArray<ISymbol> members)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (2)
37private readonly ImmutableArray<ISymbol> _selectedMembers; 44ImmutableArray<ISymbol> selectedMembers,
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (5)
106.SelectAccessibleMembers<ISymbol>(containingType) 202Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> selectedMembers, 242Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members, 252Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members, 291Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members,
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndHashWithDialogCodeAction.cs (2)
29private readonly ImmutableArray<ISymbol> _viableMembers; 38ImmutableArray<ISymbol> viableMembers,
GenerateEqualsAndGetHashCodeFromMembers\IGenerateEqualsAndGetHashCodeService.cs (3)
29Task<IMethodSymbol> GenerateEqualsMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, string? localNameOpt, CancellationToken cancellationToken); 41Task<IMethodSymbol> GenerateIEquatableEqualsMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, INamedTypeSymbol constructedEquatableType, CancellationToken cancellationToken); 50Task<IMethodSymbol> GenerateGetHashCodeMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, CancellationToken cancellationToken);
GenerateEqualsAndGetHashCodeFromMembers\IGenerateEqualsAndGetHashCodeServiceExtensions.cs (1)
15ImmutableArray<ISymbol> members, CancellationToken cancellationToken)
GenerateFromMembers\AbstractGenerateFromMembersCodeRefactoringProvider.cs (6)
54protected static bool IsReadableInstanceFieldOrProperty(ISymbol symbol) 57protected static bool IsWritableInstanceFieldOrProperty(ISymbol symbol) 60private static bool IsReadableFieldOrProperty(ISymbol symbol) 68private static bool IsWritableFieldOrProperty(ISymbol symbol) 91ImmutableArray<ISymbol> selectedMembers, ImmutableArray<NamingRule> rules) 95foreach (var symbol in selectedMembers)
GenerateFromMembers\AbstractGenerateFromMembersCodeRefactoringProvider.SelectedMemberInfo.cs (2)
16public readonly ImmutableArray<ISymbol> SelectedMembers; 21ImmutableArray<ISymbol> selectedMembers)
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
123protected static bool IsSymbolAccessible(ISymbol? symbol, SemanticDocument document)
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.State.cs (8)
53private ImmutableDictionary<string, ISymbol>? _parameterToExistingMemberMap; 397var definition = await SymbolFinder.FindSourceDefinitionAsync(original, _document.Project.Solution, cancellationToken).ConfigureAwait(false); 409var parameterToExistingMemberMap = ImmutableDictionary.CreateBuilder<string, ISymbol>(); 445ImmutableDictionary<string, ISymbol>.Builder parameterToExistingMemberMap, 470var symbol = membersArray.FirstOrDefault(m => m.Name.Equals(expectedFieldName, StringComparison.Ordinal)) ?? membersArray.FirstOrDefault(); 533ISymbol symbol) 612private async Task<(ImmutableArray<ISymbol>, ImmutableArray<SyntaxNode>)> GenerateMembersAndAssignmentsAsync( 621ImmutableArray<ISymbol>.Empty;
GenerateMember\GenerateConstructor\GenerateConstructorHelpers.cs (1)
42private static bool IsSymbolAccessible(Compilation compilation, ISymbol symbol)
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
30protected abstract bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel);
GenerateMember\GenerateVariable\AbstractGenerateVariableService.State.cs (6)
351var previousAssignedSymbol = TryGetAssignedSymbol(symbolKind, children, statementindex - 1, cancellationToken); 352var nextAssignedSymbol = TryGetAssignedSymbol(symbolKind, children, statementindex + 1, cancellationToken); 367private ISymbol TryGetAssignedSymbol( 384var symbol = _document.SemanticModel.GetSymbolInfo(left, cancellationToken).Symbol; 399var symbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 413private static bool FieldIsReadOnly(ISymbol symbol)
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (4)
27private readonly ImmutableArray<ISymbol> _viableMembers; 36ImmutableArray<ISymbol> viableMembers, 100private Task<ISymbol> GenerateOverrideAsync( 101SyntaxGenerator generator, ISymbol symbol,
GenerateType\AbstractGenerateTypeService.Editor.cs (4)
597ImmutableDictionary<string, ISymbol>.Builder parameterToFieldMap, 613var symbol = membersArray.FirstOrDefault(m => m.Name.Equals(expectedFieldName, StringComparison.Ordinal)) ?? membersArray.FirstOrDefault(); 629ISymbol symbol) 652private bool IsSymbolAccessible(ISymbol symbol)
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (7)
104private async Task<ImmutableArray<ISymbol>> DetermineMembersAsync(GenerateTypeOptionsResult options = null) 106using var _ = ArrayBuilder<ISymbol>.GetInstance(out var members); 115private async Task AddMembersAsync(ArrayBuilder<ISymbol> members, GenerateTypeOptionsResult options = null) 173private void AddProperties(ArrayBuilder<ISymbol> members) 186IList<TArgumentSyntax> argumentList, ArrayBuilder<ISymbol> members, GenerateTypeOptionsResult options = null) 195var parameterToExistingFieldMap = ImmutableDictionary.CreateBuilder<string, ISymbol>(); 233private void AddExceptionConstructors(ArrayBuilder<ISymbol> members)
GenerateType\AbstractGenerateTypeService.State.cs (2)
300var symbol = await SymbolFinder.FindSourceDefinitionAsync(TypeToGenerateInOpt, document.Project.Solution, cancellationToken).ConfigureAwait(false); 388var symbol = leftSideInfo.Symbol;
GoToBase\AbstractGoToBaseService.cs (3)
51bases = ImmutableArray.Create<ISymbol>(nextConstructor); 64foreach (var baseSymbol in bases) 66var sourceDefinition = await SymbolFinder.FindSourceDefinitionAsync(
GoToBase\FindBaseHelpers.cs (4)
17public static ValueTask<ImmutableArray<ISymbol>> FindBasesAsync( 18ISymbol symbol, Solution solution, CancellationToken cancellationToken) 25var result = BaseTypeFinder.FindBaseTypesAndInterfaces(namedTypeSymbol).CastArray<ISymbol>(); 36return ValueTaskFactory.FromResult(ImmutableArray<ISymbol>.Empty);
GoToDefinition\AbstractGoToDefinitionSymbolService.cs (5)
19protected abstract ISymbol FindRelatedExplicitlyDeclaredSymbol(ISymbol symbol, Compilation compilation); 23public async Task<(ISymbol?, Project, TextSpan)> GetSymbolProjectAndBoundSpanAsync(Document document, int position, bool includeType, CancellationToken cancellationToken) 30var symbol = GetSymbol(semanticInfo, includeType); 72private static ISymbol? GetSymbol(TokenSemanticInfo semanticInfo, bool includeType)
GoToDefinition\IGoToDefinitionSymbolService.cs (1)
14Task<(ISymbol?, Project, TextSpan)> GetSymbolProjectAndBoundSpanAsync(Document document, int position, bool includeType, CancellationToken cancellationToken);
HashCodeAnalyzer.cs (4)
58public (bool accessesBase, ImmutableArray<ISymbol> members, ImmutableArray<IOperation> statements) GetHashedMembers(ISymbol? owningSymbol, IOperation? operation) 89private (bool accessesBase, ImmutableArray<ISymbol> members)? MatchTuplePattern( 112private (bool accessesBase, ImmutableArray<ISymbol> members)? MatchAccumulatorPattern(
HashCodeAnalyzer.OperationDeconstructor.cs (6)
27private readonly ArrayBuilder<ISymbol> _hashedSymbols; 36_hashedSymbols = ArrayBuilder<ISymbol>.GetInstance(); 43public readonly (bool accessesBase, ImmutableArray<ISymbol> hashedSymbol) GetResult() 153if (TryGetFieldOrProperty(value, out var fieldOrProp) && 177private static bool TryGetFieldOrProperty(IOperation operation, [NotNullWhen(true)] out ISymbol? symbol) 197private readonly bool TryAddSymbol(ISymbol member)
ImplementAbstractClass\ImplementAbstractClassData.cs (20)
30private readonly ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> _unimplementedMembers; 38ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers) 90ISymbol? throughMember, bool? canDelegateAllMembers, CancellationToken cancellationToken) 127private ImmutableArray<ISymbol> GenerateMembers( 128Compilation compilation, ISymbol? throughMember, 139private ISymbol? GenerateMember( 140Compilation compilation, ISymbol member, ISymbol? throughMember, 153private ISymbol? GenerateMember( 154Compilation compilation, ISymbol member, ISymbol? throughMember, bool addUnsafe, 177private ISymbol GenerateMethod( 178Compilation compilation, IMethodSymbol method, ISymbol? throughMember, 199ISymbol? throughMember, 240IEventSymbol @event, ISymbol? throughMember, Accessibility accessibility, DeclarationModifiers modifiers) 250IEventSymbol @event, IMethodSymbol? accessor, ISymbol? throughMember, 271public IEnumerable<(ISymbol symbol, bool canDelegateAllMembers)> GetDelegatableMembers() 277.OfType<ISymbol>(); 283.OfType<ISymbol>(); 288foreach (var fieldOrProp in fields.Concat(properties))
ImplementInterface\AbstractImplementInterfaceService.AccessibilityHelper.cs (1)
13public static bool IsLessAccessibleThan(ISymbol? first, INamedTypeSymbol second)
ImplementInterface\AbstractImplementInterfaceService.CodeAction.cs (34)
31protected readonly ISymbol? ThroughMember; 46ISymbol? throughMember) 91ISymbol throughMember) 140ISymbol? throughMember, 176ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers, 183ImmutableArray<ISymbol>.Empty, cancellationToken); 188ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers, 191ImmutableArray<ISymbol> extraMembers, 221private ImmutableArray<ISymbol> GenerateMembers( 224ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers, 241using var _1 = ArrayBuilder<ISymbol>.GetInstance(out var implementedVisibleMembers); 242using var _2 = ArrayBuilder<ISymbol>.GetInstance(out var implementedMembers); 246foreach (var unimplementedInterfaceMember in unimplementedInterfaceMembers) 252foreach (var member in members) 275private string DetermineMemberName(ISymbol member, ArrayBuilder<ISymbol> implementedVisibleMembers) 279var memberNames = State.ClassOrStructType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(State.ClassOrStructType).Select(m => m.Name); 291private IEnumerable<ISymbol?> GenerateMembers( 294ISymbol member, 295ArrayBuilder<ISymbol> implementedVisibleMembers, 310return SpecializedCollections.EmptyEnumerable<ISymbol?>(); 337private bool ShouldGenerateInvisibleMember(ParseOptions options, ISymbol member, string memberName) 365private bool HasUnexpressibleConstraint(ParseOptions options, ISymbol member) 392private IEnumerable<ISymbol?> GenerateMembers( 394ISymbol member, 416foreach (var generated in GeneratePropertyMembers(compilation, property, accessibility, modifiers, generateAbstractly, useExplicitInterfaceSymbol, memberName, propertyGenerationBehavior)) 425private ISymbol GenerateEvent(Compilation compilation, string memberName, bool generateInvisibly, SyntaxGenerator factory, DeclarationModifiers modifiers, bool useExplicitInterfaceSymbol, Accessibility accessibility, IEventSymbol @event) 463ISymbol member, 477private static bool HasNameConflict(ISymbol member, ISymbol baseMember) 500private bool HasMatchingMember(ArrayBuilder<ISymbol> implementedVisibleMembers, ISymbol member) 525private bool MembersMatch(ISymbol member1, ISymbol member2)
ImplementInterface\AbstractImplementInterfaceService.CodeAction_Conflicts.cs (5)
20private bool HasConflictingMember(ISymbol member, ArrayBuilder<ISymbol> implementedVisibleMembers) 26var allMembers = State.ClassOrStructType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(State.ClassOrStructType).Concat(implementedVisibleMembers); 34private bool HasConflict(ISymbol member1, ISymbol member2)
ImplementInterface\AbstractImplementInterfaceService.CodeAction_Method.cs (1)
17private ISymbol GenerateMethod(
ImplementInterface\AbstractImplementInterfaceService.CodeAction_Property.cs (1)
22private IEnumerable<ISymbol?> GeneratePropertyMembers(
ImplementInterface\AbstractImplementInterfaceService.cs (5)
83foreach (var member in members) 107foreach (var member in delegatableMembers) 159private static IList<ISymbol> GetDelegatableMembers(State state) 166.OfType<ISymbol>(); 174.OfType<ISymbol>();
ImplementInterface\AbstractImplementInterfaceService.DisposePatternCodeAction.cs (6)
46foreach (var member in idisposableMembers) 98ISymbol? throughMember) : base(service, document, options, state, explicitly, abstractly, onlyRemaining: !explicitly, throughMember) 127ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> unimplementedMembers, 146extraMembers: ImmutableArray.Create<ISymbol>(disposedValueField), 202private (ImmutableArray<ISymbol>, SyntaxNode) CreateDisposableMethods( 220return (ImmutableArray.Create<ISymbol>(disposeImplMethod, disposeInterfaceMethod), finalizer);
ImplementInterface\AbstractImplementInterfaceService.State.cs (6)
26public ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> MembersWithoutExplicitOrImplicitImplementationWhichCanBeImplicitlyImplemented { get; private set; } 27= ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)>.Empty; 28public ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> MembersWithoutExplicitOrImplicitImplementation { get; private set; } 29= ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)>.Empty; 32public ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> MembersWithoutExplicitImplementation { get; private set; } 33= ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)>.Empty;
InheritanceMargin\AbstractInheritanceMarginService.cs (2)
24using SymbolAndLineNumberArray = ImmutableArray<(ISymbol symbol, int lineNumber)>; 81private static bool CanHaveInheritanceTarget(ISymbol symbol)
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (37)
27using SymbolAndLineNumberArray = ImmutableArray<(ISymbol symbol, int lineNumber)>; 91using var _ = ArrayBuilder<(ISymbol symbol, int lineNumber)>.GetInstance(out var builder); 97var member = semanticModel.GetDeclaredSymbol(memberDeclarationNode, cancellationToken); 309baseSymbols: baseSymbols.CastArray<ISymbol>(), 310derivedTypesSymbols: derivedSymbols.CastArray<ISymbol>(), 321baseSymbols: baseSymbols.CastArray<ISymbol>(), 322derivedTypesSymbols: derivedSymbols.CastArray<ISymbol>(), 331ISymbol memberSymbol, 390ImmutableArray<ISymbol> baseSymbols, 391ImmutableArray<ISymbol> derivedTypesSymbols, 426ISymbol memberSymbol, 428ImmutableArray<ISymbol> implementingMembers, 453ImmutableArray<ISymbol> baseSymbols, 454ImmutableArray<ISymbol> derivedTypesSymbols, 490ISymbol memberSymbol, 492ImmutableArray<ISymbol> implementedMembers, 493ImmutableArray<ISymbol> overridingMembers, 494ImmutableArray<ISymbol> overriddenMembers, 538ISymbol targetSymbol, 542var symbolInSource = await SymbolFinder.FindSourceDefinitionAsync(targetSymbol, solution, cancellationToken).ConfigureAwait(false); 574private static ImmutableArray<ISymbol> GetImplementedSymbolsForTypeMember( 575ISymbol memberSymbol, 576ImmutableArray<ISymbol> overriddenSymbols) 580using var _ = ArrayBuilder<ISymbol>.GetInstance(out var builder); 592foreach (var symbol in overriddenSymbols) 600return ImmutableArray<ISymbol>.Empty; 606private static async Task<ImmutableArray<ISymbol>> GetImplementingSymbolsForTypeMemberAsync( 608ISymbol memberSymbol, 614using var _ = ArrayBuilder<ISymbol>.GetInstance(out var builder); 627foreach (var implementationSymbol in implementationSymbols) 635return ImmutableArray<ISymbol>.Empty; 641private static ImmutableArray<ISymbol> GetOverriddenSymbols(ISymbol memberSymbol) 645return ImmutableArray<ISymbol>.Empty; 649using var _ = ArrayBuilder<ISymbol>.GetInstance(out var builder); 650for (var overriddenMember = memberSymbol.GetOverriddenMember(); 700private static DefinitionItem? ToSlimDefinitionItem(ISymbol symbol, Solution solution)
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (17)
49protected abstract bool TryUpdateTupleAssignment(IBlockOperation? blockStatement, IParameterSymbol parameter, ISymbol fieldOrProperty, SyntaxEditor editor); 127var siblingFieldOrProperty = TryFindSiblingFieldOrProperty(parameter, blockStatement); 176var fields = parameters.SelectAsArray(p => (ISymbol)CreateField(p, accessibilityModifiersRequired, rules)); 177var properties = parameters.SelectAsArray(p => (ISymbol)CreateProperty(p, accessibilityModifiersRequired, rules)); 248ISymbol fieldOrProperty, 268private static ISymbol? TryFindSiblingFieldOrProperty( 273TryFindFieldOrPropertyAssignmentStatement(siblingParam, blockStatement, out var sibling); 382ImmutableArray<ISymbol> fieldsOrProperties, 404var fieldOrProperty = fieldsOrProperties[i]; 448ISymbol fieldOrProperty, 536ISymbol fieldOrProperty, 565where TSymbol : ISymbol 570sibling, blockStatement, out var fieldOrProperty); 675IParameterSymbol parameter, IBlockOperation? blockStatement, out ISymbol? fieldOrProperty) 732private async Task<(ISymbol?, bool isThrowNotImplementedProperty)> TryFindMatchingUninitializedFieldOrPropertySymbolAsync( 750foreach (var memberWithName in containingType.GetMembers(memberName)) 787static bool ContainsMemberAssignment(IBlockOperation? blockStatement, ISymbol member)
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (2)
213[NotNullWhen(true)] out ISymbol? fieldOrProperty) 232[NotNullWhen(true)] out ISymbol? fieldOrProperty)
InlineHints\InlineHintHelpers.cs (1)
26var symbol = symbolKey.Resolve(semanticModel.Compilation, cancellationToken: cancellationToken).Symbol;
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (6)
210var callerSymbol = GetCallerSymbol(calleeInvocationNode, semanticModel, cancellationToken); 250ISymbol callerSymbol, 293ISymbol callerSymbol, 367ISymbol callerSymbol, 565private ISymbol? GetCallerSymbol( 572var declaredSymbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (13)
258ImmutableDictionary<ISymbol, string> renameTable) 284ImmutableDictionary<ISymbol, string> renameTable, 296ImmutableDictionary<ISymbol, SyntaxNode> replacementTable, 329private ImmutableDictionary<ISymbol, SyntaxNode> ComputeReplacementTable( 334ImmutableDictionary<ISymbol, string> renameTable) 338(parameter, argument) => (parameter: (ISymbol)parameter, 341.Select(parameterAndExpressionPair => (parameter: (ISymbol)parameterAndExpressionPair.Key, 345.Select(parameterAndName => (parameter: (ISymbol)parameterAndName.parameter, 358private static ImmutableDictionary<ISymbol, string> ComputeRenameTable( 367var renameTable = new Dictionary<ISymbol, string>(); 370foreach (var symbol in parametersNeedGenerateFreshVariableFor.Concat(localSymbolsInCallee)) 389private readonly HashSet<ISymbol> _allSymbols = new(); 396public static ImmutableHashSet<ISymbol> GetAllSymbols(
InlineTemporary\AbstractInlineTemporaryCodeRefactoringProvider.cs (1)
28var local = semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken);
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (3)
71var containingSymbol = semanticModel.GetDeclaredSymbol(containingMethod, cancellationToken); 75var expressionSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol; 196var symbol = semanticModel.GetSymbolInfo(variable, cancellationToken).Symbol;
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
87var symbol = semanticModel.GetSymbolInfo(variable, cancellationToken).Symbol;
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (10)
280using var _0 = ArrayBuilder<ISymbol>.GetInstance(out var localVariables); 283using var _1 = PooledDictionary<ISymbol, int>.GetInstance(out var variableDeclarationIndex); 284using var _2 = PooledDictionary<ISymbol, int>.GetInstance(out var lastVariableUsageIndex); 294using var _ = PooledHashSet<ISymbol>.GetInstance(out var referencedVariables); 298foreach (var referencedVariable in referencedVariables) 305foreach (var declaredVariable in declaredVariables) 322foreach (var localSymbol in localVariables) 346HashSet<ISymbol> referencedVariables, 348IReadOnlyList<ISymbol> localVariables, 358var variable = localVariables.FirstOrDefault(localVariable
LanguageServiceIndexFormat\SymbolMoniker.cs (3)
21public static bool HasMoniker(ISymbol symbol) 50public static SymbolMoniker Create(ISymbol symbol) 77static string GetRequiredDocumentationCommentId(ISymbol symbol)
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (3)
65ISymbol orderSymbol, 150ISymbol symbol) 228private static SymbolDisplayPart Part(SymbolDisplayPartKind kind, ISymbol? symbol, string text)
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
21public override void DefaultVisit(ISymbol node)
LanguageServices\AnonymousTypeDisplayService\IStructuralTypeDisplayService.cs (1)
13ISymbol orderSymbol,
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (21)
89private readonly Func<ISymbol, string> _getNavigationHint; 117protected abstract Task<ImmutableArray<SymbolDisplayPart>> GetInitializerSourcePartsAsync(ISymbol symbol); 118protected abstract ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat format); 119protected abstract string GetNavigationHint(ISymbol symbol); 157private async Task AddPartsAsync(ImmutableArray<ISymbol> symbols) 159var firstSymbol = symbols[0]; 170private void AddDocumentationContent(ISymbol symbol) 187var original = symbol.OriginalDefinition; 210void AddReturnsDocumentationParts(ISymbol symbol, IDocumentationCommentFormattingService formatter) 227void AddValueDocumentationParts(ISymbol symbol, IDocumentationCommentFormattingService formatter) 244private void AddExceptions(ISymbol symbol) 268protected abstract void AddCaptures(ISymbol symbol); 297foreach (var captured in captures) 318ImmutableArray<ISymbol> symbolGroup, SymbolDescriptionGroups groups) 327public async Task<IDictionary<SymbolDescriptionGroups, ImmutableArray<TaggedText>>> BuildDescriptionSectionsAsync(ImmutableArray<ISymbol> symbolGroup) 336private async Task AddDescriptionPartAsync(ISymbol symbol) 723private void AddDescriptionForArbitrarySymbol(ISymbol symbol) 741ImmutableArray<ISymbol> symbolGroup) 758private static int GetOverloadCount(ImmutableArray<ISymbol> symbolGroup) 840protected ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(ISymbol symbol, SymbolDisplayFormat format = null) 846private static IEnumerable<SymbolDisplayPart> Part(SymbolDisplayPartKind kind, ISymbol symbol, string text)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AnonymousTypes.cs (1)
15private void FixAllStructuralTypes(ISymbol firstSymbol)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.cs (4)
31public Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ISymbol symbol, SymbolDescriptionOptions options, SymbolDescriptionGroups groups, CancellationToken cancellationToken) 34public async Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups, CancellationToken cancellationToken) 40public async Task<ImmutableArray<SymbolDisplayPart>> ToDescriptionPartsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups, CancellationToken cancellationToken) 52SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken)
LanguageServices\SymbolDisplayService\ISymbolDisplayService.cs (4)
18Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ISymbol symbol, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default); 19Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default); 20Task<ImmutableArray<SymbolDisplayPart>> ToDescriptionPartsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default); 21Task<IDictionary<SymbolDescriptionGroups, ImmutableArray<TaggedText>>> ToDescriptionGroupsAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken = default);
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedNamespaceOrTypeSymbol.cs (2)
24public abstract ImmutableArray<ISymbol> GetMembers(); 25public abstract ImmutableArray<ISymbol> GetMembers(string name);
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (6)
18private readonly ISymbol _symbol; 22protected AbstractWrappedSymbol(ISymbol symbol, bool canImplementImplicitly, IDocumentationCommentFormattingService docCommentFormattingService) 37public ISymbol ContainingSymbol => _symbol.ContainingSymbol; 73public ISymbol OriginalDefinition => _symbol.OriginalDefinition; 107public bool Equals(ISymbol other) 110public bool Equals(ISymbol other, SymbolEqualityComparer equalityComparer)
MetadataAsSource\AbstractMetadataAsSourceService.cs (3)
30ISymbol symbol, 102protected abstract Task<Document> AddAssemblyInfoRegionAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken); 108private static INamespaceOrTypeSymbol CreateCodeGenerationSymbol(Document document, ISymbol symbol)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedFieldSymbol.cs (1)
28public ISymbol AssociatedSymbol => _symbol.AssociatedSymbol;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
27public ISymbol AssociatedSymbol => _symbol.AssociatedSymbol;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (8)
21private readonly ImmutableArray<ISymbol> _members; 44private static ISymbol WrapMember(ISymbol m, bool canImplementImplicitly, IDocumentationCommentFormattingService docCommentFormattingService) 70public ISymbol AssociatedSymbol => _symbol.AssociatedSymbol; 100public ISymbol FindImplementationForInterfaceMember(ISymbol interfaceMember) 103public override ImmutableArray<ISymbol> GetMembers() 108public override ImmutableArray<ISymbol> GetMembers(string name)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedPropertySymbol.cs (2)
66ISymbol ISymbol.OriginalDefinition => _symbol.OriginalDefinition;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (1)
65ISymbol symbol,
MetadataAsSource\IMetadataAsSourceFileProvider.cs (1)
19MetadataAsSourceWorkspace metadataWorkspace, Workspace sourceWorkspace, Project sourceProject, ISymbol symbol, bool signaturesOnly, MetadataAsSourceOptions options, string tempPath, TelemetryMessage? telemetryMessage, CancellationToken cancellationToken);
MetadataAsSource\IMetadataAsSourceFileService.cs (2)
25Task<MetadataAsSourceFile> GetGeneratedFileAsync(Workspace sourceWorkspace, Project sourceProject, ISymbol symbol, bool signaturesOnly, MetadataAsSourceOptions options, CancellationToken cancellationToken = default); 33bool IsNavigableMetadataSymbol(ISymbol symbol);
MetadataAsSource\IMetadataAsSourceService.cs (1)
28Task<Document> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CleanCodeGenerationOptions options, CancellationToken cancellationToken);
MetadataAsSource\MetadataAsSourceFileService.cs (2)
78ISymbol symbol, 312public bool IsNavigableMetadataSymbol(ISymbol symbol)
MetadataAsSource\MetadataAsSourceHelpers.cs (3)
50public static INamedTypeSymbol GetTopLevelContainingNamedType(ISymbol symbol) 53var topLevelNamedType = symbol; 83foreach (var symbol in resolution)
MetadataAsSource\SymbolMappingServiceFactory.cs (1)
45public Task<SymbolMappingResult?> MapSymbolAsync(Document document, ISymbol symbol, CancellationToken cancellationToken)
MoveStaticMembers\IMoveStaticMembersOptionsService.cs (1)
12MoveStaticMembersOptions GetMoveMembersToTypeOptions(Document document, INamedTypeSymbol selectedType, ImmutableArray<ISymbol> selectedNodeSymbols);
MoveStaticMembers\MoveStaticMembersOptions.cs (4)
28public ImmutableArray<ISymbol> SelectedMembers { get; } 33ImmutableArray<ISymbol>.Empty, 38ImmutableArray<ISymbol> selectedMembers, 56ImmutableArray<ISymbol> selectedMembers,
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (4)
28private readonly ImmutableArray<ISymbol> _selectedMembers; 40ImmutableArray<ISymbol> selectedMembers) 169ImmutableArray<ISymbol> selectedMembers, 340ImmutableArray<ISymbol> members,
MoveToNamespace\AbstractMoveToNamespaceService.cs (2)
188private static async Task<ImmutableArray<ISymbol>> GetMemberSymbolsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken) 299private static string GetNewSymbolName(ISymbol symbol, string targetNamespace)
MoveToNamespace\MoveToNamespaceResult.cs (2)
19public ImmutableDictionary<string, ISymbol> NewNameOriginalSymbolMapping { get; } 26ImmutableDictionary<string, ISymbol> newNameOriginalSymbolMapping)
NamingStyleCodeFixProvider.cs (4)
77var symbol = model.GetDeclaredSymbol(node, context.CancellationToken); 107Document document, ISymbol symbol, string fixedName, CancellationToken cancellationToken) 118private readonly ISymbol _symbol; 136ISymbol symbol,
NamingStyleDiagnosticAnalyzerBase.cs (3)
47protected abstract bool ShouldIgnore(ISymbol symbol); 80var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(syntaxContext.Node, syntaxContext.CancellationToken); 106ISymbol symbol,
Navigation\DefaultSymbolNavigationService.cs (2)
15public Task<INavigableLocation?> GetNavigableLocationAsync(ISymbol symbol, Project project, CancellationToken cancellationToken) 18public Task<bool> TrySymbolNavigationNotifyAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Navigation\ISymbolNavigationService.cs (2)
22Task<INavigableLocation?> GetNavigableLocationAsync(ISymbol symbol, Project project, CancellationToken cancellationToken); 26Task<bool> TrySymbolNavigationNotifyAsync(ISymbol symbol, Project project, CancellationToken cancellationToken);
Navigation\NavigableItemFactory.cs (4)
20Solution solution, ISymbol symbol, Location location, 29ISymbol symbol, 39Solution solution, ISymbol symbol, CancellationToken cancellationToken) 56private static IEnumerable<Location> GetPreferredSourceLocations(ISymbol symbol)
Navigation\NavigableItemFactory.SymbolLocationNavigableItem.cs (2)
18private readonly ISymbol _symbol; 23ISymbol symbol,
NavigationBar\AbstractNavigationBarItemService.cs (3)
44Solution solution, ISymbol symbol, SyntaxTree tree, Func<SyntaxReference, TextSpan> computeFullSpan) 50Solution solution, ISymbol symbol, SyntaxTree tree, 91Solution solution, ISymbol symbol, SyntaxTree tree, ISymbolDeclarationService symbolDeclarationService)
PdbSourceDocument\IImplementationAssemblyLookupService.cs (1)
26string? FollowTypeForwards(ISymbol symbol, string dllPath, IPdbSourceDocumentLogger? logger);
PdbSourceDocument\ImplementationAssemblyLookupService.cs (1)
55public string? FollowTypeForwards(ISymbol symbol, string dllPath, IPdbSourceDocumentLogger? logger)
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (3)
78ISymbol symbol, 116var symbolToFind = symbol is IParameterSymbol parameterSymbol ? parameterSymbol.ContainingSymbol : symbol; 156var newSymbol = resolution.Symbol;
PickMembers\IPickMembersService.cs (1)
15string title, ImmutableArray<ISymbol> members,
PickMembers\PickMembersResult.cs (2)
14public readonly ImmutableArray<ISymbol> Members; 26ImmutableArray<ISymbol> members,
PopulateSwitchExpressionHelpers.cs (6)
17public static ICollection<ISymbol> GetMissingEnumMembers(ISwitchExpressionOperation operation) 30var enumMembers = new Dictionary<long, ISymbol>(); 38return SpecializedCollections.EmptyCollection<ISymbol>(); 53ISwitchExpressionOperation operation, Dictionary<long, ISymbol> enumMembers) 65private static void HandleBinaryPattern(IBinaryPatternOperation? binaryPattern, Dictionary<long, ISymbol> enumMembers) 77private static void RemoveIfConstantPatternHasValue(IOperation operation, Dictionary<long, ISymbol> enumMembers)
PopulateSwitchStatementHelpers.cs (6)
44public static ICollection<ISymbol> GetMissingEnumMembers(ISwitchOperation switchStatement) 49var enumMembers = new Dictionary<long, ISymbol>(); 62return SpecializedCollections.EmptyCollection<ISymbol>(); 86private static bool TryRemoveExistingEnumMembers(ISwitchOperation switchStatement, Dictionary<long, ISymbol> enumValues) 134Dictionary<long, ISymbol> enumValues) 136foreach (var member in enumType.GetMembers())
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (1)
100ImmutableArray<ISymbol> selectedMembers,
PullMemberUp\Dialog\IPullMemberUpOptionsService.cs (1)
15PullMembersUpOptions GetPullMemberUpOptions(Document document, ImmutableArray<ISymbol> selectedNodeSymbols);
PullMemberUp\Dialog\PullMemberUpWithDialogCodeAction.cs (2)
24private readonly ImmutableArray<ISymbol> _selectedMembers; 33ImmutableArray<ISymbol> selectedMembers,
PullMemberUp\MemberAnalysisResult.cs (2)
14public readonly ISymbol Member; 46ISymbol member,
PullMemberUp\MemberAndDestinationValidator.cs (1)
29public static bool IsMemberValid([NotNullWhen(true)] ISymbol? member)
PullMemberUp\MembersPuller.cs (15)
40ImmutableArray<ISymbol> selectedMembers, 155private static ISymbol GetSymbolsToPullUp(MemberAnalysisResult analysisResult) 157var member = analysisResult.Member; 205ISymbol member, 454private static ISymbol MakeAbstractVersion(ISymbol member) 480private static async Task<ImmutableDictionary<ISymbol, ImmutableArray<SyntaxNode>>> InitializeSymbolToDeclarationsMapAsync( 486var symbolToDeclarationsBuilder = ImmutableDictionary.CreateBuilder<ISymbol, ImmutableArray<SyntaxNode>>(); 502private static bool IsSelectedMemberDeclarationAlreadyInDestination(ISymbol selectedMember, INamedTypeSymbol destination) 514private static bool IsSelectedMemberDeclarationAlreadyInDestinationClass(ISymbol selectedMember, INamedTypeSymbol destination) 524var overrideMembersSet = new HashSet<ISymbol>(); 525for (var symbol = selectedMember; symbol != null; symbol = symbol.GetOverriddenMember()) 534ISymbol selectedMember, INamedTypeSymbol destination) 536foreach (var interfaceMember in destination.GetMembers()) 538var implementationOfMember = selectedMember.ContainingType.FindImplementationForInterfaceMember(interfaceMember);
PullMemberUp\PullMembersUpOptionsBuilder.cs (1)
16ImmutableArray<(ISymbol member, bool makeAbstract)> members)
QuickInfo\CommonSemanticQuickInfoProvider.cs (12)
131private static bool HasNoErrors(ImmutableArray<ISymbol> symbols) 182protected virtual NullableFlowState GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) => NullableFlowState.None; 196: ImmutableArray<ISymbol>.Empty; 206var firstSymbol = symbols.First(); 224return new TokenInformation(ImmutableArray.Create<ISymbol>(typeInfo.Type)); 228return new TokenInformation(ImmutableArray<ISymbol>.Empty); 231private ImmutableArray<ISymbol> GetSymbolsFromToken(SyntaxToken token, SolutionServices services, SemanticModel semanticModel, CancellationToken cancellationToken) 235var symbol = semanticModel.GetSymbolInfo(lambdaSyntax, cancellationToken).Symbol; 236return symbol != null ? ImmutableArray.Create(symbol) : ImmutableArray<ISymbol>.Empty; 241var symbol = semanticModel.GetSymbolInfo(elementAccessExpression, cancellationToken).Symbol; 258private static bool IsOk([NotNullWhen(returnValue: true)] ISymbol? symbol) 272private static bool IsAccessible(ISymbol symbol, INamedTypeSymbol? within)
QuickInfo\CommonSemanticQuickInfoProvider.ErrorVisitor.cs (2)
17public static bool ContainsError(ISymbol? symbol) 20public override bool DefaultVisit(ISymbol symbol)
QuickInfo\CommonSemanticQuickInfoProvider.TokenInfo.cs (2)
13public readonly ImmutableArray<ISymbol> Symbols; 26public TokenInformation(ImmutableArray<ISymbol> symbols, bool showAwaitReturn = false, NullableFlowState nullableFlowState = NullableFlowState.None)
QuickInfo\QuickInfoUtilities.cs (3)
24public static Task<QuickInfoItem> CreateQuickInfoItemAsync(SolutionServices services, SemanticModel semanticModel, TextSpan span, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken) 31ImmutableArray<ISymbol> symbols, 43var symbol = symbols.First();
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
88var symbol = documentEditor.SemanticModel.GetDeclaredSymbol(node, cancellationToken);
Rename\IRenameIssuesService.cs (1)
13SemanticModel semantic, ISymbol symbol, SyntaxToken triggerToken, [NotNullWhen(true)] out string? langError);
Rename\SymbolicRenameInfo.cs (5)
34public ISymbol? Symbol { get; } 47ISymbol symbol, 148var triggerSymbol = tokenRenameInfo.HasSymbols ? tokenRenameInfo.Symbols.First() : null; 162var symbol = await RenameUtilities.TryGetRenamableSymbolAsync(document, triggerToken.SpanStart, cancellationToken: cancellationToken).ConfigureAwait(false); 174var originalSymbol = await SymbolFinder.FindSymbolAtPositionAsync(
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (5)
56var symbol = GetEnclosingSymbol(semanticModel, span.Start, cancellationToken); 96var childMember = namedType.GetMembers().FirstOrDefault(m => syntaxFacts.StringComparer.Equals(m.Name, singleWordText)); 117var foundSymbol = semanticModel.GetSpeculativeSymbolInfo(token.SpanStart, parsed, SpeculativeBindingOption.BindAsExpression).GetAnySymbol(); 127private static ISymbol? GetEnclosingSymbol(SemanticModel semanticModel, int position, CancellationToken cancellationToken) 134if (semanticModel.GetDeclaredSymbol(node, cancellationToken) is ISymbol declaration)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
433where TSymbol : class, ISymbol
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
430where TSymbol : class, ISymbol
RQName\RQNameInternal.cs (1)
16public static string? From(ISymbol symbol)
RQName\RQNodeBuilder.cs (1)
19public static RQNode? Build(ISymbol symbol)
Shared\Extensions\DocumentExtensions.cs (1)
113public static async Task<NamingRule> GetApplicableNamingRuleAsync(this Document document, ISymbol symbol, NamingStylePreferencesProvider fallbackOptions, CancellationToken cancellationToken)
Shared\Extensions\ISymbolExtensions_2.cs (5)
16public static Glyph GetGlyph(this ISymbol symbol) 180public static ImmutableArray<TaggedText> GetDocumentationParts(this ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter, CancellationToken cancellationToken) 184private static string? GetDocumentation(ISymbol symbol, Compilation compilation, CancellationToken cancellationToken) 198var containingSymbol = parameter.ContainingSymbol; 225this ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter)
Shared\Extensions\ISymbolExtensions_Sorting.cs (5)
25where TSymbol : ISymbol 34where TSymbol : ISymbol 132ISymbol symbol, 141private static ImmutableArray<IParameterSymbol> GetMethodOrIndexerOrEventParameters(ISymbol symbol) 159where TSymbol : ISymbol
Shared\Naming\IdentifierNameParts.cs (2)
28public static IdentifierNameParts CreateIdentifierNameParts(ISymbol symbol, ImmutableArray<NamingRule> rules) 39private static string RemovePrefixesAndSuffixes(ISymbol symbol, ImmutableArray<NamingRule> rules, string baseName)
Shared\Utilities\AnnotatedSymbolMapping.cs (10)
21public ImmutableDictionary<ISymbol, SyntaxAnnotation> SymbolToDeclarationAnnotationMap { get; } 31public ImmutableDictionary<DocumentId, ImmutableArray<ISymbol>> DocumentIdsToSymbolMap { get; } 39ImmutableDictionary<ISymbol, SyntaxAnnotation> symbolToDeclarationAnnotationMap, 41ImmutableDictionary<DocumentId, ImmutableArray<ISymbol>> documentIdsToSymbolMap, 56IEnumerable<ISymbol> symbols, 61using var _ = PooledDictionary<ISymbol, SyntaxAnnotation>.GetInstance(out var symbolToDeclarationAnnotationMap); 63using var _2 = PooledDictionary<DocumentId, List<ISymbol>>.GetInstance(out var documentIdToSymbolsMap); 73documentIdToSymbolsMap.Add(solution.GetRequiredDocument(typeNode.SyntaxTree).Id, new List<ISymbol>()); 75foreach (var symbol in symbols) 85documentIdToSymbolsMap.Add(id, new List<ISymbol>());
Shared\Utilities\ExtractTypeHelpers.cs (4)
117public static string GetTypeParameterSuffix(Document document, SyntaxFormattingOptions formattingOptions, INamedTypeSymbol type, IEnumerable<ISymbol> extractableMembers, CancellationToken cancellationToken) 132public static ImmutableArray<ITypeParameterSymbol> GetRequiredTypeParametersForMembers(INamedTypeSymbol type, IEnumerable<ISymbol> includedMembers) 186private static ImmutableArray<ITypeParameterSymbol> GetDirectlyReferencedTypeParameters(IEnumerable<ITypeParameterSymbol> potentialTypeParameters, IEnumerable<ISymbol> includedMembers) 200private static bool DoesMemberReferenceTypeParameter(ISymbol member, ITypeParameterSymbol typeParameter, HashSet<ITypeSymbol> checkedTypes)
Shared\Utilities\LinkedFilesSymbolEquivalenceComparer.cs (4)
14internal sealed class LinkedFilesSymbolEquivalenceComparer : IEqualityComparer<ISymbol> 18public bool Equals(ISymbol? x, ISymbol? y) 21public int GetHashCode(ISymbol symbol)
SignatureHelp\AbstractSignatureHelpProvider.cs (6)
133ISymbol orderSymbol, 151ISymbol orderSymbol, 168ISymbol orderSymbol, 267symbolKey.Resolve(compilation, ignoreAssemblyKey: true, cancellationToken).Symbol is not ISymbol symbol) 339protected static int? TryGetSelectedIndex<TSymbol>(ImmutableArray<TSymbol> candidates, ISymbol? currentSymbol) where TSymbol : class, ISymbol
SignatureHelp\AbstractSignatureHelpProvider.SymbolKeySignatureHelpItem.cs (1)
18ISymbol symbol,
Snippets\SnippetFunctionService.cs (1)
79foreach (var member in enumFields)
SolutionCrawler\WorkCoordinator.SemanticChangeProcessor.cs (7)
110var symbol = model.GetDeclaredSymbol(declarationNode, CancellationToken); 120private async Task<bool> TryEnqueueFromTypeAsync(Document document, ISymbol symbol) 145private async Task<bool> TryEnqueueFromMemberAsync(Document document, ISymbol symbol) 170private Task EnqueueWorkItemAsync(Document document, ISymbol symbol) 190private static bool IsInternal(ISymbol symbol) 197private static bool IsType(ISymbol symbol) 200private static bool IsMember(ISymbol symbol)
StackTraceExplorer\StackTraceExplorerUtilities.cs (1)
96ISymbol symbol = method;
SuppressMessageAttributeState.cs (2)
102out ImmutableArray<ISymbol> resolvedSymbols) 107resolvedSymbols = ImmutableArray<ISymbol>.Empty;
SuppressMessageAttributeState.TargetSymbolResolver.cs (17)
65public ImmutableArray<ISymbol> Resolve(out bool resolvedWithDocCommentIdFormat) 70return ImmutableArray<ISymbol>.Empty; 82var results = ArrayBuilder<ISymbol>.GetInstance(); 198ISymbol singleResult; 377private TypeInfo? ParseType(ISymbol bindingContext) 491private TypeInfo? ParseIndexedTypeParameter(ISymbol bindingContext) 540private TypeInfo? ParseNamedTypeParameter(ISymbol bindingContext) 574private TypeInfo? ParseNamedType(ISymbol bindingContext) 655private TypeInfo[] ParseTypeArgumentList(ISymbol bindingContext) 724private ISymbol GetFirstMatchingIndexer(ImmutableArray<ISymbol> candidateMembers, ParameterInfo[] parameters) 726foreach (var symbol in candidateMembers) 738private ImmutableArray<IMethodSymbol> GetMatchingMethods(ImmutableArray<ISymbol> candidateMembers, int? arity, ParameterInfo[] parameters, TypeInfo? returnType) 742foreach (var symbol in candidateMembers) 806private ITypeSymbol BindParameterOrReturnType(ISymbol bindingContext, TypeInfo type) 821private static INamedTypeSymbol GetFirstMatchingNamedType(ImmutableArray<ISymbol> candidateMembers, int arity) 828private static INamespaceOrTypeSymbol GetFirstMatchingNamespaceOrType(ImmutableArray<ISymbol> candidateMembers)
SymbolMapping\ISymbolMappingService.cs (1)
33Task<SymbolMappingResult?> MapSymbolAsync(Document document, ISymbol symbol, CancellationToken cancellationToken = default);
SymbolMapping\SymbolMappingResult.cs (2)
12public ISymbol Symbol { get; } 14internal SymbolMappingResult(Project project, ISymbol symbol)
SymbolMapping\SymbolMappingServiceFactory.cs (2)
27var symbol = symbolId.Resolve(compilation, cancellationToken: cancellationToken).Symbol; 36public Task<SymbolMappingResult> MapSymbolAsync(Document document, ISymbol symbol, CancellationToken cancellationToken)
UseCompoundAssignmentUtilities.cs (1)
110var symbol = symbolInfo.Symbol;
UseConditionalExpressionForReturnHelpers.cs (1)
16ISymbol containingSymbol,
UseExplicitTupleNameDiagnosticAnalyzer.cs (1)
79foreach (var member in containingType.GetMembers())
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
60var symbol = semanticModel.GetSymbolInfo(receiver, cancellationToken).Symbol;
UseNamedMemberInitializerAnalyzer.cs (4)
128var leftSymbol = _semanticModel.GetSymbolInfo(leftMemberAccess, _cancellationToken).GetAnySymbol(); 139if (IsExplicitlyImplemented(type, leftSymbol, out var typeMember)) 187ISymbol member, 188out ISymbol typeMember)
UseSystemHashCodeCodeFixProvider.cs (1)
64var method = semanticModel.GetDeclaredSymbol(methodDecl, cancellationToken);
UseSystemHashCodeDiagnosticAnalyzer.cs (1)
45var owningSymbol = context.OwningSymbol;
ValueTracking\ValueTrackedItem.cs (1)
49public static async ValueTask<ValueTrackedItem?> TryCreateAsync(Solution solution, Location location, ISymbol symbol, ValueTrackedItem? parent = null, CancellationToken cancellationToken = default)
ValueTracking\ValueTracker.cs (8)
82var symbol = await GetSymbolAsync(previousTrackedItem, solution, cancellationToken).ConfigureAwait(false); 99var previousSymbol = await GetSymbolAsync(previousTrackedItem.Parent, solution, cancellationToken).ConfigureAwait(false); 165private static async Task TrackVariableReferencesAsync(ISymbol symbol, OperationCollector collector, CancellationToken cancellationToken) 180var containingSymbol = parameterSymbol.ContainingSymbol; 256private static async Task<(ISymbol?, SyntaxNode?)> GetSelectedSymbolAsync(TextSpan textSpan, Document document, CancellationToken cancellationToken) 262var selectedSymbol = 285private static async Task TrackVariableDefinitionsAsync(ISymbol symbol, OperationCollector collector, CancellationToken cancellationToken) 322private static async Task<ISymbol?> GetSymbolAsync(ValueTrackedItem? item, Solution solution, CancellationToken cancellationToken)
ValueTracking\ValueTracker.FindReferencesProgress.cs (1)
39public async ValueTask OnReferenceFoundAsync(SymbolGroup _, ISymbol symbol, ReferenceLocation location, CancellationToken cancellationToken)
ValueTracking\ValueTracker.OperationCollector.cs (1)
177private async Task AddOperationAsync(IOperation operation, ISymbol symbol, CancellationToken cancellationToken)
ValueTracking\ValueTrackingProgressCollector.cs (1)
40internal async Task<bool> TryReportAsync(Solution solution, Location location, ISymbol symbol, CancellationToken cancellationToken = default)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\Definitions\AbstractGoToDefinitionHandler.cs (1)
69var symbol = await SymbolFinder.FindSymbolAtPositionAsync(document, position, cancellationToken).ConfigureAwait(false);
Handler\References\FindUsagesLSPContext.cs (1)
213var symbol = await SymbolFinder.FindSymbolAtPositionAsync(_document, _position, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator (24)
Generator.cs (7)
309var declaredSymbol = semanticFactsService.GetDeclaredSymbol(semanticModel, syntaxToken, cancellationToken); 310ISymbol? referencedSymbol = null; 333var symbolForLinkedResultSet = (declaredSymbol ?? referencedSymbol)!.GetOriginalUnreducedDefinition(); 353foreach (var implementedMember in implementedMembers) 360var overridenMember = declaredSymbol.GetOverriddenMember(); 369void MarkImplementationOfSymbol(ISymbol baseMember) 458private static bool IncludeSymbolInReferences(ISymbol symbol)
ResultSetTracking\DelegatingResultSetTracker.cs (5)
12private readonly Func<ISymbol, IResultSetTracker> _chooseTrackerForSymbol; 14public DelegatingResultSetTracker(Func<ISymbol, IResultSetTracker> chooseTrackerForSymbol) 19public Id<T> GetResultIdForSymbol<T>(ISymbol symbol, string edgeKind, Func<IdFactory, T> vertexCreator) where T : Vertex 24public Id<ResultSet> GetResultSetIdForSymbol(ISymbol symbol) 29public bool ResultSetNeedsInformationalEdgeAdded(ISymbol symbol, string edgeKind)
ResultSetTracking\IResultSetTracker.cs (3)
18Id<ResultSet> GetResultSetIdForSymbol(ISymbol symbol); 24Id<T> GetResultIdForSymbol<T>(ISymbol symbol, string edgeKind, Func<IdFactory, T> vertexCreator) where T : Vertex; 32bool ResultSetNeedsInformationalEdgeAdded(ISymbol symbol, string edgeKind);
ResultSetTracking\IResultSetTrackerExtensions.cs (2)
20public static Id<ReferenceResult> GetResultSetReferenceResultId(this IResultSetTracker tracker, ISymbol symbol) 26public static Id<Moniker> GetMoniker(this IResultSetTracker tracker, ISymbol symbol, Compilation sourceCompilation)
ResultSetTracking\SymbolHoldingResultSetTracker.cs (7)
16private readonly Dictionary<ISymbol, TrackedResultSet> _symbolToResultSetId = new Dictionary<ISymbol, TrackedResultSet>(); 25/// we can't just use <see cref="ISymbol.Locations" /> to make the determination. 36private TrackedResultSet GetTrackedResultSet(ISymbol symbol) 83public Id<ResultSet> GetResultSetIdForSymbol(ISymbol symbol) 88public Id<T> GetResultIdForSymbol<T>(ISymbol symbol, string edgeKind, Func<IdFactory, T> vertexCreator) where T : Vertex 93public bool ResultSetNeedsInformationalEdgeAdded(ISymbol symbol, string edgeKind)
Microsoft.CodeAnalysis.Remote.ServiceHub (11)
Services\DependentTypeFinder\RemoteDependentTypeFinderService.cs (1)
39var symbol = await typeAndProjectId.TryRehydrateAsync(solution, cancellationToken).ConfigureAwait(false);
Services\ExtensionMethodImportCompletion\RemoteExtensionMethodImportCompletionService.cs (1)
49var symbol = SymbolKey.ResolveString(receiverTypeSymbolKeyData, compilation, cancellationToken: cancellationToken).GetAnySymbol();
Services\FindUsages\RemoteFindUsagesService.cs (2)
42var symbol = await symbolAndProjectId.TryRehydrateAsync( 64var symbol = await symbolAndProjectId.TryRehydrateAsync(
Services\Renamer\RemoteRenamerService.cs (3)
46var symbol = await symbolAndProjectId.TryRehydrateAsync( 70var symbol = await symbolAndProjectId.TryRehydrateAsync( 98var symbol = await symbolAndProjectId.TryRehydrateAsync(solution, cancellationToken).ConfigureAwait(false);
Services\SymbolFinder\RemoteSymbolFinderService.cs (4)
46var symbol = await symbolAndProjectIdArg.TryRehydrateAsync( 83private static ImmutableArray<SerializableSymbolAndProjectId> Convert(ImmutableArray<ISymbol> items, Solution solution, CancellationToken cancellationToken) 87foreach (var item in items) 234public ValueTask OnReferenceFoundAsync(SymbolGroup group, ISymbol definition, ReferenceLocation reference, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Test.Utilities (65)
Compilation\CompilationExtensions.cs (5)
144IEnumerable<ISymbol> allAddedSymbols = null, 148var isAddedSymbol = new Func<ISymbol, bool>(s => allAddedSymbols?.Contains(s) ?? false); 253internal static bool CanHaveExecutableCodeBlock(ISymbol symbol) 277var roots = ArrayBuilder<(IOperation operation, ISymbol associatedSymbol)>.GetInstance(); 356void checkControlFlowGraph(IOperation root, ISymbol associatedSymbol)
Compilation\ControlFlowGraphVerifier.cs (12)
28public static (ControlFlowGraph graph, ISymbol associatedSymbol) GetControlFlowGraph(SyntaxNode syntaxNode, SemanticModel model) 78var declaredSymbol = model.GetDeclaredSymbol(operationRoot.Syntax); 82public static void VerifyGraph(Compilation compilation, string expectedFlowGraph, ControlFlowGraph graph, ISymbol associatedSymbol) 98public static string GetFlowGraph(Compilation compilation, ControlFlowGraph graph, ISymbol associatedSymbol) 109ControlFlowRegion enclosing, string idSuffix, int indent, ISymbol associatedSymbol) 119var referencedLocalsAndMethods = PooledHashSet<ISymbol>.GetInstance(); 1710ISymbol symbol = referencedLocalsAndMethods.First(); 1778static bool isInAssociatedSymbol(ISymbol symbol, ISymbol associatedSymbol) 1826private readonly ISymbol _associatedSymbol; 1830Compilation compilation, IOperation root, int initialIndent, ISymbol associatedSymbol) : 2012private static bool IsTopLevelMainMethod([NotNullWhen(true)] this ISymbol? symbol)
Compilation\OperationTreeVerifier.cs (3)
263private void LogSymbol(ISymbol symbol, string header, bool logDisplayString = true) 375internal void VisitSymbolArrayElement(ISymbol element) 412private void VisitArray(ImmutableArray<ISymbol> list, string header, bool logElementCount, bool logNullForDefault = false)
Compilation\TestOperationVisitor.cs (2)
783foreach (var symbol in symbolInfo.GetAllSymbols()) 856private static void AssertConstrainedToType(ISymbol member, ITypeSymbol constrainedToType)
CompilationVerifier.cs (1)
661var symbol = dummy.GetAssemblyOrModuleSymbol(metadataReference);
Diagnostics\CommonDiagnosticAnalyzers.cs (34)
672internal readonly ConcurrentSet<ISymbol> CallbackSymbols = new(); 1120private readonly ConcurrentDictionary<IOperation, (ControlFlowGraph Graph, ISymbol AssociatedSymbol)> _controlFlowGraphMapOpt; 1142_controlFlowGraphMapOpt = verifyGetControlFlowGraph ? new ConcurrentDictionary<IOperation, (ControlFlowGraph, ISymbol)>() : null; 1145public ImmutableArray<(ControlFlowGraph Graph, ISymbol AssociatedSymbol)> GetControlFlowGraphs() 1157private void CacheAndVerifyControlFlowGraph(ImmutableArray<IOperation> operationBlocks, Func<IOperation, (ControlFlowGraph Graph, ISymbol AssociatedSymbol)> getControlFlowGraph) 1548private void ReportSymbolDiagnostics(ISymbol symbol, Action<Diagnostic> addDiagnostic) 1589var namedTypes = new HashSet<ISymbol>(); 1594foreach (var namedType in namedTypes) 1772SymbolsStarted = new ConcurrentSet<ISymbol>(); 1775internal ConcurrentSet<ISymbol> SymbolsStarted { get; } 1869var symbolsEnded = new ConcurrentSet<ISymbol>(); 1870var seenOperationContainers = new ConcurrentDictionary<OperationAnalysisContext, ISet<ISymbol>>(); 1967IEnumerable<ISymbol> GetContainingSymbolsAndThis(ISymbol symbol) 1979ISymbol symbolStarted = symbolStartContext.Symbol; 1980IEnumerable<ISymbol> members; 1995foreach (var member in members.Where(m => !m.IsImplicitlyDeclared)) 2007ISymbol symbolEnded = symbolEndContext.Symbol; 2008IList<ISymbol> containersToVerify = new List<ISymbol>(); 2019foreach (var container in containersToVerify) 2034ISet<ISymbol> containers = kvp.Value; 2251private readonly ConcurrentSet<ISymbol> _symbolCallbacks; 2257_symbolCallbacks = new ConcurrentSet<ISymbol>(); 2316private void ReportDiagnostic(ISymbol symbol, Action<Diagnostic> reportDiagnostic) 2658public readonly List<ISymbol> AnalyzedSymbols = new(); 2659public readonly List<ISymbol> AnalyzedSymbolStartSymbols = new(); 2660public readonly List<ISymbol> AnalyzedSymbolEndSymbols = new(); 2662public readonly List<ISymbol> AnalyzedOperationBlockSymbols = new(); 2664public readonly List<ISymbol> AnalyzedOperationBlockStartSymbols = new(); 2665public readonly List<ISymbol> AnalyzedOperationBlockEndSymbols = new(); 2667public readonly List<ISymbol> AnalyzedCodeBlockSymbols = new(); 2669public readonly List<ISymbol> AnalyzedCodeBlockStartSymbols = new(); 2670public readonly List<ISymbol> AnalyzedCodeBlockEndSymbols = new();
Diagnostics\OperationTestAnalyzer.cs (1)
1379ISymbol memberSymbol;
Diagnostics\OptionsDiagnosticAnalyzer.cs (1)
27protected override void OnAbstractMember(string AbstractMemberName, SyntaxNode node = null, ISymbol symbol = null, [CallerMemberName] string callerName = null)
Diagnostics\TestDiagnosticAnalyzer.cs (1)
33protected abstract void OnAbstractMember(string abstractMemberName, SyntaxNode node = null, ISymbol symbol = null, [CallerMemberName] string callerName = null);
Diagnostics\ThrowingDiagnosticAnalyzer.cs (1)
52protected override void OnAbstractMember(string abstractMemberName, SyntaxNode node, ISymbol symbol, string methodName)
Diagnostics\TrackingDiagnosticAnalyzer.cs (2)
34public Entry(string abstractMemberName, string callerName, SyntaxNode node, ISymbol symbol) 52protected override void OnAbstractMember(string abstractMemberName, SyntaxNode node, ISymbol symbol, string callerName)
Extensions\SymbolExtensions.cs (1)
11public static string ToTestDisplayString(this ISymbol symbol)
Metadata\ILBuilderVisualizer.cs (1)
62ISymbol symbol = ((reference as ISymbolInternal) ?? (reference as Cci.IReference)?.GetInternalSymbol())?.GetISymbol();
Microsoft.CodeAnalysis.UnitTests (11)
Diagnostics\OperationTests.cs (1)
328var cfgSymbol = model.GetDeclaredSymbol(methodBodySyntax);
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (6)
1347var expectedSymbols = new List<ISymbol>(); 1369var expectedSymbol = expectedSymbols.Single(); 1378var symbol = symbols.SingleOrDefault(); 1385foreach (var symbol in symbols) 1395private static ISymbol GetSymbolAtPosition(SemanticModel model, int pos) 1406var symbol = q.FirstOrDefault();
Symbols\DocumentationCommentIdTests.cs (4)
35var symbol = comp.GetSymbolsWithName("DoStuff").Single(); 66var symbol = comp.GetSymbolsWithName("DoStuff").Single(); 85var symbol = comp.GetSymbolsWithName("DoStuff").Single(); 109var symbol = comp.GetSymbolsWithName("DoStuff").Single();
Microsoft.CodeAnalysis.VisualBasic (206)
Analysis\FlowAnalysis\DataFlowsOutWalker.vb (3)
23Private ReadOnly _dataFlowsIn As ImmutableArray(Of ISymbol) 32unassignedVariables As HashSet(Of Symbol), originalUnassigned As HashSet(Of Symbol), dataFlowsIn As ImmutableArray(Of ISymbol)) 41unassignedVariables As HashSet(Of Symbol), dataFlowsIn As ImmutableArray(Of ISymbol)) As HashSet(Of Symbol)
Analysis\FlowAnalysis\VisualBasicDataFlowAnalysis.vb (38)
22Private _variablesDeclared As ImmutableArray(Of ISymbol) 24Private _dataFlowsIn As ImmutableArray(Of ISymbol) 25Private _definitelyAssignedOnEntry As ImmutableArray(Of ISymbol) 26Private _definitelyAssignedOnExit As ImmutableArray(Of ISymbol) 27Private _dataFlowsOut As ImmutableArray(Of ISymbol) 28Private _alwaysAssigned As ImmutableArray(Of ISymbol) 29Private _readInside As ImmutableArray(Of ISymbol) 30Private _writtenInside As ImmutableArray(Of ISymbol) 31Private _readOutside As ImmutableArray(Of ISymbol) 32Private _writtenOutside As ImmutableArray(Of ISymbol) 33Private _captured As ImmutableArray(Of ISymbol) 34Private _capturedInside As ImmutableArray(Of ISymbol) 35Private _capturedOutside As ImmutableArray(Of ISymbol) 47Public Overrides ReadOnly Property VariablesDeclared As ImmutableArray(Of ISymbol) 50Dim result = If(Me._context.Failed, ImmutableArray(Of ISymbol).Empty, 72Public Overrides ReadOnly Property DataFlowsIn As ImmutableArray(Of ISymbol) 76Dim result = If(Me._context.Failed, ImmutableArray(Of ISymbol).Empty, 84Public Overrides ReadOnly Property DefinitelyAssignedOnEntry As ImmutableArray(Of ISymbol) 90Public Overrides ReadOnly Property DefinitelyAssignedOnExit As ImmutableArray(Of ISymbol) 96Private Function ComputeDefinitelyAssignedValues() As (onEntry As ImmutableArray(Of ISymbol), onExit As ImmutableArray(Of ISymbol)) 101Dim entry = ImmutableArray(Of ISymbol).Empty 102Dim ex = ImmutableArray(Of ISymbol).Empty 121Public Overrides ReadOnly Property DataFlowsOut As ImmutableArray(Of ISymbol) 125Dim result = If(Me._context.Failed, ImmutableArray(Of ISymbol).Empty, 136Public Overrides ReadOnly Property AlwaysAssigned As ImmutableArray(Of ISymbol) 139Dim result = If(Me._context.Failed, ImmutableArray(Of ISymbol).Empty, 150Public Overrides ReadOnly Property ReadInside As ImmutableArray(Of ISymbol) 162Public Overrides ReadOnly Property WrittenInside As ImmutableArray(Of ISymbol) 174Public Overrides ReadOnly Property ReadOutside As ImmutableArray(Of ISymbol) 186Public Overrides ReadOnly Property WrittenOutside As ImmutableArray(Of ISymbol) 237Public Overrides ReadOnly Property Captured As ImmutableArray(Of ISymbol) 247Public Overrides ReadOnly Property CapturedInside As ImmutableArray(Of ISymbol) 257Public Overrides ReadOnly Property CapturedOutside As ImmutableArray(Of ISymbol) 283Public Overrides ReadOnly Property UnsafeAddressTaken As ImmutableArray(Of ISymbol) 285Return ImmutableArray(Of ISymbol).Empty 295Friend Function Normalize(data As IEnumerable(Of Symbol)) As ImmutableArray(Of ISymbol) 299Return builder.ToImmutableAndFree().As(Of ISymbol)()
Binding\MemberSemanticModel.vb (4)
499Friend Overloads Overrides Function GetDeclaredSymbol(declarationSyntax As MethodBaseSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 568Public Overrides Function GetDeclaredSymbol(identifierSyntax As ModifiedIdentifierSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 708Friend Overrides Function GetDeclaredSymbols(declarationSyntax As FieldDeclarationSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 710Return ImmutableArray.Create(Of ISymbol)()
Compilation\DocumentationComments\DocumentationCommentCompiler.vb (1)
55''' <param name="assemblyName">Assembly name override, if specified. Otherwise the <see cref="ISymbol.Name"/> of the source assembly is used.</param>
Compilation\LexicalOrderSymbolComparer.vb (2)
37comparison = DirectCast(x, ISymbol).Kind.ToSortOrder() - DirectCast(y, ISymbol).Kind.ToSortOrder()
Compilation\SemanticModel.vb (41)
435Public Shadows Function GetMemberGroup(expression As ExpressionSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 445Return StaticCast(Of ISymbol).From(result) 447Return ImmutableArray(Of ISymbol).Empty 451Public Shadows Function GetSpeculativeMemberGroup(position As Integer, expression As ExpressionSyntax) As ImmutableArray(Of ISymbol) 462Return StaticCast(Of ISymbol).From(result) 464Return ImmutableArray(Of ISymbol).Empty 468Public Shadows Function GetMemberGroup(attribute As AttributeSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 478Return StaticCast(Of ISymbol).From(result) 480Return ImmutableArray(Of ISymbol).Empty 1597) As ImmutableArray(Of ISymbol) 1608Return StaticCast(Of ISymbol).From(result) 1647) As ImmutableArray(Of ISymbol) 1655Return StaticCast(Of ISymbol).From(result) 1680) As ImmutableArray(Of ISymbol) 1687Return StaticCast(Of ISymbol).From(result) 1712) As ImmutableArray(Of ISymbol) 1720Return StaticCast(Of ISymbol).From(result) 1740) As ImmutableArray(Of ISymbol) 1747Return StaticCast(Of ISymbol).From(result) 2066Public Shadows Function IsAccessible(position As Integer, symbol As ISymbol) As Boolean 2376Public Overridable Overloads Function GetDeclaredSymbol(identifierSyntax As ModifiedIdentifierSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 2420Public Overloads Function GetDeclaredSymbol(elementSyntax As TupleElementSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 2598Friend MustOverride Overloads Function GetDeclaredSymbol(declarationSyntax As MethodBaseSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 2741Friend MustOverride Function GetDeclaredSymbols(declarationSyntax As FieldDeclarationSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 2843Return SymbolInfoFactory.Create(StaticCast(Of ISymbol).From(symbols.ToImmutableAndFree()), reason) 2980Public Shadows Function GetEnclosingSymbol(position As Integer, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 3142Private Function GetMemberGroupForNode(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 3157Return ImmutableArray(Of ISymbol).Empty 3208Protected NotOverridable Overrides Function GetMemberGroupCore(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 3212Protected NotOverridable Overrides Function LookupSymbolsCore(position As Integer, container As INamespaceOrTypeSymbol, name As String, includeReducedExtensionMethods As Boolean) As ImmutableArray(Of ISymbol) 3216Protected NotOverridable Overrides Function LookupBaseMembersCore(position As Integer, name As String) As ImmutableArray(Of ISymbol) 3220Protected NotOverridable Overrides Function LookupStaticMembersCore(position As Integer, container As INamespaceOrTypeSymbol, name As String) As ImmutableArray(Of ISymbol) 3224Protected NotOverridable Overrides Function LookupNamespacesAndTypesCore(position As Integer, container As INamespaceOrTypeSymbol, name As String) As ImmutableArray(Of ISymbol) 3228Protected NotOverridable Overrides Function LookupLabelsCore(position As Integer, name As String) As ImmutableArray(Of ISymbol) 3244Protected NotOverridable Overrides Function GetDeclaredSymbolCore(declaration As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 3356Protected NotOverridable Overrides Function GetDeclaredSymbolsCore(declaration As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 3369Return ImmutableArray.Create(Of ISymbol)() 3431Protected NotOverridable Overrides Function GetEnclosingSymbolCore(position As Integer, Optional cancellationToken As System.Threading.CancellationToken = Nothing) As ISymbol 3507Protected NotOverridable Overrides Function IsAccessibleCore(position As Integer, symbol As ISymbol) As Boolean 3519Friend Overrides Sub ComputeDeclarationsInNode(node As SyntaxNode, associatedSymbol As ISymbol, getSymbol As Boolean, builder As ArrayBuilder(Of DeclarationInfo), cancellationToken As CancellationToken, Optional levelsToCompute As Integer? = Nothing) 3523Protected Overrides Function GetTopmostNodeForDiagnosticAnalysis(symbol As ISymbol, declaringSyntax As SyntaxNode) As SyntaxNode
Compilation\SpeculativeSemanticModelWithMemberModel.vb (3)
165Friend Overloads Overrides Function GetDeclaredSymbol(declarationSyntax As MethodBaseSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 185Public Overrides Function GetDeclaredSymbol(identifierSyntax As ModifiedIdentifierSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 209Friend Overrides Function GetDeclaredSymbols(declarationSyntax As FieldDeclarationSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol)
Compilation\SpeculativeSyntaxTreeSemanticModel.vb (1)
95Return SymbolInfoFactory.Create(ImmutableArray.Create(Of ISymbol)(aliasSymbol), If(aliasSymbol IsNot Nothing, LookupResultKind.Good, LookupResultKind.Empty))
Compilation\SymbolInfo.vb (3)
14Return Create(StaticCast(Of ISymbol).From(symbols), resultKind) 17Friend Shared Function Create(symbols As ImmutableArray(Of ISymbol), resultKind As LookupResultKind) As SymbolInfo 22Friend Shared Function Create(symbols As ImmutableArray(Of ISymbol), reason As CandidateReason) As SymbolInfo
Compilation\SyntaxTreeSemanticModel.vb (5)
959Friend Overloads Overrides Function GetDeclaredSymbol(declarationSyntax As MethodBaseSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 1113Dim symbol As ISymbol = Nothing 1179Public Overrides Function GetDeclaredSymbol(declarationSyntax As ModifiedIdentifierSyntax, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 1353Friend Overrides Function GetDeclaredSymbols(declarationSyntax As FieldDeclarationSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 1362Dim builder = New ArrayBuilder(Of ISymbol)
Compilation\VisualBasicCompilation.vb (12)
2010Private Protected Overrides Function IsSymbolAccessibleWithinCore(symbol As ISymbol, within As ISymbol, throughType As ITypeSymbol) As Boolean 2020Friend Shadows Function IsSymbolAccessibleWithin(symbol As ISymbol, within As ISymbol, Optional throughType As ITypeSymbol = Nothing) As Boolean 2570isAddedSymbol As Func(Of ISymbol, Boolean), 2780Protected Overrides Function CommonGetAssemblyOrModuleSymbol(reference As MetadataReference) As ISymbol 3086Public Overrides Function GetSymbolsWithName(predicate As Func(Of String, Boolean), Optional filter As SymbolFilter = SymbolFilter.TypeAndMember, Optional cancellationToken As CancellationToken = Nothing) As IEnumerable(Of ISymbol) 3117Public Overrides Function GetSymbolsWithName(name As String, Optional filter As SymbolFilter = SymbolFilter.TypeAndMember, Optional cancellationToken As CancellationToken = Nothing) As IEnumerable(Of ISymbol) 3169Public Function GetSymbolsWithName() As IEnumerable(Of ISymbol) 3170Dim result = New HashSet(Of ISymbol)() 3182spine As ArrayBuilder(Of MergedNamespaceOrTypeDeclaration), current As MergedNamespaceOrTypeDeclaration, [set] As HashSet(Of ISymbol)) 3223spine As ArrayBuilder(Of MergedNamespaceOrTypeDeclaration), mergedType As MergedTypeDeclaration, [set] As HashSet(Of ISymbol))
Emit\EditAndContinue\EmitHelpers.vb (1)
22isAddedSymbol As Func(Of ISymbol, Boolean),
Emit\EditAndContinue\PEDeltaAssemblyBuilder.vb (1)
35isAddedSymbol As Func(Of ISymbol, Boolean))
Emit\EditAndContinue\VisualBasicDefinitionMap.vb (1)
54Protected Overrides Function GetISymbolInternalOrNull(symbol As ISymbol) As ISymbolInternal
Emit\EditAndContinue\VisualBasicSymbolChanges.vb (2)
13Public Sub New(definitionMap As DefinitionMap, edits As IEnumerable(Of SemanticEdit), isAddedSymbol As Func(Of ISymbol, Boolean)) 17Protected Overrides Function GetISymbolInternalOrNull(symbol As ISymbol) As ISymbolInternal
Errors\MessageProvider.vb (1)
111Public Overrides Function GetErrorDisplayString(symbol As ISymbol) As String
Operations\VisualBasicOperationFactory_Methods.vb (1)
275Friend Function CreateReceiverOperation(node As BoundNode, symbol As ISymbol) As IOperation
SymbolDisplay\SymbolDisplay.vb (5)
26Public Function ToDisplayString(symbol As ISymbol, Optional format As SymbolDisplayFormat = Nothing) As String 43Public Function ToMinimalDisplayString(symbol As ISymbol, 60Public Function ToDisplayParts(symbol As ISymbol, 78Public Function ToMinimalDisplayParts(symbol As ISymbol, 86Private Function ToDisplayParts(symbol As ISymbol,
SymbolDisplay\SymbolDisplayVisitor.Members.vb (4)
610Private Sub AddMemberModifiersIfRequired(symbol As ISymbol) 675Private Function IsWithEventsProperty(symbol As ISymbol) As Boolean 680Private Function IsOverloads(symbol As ISymbol) As Boolean 696Private Sub AssertContainingSymbol(symbol As ISymbol)
SymbolDisplay\SymbolDisplayVisitor.Types.vb (1)
139Dim containingSymbol As ISymbol = symbol.ContainingSymbol
SymbolDisplay\SymbolDisplayVisitor.vb (4)
61symbol As ISymbol, 312Private Sub AddAccessibilityIfRequired(symbol As ISymbol) 345Private Function ShouldVisitNamespace(containingSymbol As ISymbol) As Boolean 360Private Shared Function IsEnumMember(symbol As ISymbol) As Boolean
Symbols\ErrorTypeSymbol.vb (2)
411Public ReadOnly Property IErrorTypeSymbol_CandidateSymbols As ImmutableArray(Of ISymbol) Implements IErrorTypeSymbol.CandidateSymbols 413Return StaticCast(Of ISymbol).From(Me.CandidateSymbols)
Symbols\FieldSymbol.vb (1)
402Private ReadOnly Property IFieldSymbol_AssociatedSymbol As ISymbol Implements IFieldSymbol.AssociatedSymbol
Symbols\Metadata\PE\PENamedTypeSymbol.vb (4)
612Implements IComparer(Of ISymbol) 619Public Function Compare(x As ISymbol, y As ISymbol) As Integer Implements IComparer(Of ISymbol).Compare
Symbols\MethodSymbol.vb (2)
962Private ReadOnly Property ISymbol_IsExtern As Boolean Implements ISymbol.IsExtern 1073Private ReadOnly Property IMethodSymbol_AssociatedSymbol As ISymbol Implements IMethodSymbol.AssociatedSymbol
Symbols\NamedTypeSymbol.vb (1)
1206Private ReadOnly Property INamedTypeSymbol_AssociatedSymbol As ISymbol Implements INamedTypeSymbol.AssociatedSymbol
Symbols\NamespaceOrTypeSymbol.vb (4)
268Private Function INamespaceOrTypeSymbol_GetMembers() As ImmutableArray(Of ISymbol) Implements INamespaceOrTypeSymbol.GetMembers 269Return StaticCast(Of ISymbol).From(Me.GetMembers()) 272Private Function INamespaceOrTypeSymbol_GetMembers(name As String) As ImmutableArray(Of ISymbol) Implements INamespaceOrTypeSymbol.GetMembers 273Return StaticCast(Of ISymbol).From(Me.GetMembers(name))
Symbols\Symbol.vb (41)
59Public Overridable ReadOnly Property MetadataName As String Implements ISymbol.MetadataName, ISymbolInternal.MetadataName 69Public Overridable ReadOnly Property MetadataToken As Integer Implements ISymbol.MetadataToken 717Public Overridable Function GetDocumentationCommentId() As String Implements ISymbol.GetDocumentationCommentId 732Public Overridable Function GetDocumentationCommentXml(Optional preferredCulture As CultureInfo = Nothing, Optional expandIncludes As Boolean = False, Optional cancellationToken As CancellationToken = Nothing) As String Implements ISymbol.GetDocumentationCommentXml 777Private Overloads Function IEquatable_Equals(other As ISymbol) As Boolean Implements IEquatable(Of ISymbol).Equals 781Private Overloads Function ISymbol_Equals(other As ISymbol, equalityComparer As SymbolEqualityComparer) As Boolean Implements ISymbol.Equals 908Public Overridable ReadOnly Property HasUnsupportedMetadata As Boolean Implements ISymbol.HasUnsupportedMetadata 1104Public MustOverride Sub Accept(visitor As SymbolVisitor) Implements ISymbol.Accept 1106Public MustOverride Function Accept(Of TResult)(visitor As SymbolVisitor(Of TResult)) As TResult Implements ISymbol.Accept 1108Public MustOverride Function Accept(Of TArgument, TResult)(visitor As SymbolVisitor(Of TArgument, TResult), argument As TArgument) As TResult Implements ISymbol.Accept 1114Private ReadOnly Property ISymbol_ContainingAssembly As IAssemblySymbol Implements ISymbol.ContainingAssembly 1126Private ReadOnly Property ISymbol_ContainingModule As IModuleSymbol Implements ISymbol.ContainingModule 1138Private ReadOnly Property ISymbol_ContainingNamespace As INamespaceSymbol Implements ISymbol.ContainingNamespace 1150Private ReadOnly Property ISymbol_ContainingSymbol As ISymbol Implements ISymbol.ContainingSymbol 1162Private ReadOnly Property ISymbol_ContainingType As INamedTypeSymbol Implements ISymbol.ContainingType 1174Private ReadOnly Property ISymbol_DeclaredAccessibility As Accessibility Implements ISymbol.DeclaredAccessibility, ISymbolInternal.DeclaredAccessibility 1180Protected Overridable ReadOnly Property ISymbol_IsAbstract As Boolean Implements ISymbol.IsAbstract, ISymbolInternal.IsAbstract 1186Private ReadOnly Property ISymbol_IsDefinition As Boolean Implements ISymbol.IsDefinition, ISymbolInternal.IsDefinition 1192Private ReadOnly Property ISymbol_IsOverride As Boolean Implements ISymbol.IsOverride, ISymbolInternal.IsOverride 1198Protected Overridable ReadOnly Property ISymbol_IsSealed As Boolean Implements ISymbol.IsSealed 1204Protected Overridable ReadOnly Property ISymbol_IsStatic As Boolean Implements ISymbol.IsStatic, ISymbolInternal.IsStatic 1210Private ReadOnly Property ISymbol_IsImplicitlyDeclared As Boolean Implements ISymbol.IsImplicitlyDeclared, ISymbolInternal.IsImplicitlyDeclared 1216Private ReadOnly Property ISymbol_IsVirtual As Boolean Implements ISymbol.IsVirtual, ISymbolInternal.IsVirtual 1222Private ReadOnly Property ISymbol_CanBeReferencedByName As Boolean Implements ISymbol.CanBeReferencedByName 1228Public ReadOnly Property Language As String Implements ISymbol.Language 1234Private ReadOnly Property ISymbol_Locations As ImmutableArray(Of Location) Implements ISymbol.Locations, ISymbolInternal.Locations 1240Private ReadOnly Property ISymbol_DeclaringSyntaxReferences As ImmutableArray(Of SyntaxReference) Implements ISymbol.DeclaringSyntaxReferences 1246Private ReadOnly Property ISymbol_Name As String Implements ISymbol.Name, ISymbolInternal.Name 1252Private ReadOnly Property ISymbol_OriginalDefinition As ISymbol Implements ISymbol.OriginalDefinition 1258Private ReadOnly Property ISymbol_Kind As SymbolKind Implements ISymbol.Kind, ISymbolInternal.Kind 1264Private Function ISymbol_ToDisplayString(Optional format As SymbolDisplayFormat = Nothing) As String Implements ISymbol.ToDisplayString 1268Private Function ISymbol_ToDisplayParts(Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ISymbol.ToDisplayParts 1272Private Function ISymbol_ToMinimalDisplayString(semanticModel As SemanticModel, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As String Implements ISymbol.ToMinimalDisplayString 1276Private Function ISymbol_ToMinimalDisplayParts(semanticModel As SemanticModel, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ISymbol.ToMinimalDisplayParts 1280Private ReadOnly Property ISymbol_IsExtern As Boolean Implements ISymbol.IsExtern 1286Private Function ISymbol_GetAttributes() As ImmutableArray(Of AttributeData) Implements ISymbol.GetAttributes 1317Private Function ISymbolInternal_GetISymbol() As ISymbol Implements ISymbolInternal.GetISymbol
Symbols\SymbolExtensions.vb (1)
444Friend Function EnsureVbSymbolOrNothing(Of TSource As ISymbol, TDestination As {Symbol, TSource})(symbol As TSource, paramName As String) As TDestination
Symbols\SynthesizedSymbols\SynthesizedDelegateMethodSymbol.vb (1)
93''' Gets the <see cref="ISymbol" /> for the immediately containing symbol.
Symbols\TypeSymbol.vb (2)
528Private Function ITypeSymbol_FindImplementationForInterfaceMember(interfaceMember As ISymbol) As ISymbol Implements ITypeSymbol.FindImplementationForInterfaceMember
VisualBasicExtensions.vb (13)
523Public Function IsShared(symbol As ISymbol) As Boolean 528Public Function IsOverrides(symbol As ISymbol) As Boolean 533Public Function IsOverridable(symbol As ISymbol) As Boolean 538Public Function IsNotOverridable(symbol As ISymbol) As Boolean 543Public Function IsMustOverride(symbol As ISymbol) As Boolean 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 1527Public Function GetMemberGroup(semanticModel As SemanticModel, expression As ExpressionSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 1532Return ImmutableArray.Create(Of ISymbol) 1540Public Function GetSpeculativeMemberGroup(semanticModel As SemanticModel, position As Integer, expression As ExpressionSyntax) As ImmutableArray(Of ISymbol) 1545Return ImmutableArray.Create(Of ISymbol) 1553Public Function GetMemberGroup(semanticModel As SemanticModel, attribute As AttributeSyntax, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 1558Return ImmutableArray.Create(Of ISymbol)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (16)
ExpressionSyntaxExtensions.vb (1)
450Private Function CanReplace(symbol As ISymbol) As Boolean
InvocationExpressionSyntaxExtensions.vb (1)
49Dim symbol As ISymbol = semanticModel.GetSymbolInfo(invocationExpression.Expression).Symbol
SemanticModelExtensions.vb (3)
32cancellationToken As CancellationToken) As IList(Of ISymbol) 38Return SpecializedCollections.EmptyList(Of ISymbol)() 45cancellationToken As CancellationToken) As IList(Of ISymbol)
VisualBasicNamingStyleDiagnosticAnalyzer.vb (1)
21Protected Overrides Function ShouldIgnore(symbol As ISymbol) As Boolean
VisualBasicQualifyMemberAccessDiagnosticAnalyzer.vb (1)
26Protected Overrides Function CanMemberAccessBeQualified(containingSymbol As ISymbol, node As SyntaxNode) As Boolean
VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (2)
14Protected Overrides Sub HandleNamedTypeSymbolStart(context As SymbolStartAnalysisContext, onSymbolUsageFound As Action(Of ISymbol, ValueUsageInfo)) 37Private Shared Sub AnalyzeHandlesClause(context As SyntaxNodeAnalysisContext, onSymbolUsageFound As Action(Of ISymbol, ValueUsageInfo))
VisualBasicSemanticFacts.vb (7)
64Public Function GetDeclaredSymbol(semanticModel As SemanticModel, token As SyntaxToken, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.GetDeclaredSymbol 223Public Function GetDeclaredSymbols(semanticModel As SemanticModel, memberDeclaration As SyntaxNode, cancellationToken As CancellationToken) As IEnumerable(Of ISymbol) Implements ISemanticFacts.GetDeclaredSymbols 241Public Function FindFieldOrPropertyForArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForArgument 256Public Function FindFieldOrPropertyForAttributeArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForAttributeArgument 260Public Function GetBestOrAllSymbols(semanticModel As SemanticModel, node As SyntaxNode, token As SyntaxToken, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) Implements ISemanticFacts.GetBestOrAllSymbols 262ImmutableArray(Of ISymbol).Empty, 270Public Function GetLocalFunctionSymbols(compilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As ImmutableArray(Of IMethodSymbol) Implements ISemanticFacts.GetLocalFunctionSymbols
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (15)
ExpressionSyntaxGeneratorVisitor.vb (3)
22Public Overrides Function DefaultVisit(symbol As ISymbol) As ExpressionSyntax 26Private Shared Function AddInformationTo(Of TExpressionSyntax As ExpressionSyntax)(expression As TExpressionSyntax, symbol As ISymbol) As TExpressionSyntax 74Private Shared Function CreateMemberAccessExpression(symbol As ISymbol, container As ExpressionSyntax, simpleName As SimpleNameSyntax) As ExpressionSyntax
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb\SymbolExtensions.vb (2)
11Public Function IsMyNamespace(symbol As ISymbol, compilation As Compilation) As Boolean 23Public Function IsMyFormsProperty(symbol As ISymbol, compilation As Compilation) As Boolean
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb\SymbolExtensions.vb (2)
10Public Function FindRelatedExplicitlyDeclaredSymbol(symbol As ISymbol, compilation As Compilation) As ISymbol
StringExtensions.vb (2)
34Public Function EscapeIdentifier(text As String, Optional afterDot As Boolean = False, Optional symbol As ISymbol = Nothing, Optional withinAsyncMethod As Boolean = False) As String 61Public Function ToIdentifierToken(text As String, Optional afterDot As Boolean = False, Optional symbol As ISymbol = Nothing, Optional withinAsyncMethod As Boolean = False) As SyntaxToken
TypeSyntaxGeneratorVisitor.vb (2)
27Public Overrides Function DefaultVisit(node As ISymbol) As TypeSyntax 31Private Shared Function AddInformationTo(Of TTypeSyntax As TypeSyntax)(type As TTypeSyntax, symbol As ISymbol) As TTypeSyntax
VisualBasicSemanticFactsService.vb (1)
126Private Function ISemanticFactsService_GenerateUniqueName(semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, filter As Func(Of ISymbol, Boolean), usedNames As IEnumerable(Of String), cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueName
VisualBasicSymbolDeclarationService.vb (1)
26Public Function GetDeclarations(symbol As ISymbol) As ImmutableArray(Of SyntaxReference) Implements ISymbolDeclarationService.GetDeclarations
VisualBasicTypeInferenceService.TypeInferrer.vb (2)
367Private Shared Function InferTypeInArgument(argument As ArgumentSyntax, index As Integer, symbols As IEnumerable(Of ISymbol)) As IEnumerable(Of TypeInferenceInfo) 783Private Function GetDeclaredMemberSymbolFromOriginalSemanticModel(currentSemanticModel As SemanticModel, declarationInCurrentTree As DeclarationStatementSyntax) As ISymbol
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (28)
EditAndContinue\Helpers\EditingTestBase.vb (4)
68symbolProvider As Func(Of Compilation, ISymbol), 71Optional deletedSymbolContainerProvider As Func(Of Compilation, ISymbol) = Nothing) As SemanticEditDescription 82symbolProvider As Func(Of Compilation, ISymbol), 85Optional deletedSymbolContainerProvider As Func(Of Compilation, ISymbol) = Nothing) As SemanticEditDescription
EditAndContinue\Helpers\VisualBasicEditAndContinueTestHelpers.vb (1)
47Public Overrides Function GetDeclarators(method As ISymbol) As ImmutableArray(Of SyntaxNode)
SymbolId\SymbolKeyCompilationsTests.vb (2)
260Dim sym1 As ISymbol = comp1.Assembly 261Dim sym2 As ISymbol = comp2.Assembly
SymbolId\SymbolKeyTestBase.vb (21)
33Friend Shared Sub ResolveAndVerifySymbolList(newSymbols As IEnumerable(Of ISymbol), newCompilation As Compilation, originalSymbols As IEnumerable(Of ISymbol), originalCompilation As Compilation) 52Friend Shared Sub ResolveAndVerifySymbol(node As ExpressionSyntax, sourceSymbol As ISymbol, model As SemanticModel, sourceComp As Compilation, Optional comparison As SymbolIdComparison = SymbolIdComparison.IgnoreCase) 63Friend Shared Sub ResolveAndVerifySymbol(symbol1 As ISymbol, symbol2 As ISymbol, compilation2 As Compilation, Optional comparison As SymbolIdComparison = SymbolIdComparison.IgnoreCase) 73Friend Shared Function ResolveSymbol(originalSymbol As ISymbol, targetCompilation As Compilation, comparison As SymbolIdComparison) As ISymbol 87Friend Shared Sub AssertSymbolsIdsEqual(symbol1 As ISymbol, symbol2 As ISymbol, comparison As SymbolIdComparison, Optional expectEqual As Boolean = True) 125Friend Shared Function GetSourceSymbols(comp As VisualBasicCompilation, category As SymbolCategory) As IEnumerable(Of ISymbol) 172Friend Shared Function GetSourceSymbols(compilation As VisualBasicCompilation, includeLocals As Boolean) As IList(Of ISymbol) 174Dim list = New List(Of ISymbol)() 185Private Shared Sub GetSourceAliasSymbols(comp As VisualBasicCompilation, list As List(Of ISymbol)) 198Private Shared Sub GetSourceMemberSymbols(symbol As INamespaceOrTypeSymbol, list As List(Of ISymbol), localDumper As LocalSymbolDumper) 232Public Sub GetLocalSymbols(symbol As IFieldSymbol, list As List(Of ISymbol)) 250Public Sub GetLocalSymbols(symbol As IMethodSymbol, list As List(Of ISymbol)) 276Private Shared Sub GetLocalAndType(df As DataFlowAnalysis, list As List(Of ISymbol)) 278For Each v As ISymbol In df.VariablesDeclared 287Private Shared Sub GetLabelSymbols(body As MethodBlockSyntax, model As SemanticModel, list As List(Of ISymbol)) 297Private Shared Sub GetAnonymousTypeAndFuncSymbols(body As MethodBlockSyntax, model As SemanticModel, list As List(Of ISymbol)) 311Private Shared Sub GetAnonymousExprSymbols(expr As ExpressionSyntax, model As SemanticModel, list As List(Of ISymbol))
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Emit\EditAndContinue\EditAndContinueTests.vb (1)
5325Dim allAddedSymbols = New ISymbol() {mA1, mX1}
Microsoft.CodeAnalysis.VisualBasic.Features (172)
ChangeSignature\VisualBasicChangeSignatureService.vb (11)
99cancellationToken As CancellationToken) As Task(Of (symbol As ISymbol, selectedIndex As Integer)) 204cancellationToken As CancellationToken) As ISymbol 275declarationSymbol As ISymbol, 489declarationSymbol As ISymbol, 558declarationSymbol As ISymbol, 608declarationSymbol As ISymbol, 633Private Function VerifyAndPermuteParamNodes(paramNodes As ImmutableArray(Of XmlElementSyntax), declarationSymbol As ISymbol, updatedSignature As SignatureChange) As ImmutableArray(Of SyntaxNode) 686cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of ISymbol)) 694Dim results = ArrayBuilder(Of ISymbol).GetInstance() 699Dim convertedType As ISymbol = semanticModel.GetTypeInfo(u, cancellationToken).ConvertedType 789Protected Overrides Function GetParameters(declarationSymbol As ISymbol) As ImmutableArray(Of IParameterSymbol)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (1)
158Private Shared Function GetEnclosingBlockKinds(enclosingblocks As IEnumerable(Of SyntaxNode), enclosingDeclaration As ISymbol) As IEnumerable(Of SyntaxKind)
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (4)
118targetSymbol As ISymbol, 153targetSymbol As ISymbol, 166targetSymbol As ISymbol, 177Private Shared Function CreateAttributeArguments(targetSymbol As ISymbol, diagnostic As Diagnostic, isAssemblyAttribute As Boolean) As ArgumentListSyntax
CodeLens\VisualBasicDisplayInfoService.vb (3)
66Private Shared Function SymbolToDisplayString(symbol As ISymbol) As String 97Private Shared Function IsAccessorForDefaultProperty(symbol As ISymbol) As Boolean 124Dim symbol As ISymbol = semanticModel.GetDeclaredSymbol(node)
Completion\CompletionProviders\CompletionListTagCompletionProvider.vb (2)
59For Each member In completionListType.GetAccessibleMembersInThisAndBaseTypes(Of ISymbol)(within) 86Protected Overrides Function GetDisplayAndSuffixAndInsertionText(symbol As ISymbol, context As VisualBasicSyntaxContext) As (displayText As String, suffix As String, insertionText As String)
Completion\CompletionProviders\CompletionUtilities.vb (4)
82symbol As ISymbol, 97Private Function GetDisplayText(name As String, symbol As ISymbol) As String 105Private Function GetSuffix(symbol As ISymbol) As String 115Private Function GetInsertionText(name As String, symbol As ISymbol, context As SyntaxContext) As String
Completion\CompletionProviders\CrefCompletionProvider.vb (6)
100Protected Overrides Async Function GetSymbolsAsync(document As Document, position As Integer, options As CompletionOptions, cancellationToken As CancellationToken) As Task(Of (SyntaxToken, SemanticModel, ImmutableArray(Of ISymbol))) 164Private Overloads Shared Function GetSymbols(token As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As IEnumerable(Of ISymbol) 173Return SpecializedCollections.EmptyEnumerable(Of ISymbol) 176Private Shared Iterator Function GetQualifiedSymbols(qualifiedName As QualifiedNameSyntax, token As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken) As IEnumerable(Of ISymbol) 198symbols As IEnumerable(Of ISymbol), position As Integer) As IEnumerable(Of CompletionItem) 213symbol As ISymbol, position As Integer, builder As StringBuilder) As CompletionItem
Completion\CompletionProviders\EnumCompletionProvider.vb (2)
90Private Shared Function GetTypeFromSymbol(symbol As ISymbol) As ITypeSymbol 104Protected Overrides Function GetDisplayAndSuffixAndInsertionText(symbol As ISymbol, context As VisualBasicSyntaxContext) As (displayText As String, suffix As String, insertionText As String)
Completion\CompletionProviders\HandlesClauseCompletionProvider.vb (11)
46Private Overloads Shared Function GetSymbolsAsync(context As VisualBasicSyntaxContext, position As Integer, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of ISymbol)) 49Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 53Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 67Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 79) As ImmutableArray(Of ISymbol) 90Return ImmutableArray(Of ISymbol).Empty 102) As ImmutableArray(Of ISymbol) 114Return ImmutableArray(Of ISymbol).Empty 142Return ImmutableArray(Of ISymbol).CastUp(result) 145Private Shared Function IsWithEvents(s As ISymbol) As Boolean 155symbol As ISymbol, context As VisualBasicSyntaxContext) As (displayText As String, suffix As String, insertionText As String)
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (31)
58context As VisualBasicSyntaxContext, position As Integer, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of ISymbol)) 60Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 65Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 87Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 90Dim result = ImmutableArray(Of ISymbol).Empty 109Return SpecializedTasks.EmptyImmutableArray(Of ISymbol)() 112Private Shared Function MatchesMemberKind(symbol As ISymbol, memberKindKeyword As SyntaxKind) As Boolean 138Private Function GetDottedMembers(position As Integer, qualifiedName As QualifiedNameSyntax, semanticModel As SemanticModel, memberKindKeyword As SyntaxKind, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) 141Return ImmutableArray(Of ISymbol).Empty 152Dim interfacesAndContainers = New HashSet(Of ISymbol)(interfaces) 174Return ImmutableArray(Of ISymbol).Empty 179Dim hashSet = New HashSet(Of ISymbol)(symbols.ToArray() _ 180.Where(Function(s As ISymbol) interfacesAndContainers.Contains(s, SymbolEquivalenceComparer.Instance) OrElse 186Private Function interfaceMemberGetter([interface] As ITypeSymbol, within As ISymbol) As ImmutableArray(Of ISymbol) 187Return ImmutableArray.CreateRange(Of ISymbol)([interface].AllInterfaces.SelectMany(Function(i) i.GetMembers()).Where(Function(s) s.IsAccessibleWithin(within))) _ 191Private Function GetInterfacesAndContainers(position As Integer, node As SyntaxNode, semanticModel As SemanticModel, kind As SyntaxKind, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) 194Return ImmutableArray(Of ISymbol).Empty 201Dim interfacesAndContainers = New HashSet(Of ISymbol)(interfaceWithUnimplementedMembers) 206Dim symbols = New HashSet(Of ISymbol)(semanticModel.LookupSymbols(position)) 215Dim defaultListing = New List(Of ISymbol)(containingType.Interfaces) 228Private Sub AddAliasesAndContainers(symbol As ISymbol, interfacesAndContainers As ICollection(Of ISymbol), node As SyntaxNode, semanticModel As SemanticModel) 246Private Shared Sub AddAlias(symbol As ISymbol, interfacesAndContainers As ICollection(Of ISymbol), node As SyntaxNode, semanticModel As SemanticModel) 255Private Shared Function IsGlobal(containingSymbol As ISymbol) As Boolean 260Private Shared Function TryAddGlobalTo(symbols As ImmutableArray(Of ISymbol)) As ImmutableArray(Of ISymbol) 263Return symbols.Concat(ImmutableArray.Create(Of ISymbol)(withGlobalContainer.ContainingNamespace)) 278Protected Overrides Function GetDisplayAndSuffixAndInsertionText(symbol As ISymbol, context As VisualBasicSyntaxContext) As (displayText As String, suffix As String, insertionText As String) 291Private Shared Function IsGenericType(symbol As ISymbol) As Boolean
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (10)
114Private Shared Function IsValid(parameterList As ImmutableArray(Of ISymbol), existingNamedParameters As ISet(Of String)) As Boolean 133cancellationToken As CancellationToken) As IEnumerable(Of ImmutableArray(Of ISymbol)) 143cancellationToken As CancellationToken) As IEnumerable(Of ImmutableArray(Of ISymbol)) 149Select(Function(c) c.Parameters.As(Of ISymbol)()) 158cancellationToken As CancellationToken) As IEnumerable(Of ImmutableArray(Of ISymbol)) 170cancellationToken As CancellationToken) As IEnumerable(Of ImmutableArray(Of ISymbol)) 182Dim methodParameters = accessibleMembers.OfType(Of IMethodSymbol).Select(Function(m) m.Parameters.As(Of ISymbol)()) 183Dim propertyParameters = accessibleMembers.OfType(Of IPropertySymbol).Select(Function(p) p.Parameters.As(Of ISymbol)()) 187Return SpecializedCollections.SingletonEnumerable(delegateType.DelegateInvokeMethod.Parameters.As(Of ISymbol)()) 190Select(Function(i) i.Parameters.As(Of ISymbol)())
Completion\CompletionProviders\ObjectCreationCompletionProvider.vb (1)
69Protected Overrides Function GetDisplayAndSuffixAndInsertionText(symbol As ISymbol, context As VisualBasicSyntaxContext) As (displayText As String, suffix As String, insertionText As String)
Completion\CompletionProviders\ObjectInitializerCompletionProvider.vb (3)
110Protected Overrides Function IsInitializable(member As ISymbol, containingType As INamedTypeSymbol) As Boolean 118Protected Overrides Function EscapeIdentifier(symbol As ISymbol) As String 122Private Shared Function IsValidProperty(member As ISymbol) As Boolean
Completion\CompletionProviders\OverrideCompletionProvider.vb (4)
156Public Overrides Function FilterOverrides(members As ImmutableArray(Of ISymbol), 157returnType As ITypeSymbol) As ImmutableArray(Of ISymbol) 168Return ImmutableArray(Of ISymbol).CastUp(filteredMembers.ToImmutableArray()) 180Return ImmutableArray(Of ISymbol).CastUp(filteredMembers.ToImmutableArray())
Completion\CompletionProviders\SymbolCompletionProvider.vb (3)
98Protected Overrides Function GetDisplayAndSuffixAndInsertionText(symbol As ISymbol, context As VisualBasicSyntaxContext) As (displayText As String, suffix As String, insertionText As String) 102Protected Overrides Function GetFilterText(symbol As ISymbol, displayText As String, context As VisualBasicSyntaxContext) As String 117Protected Overrides Function IsInstrinsic(s As ISymbol) As Boolean
Completion\CompletionProviders\XmlDocCommentCompletionProvider.vb (3)
105Dim symbol As ISymbol = Nothing 216symbol As ISymbol) 347Protected Overrides Function GetParameters(symbol As ISymbol) As ImmutableArray(Of IParameterSymbol)
Debugging\BreakpointResolver.vb (1)
21Protected Overrides Function GetMembers(type As INamedTypeSymbol, name As String) As IEnumerable(Of ISymbol)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (29)
213Protected Overrides Function GetCapturedVariables(model As SemanticModel, memberBody As SyntaxNode) As ImmutableArray(Of ISymbol) 217Return ImmutableArray(Of ISymbol).Empty 259Friend Overrides Function HasParameterClosureScope(member As ISymbol) As Boolean 263Protected Overrides Function GetVariableUseSites(roots As IEnumerable(Of SyntaxNode), localOrParameter As ISymbol, model As SemanticModel, cancellationToken As CancellationToken) As IEnumerable(Of SyntaxNode) 1267cancellationToken As CancellationToken) As OneOrMany(Of (oldSymbol As ISymbol, newSymbol As ISymbol, editKind As EditKind)) 1269Dim oldSymbols As OneOrMany(Of ISymbol) = Nothing 1270Dim newSymbols As OneOrMany(Of ISymbol) = Nothing 1283Return OneOrMany(Of (ISymbol, ISymbol, EditKind)).Empty 1288Return OneOrMany(Of (ISymbol, ISymbol, EditKind)).Empty 1294Return OneOrMany(Of (ISymbol, ISymbol, EditKind)).Empty 1297Return oldSymbols.Select(Function(s) New ValueTuple(Of ISymbol, ISymbol, EditKind)(s, Nothing, editKind)) 1301Return OneOrMany(Of (ISymbol, ISymbol, EditKind)).Empty 1304Return newSymbols.Select(Function(s) New ValueTuple(Of ISymbol, ISymbol, EditKind)(Nothing, s, editKind)) 1309Return OneOrMany(Of (ISymbol, ISymbol, EditKind)).Empty 1319Dim builder = ArrayBuilder(Of (ISymbol, ISymbol, EditKind)).GetInstance() 1336Return OneOrMany(Of (ISymbol, ISymbol, EditKind)).Empty 1351<Out> ByRef symbols As OneOrMany(Of ISymbol), 2453Friend Overrides Sub ReportInsertedMemberSymbolRudeEdits(diagnostics As ArrayBuilder(Of RudeEditDiagnostic), newSymbol As ISymbol, newNode As SyntaxNode, insertingIntoExistingContainingType As Boolean) 2465Private Shared Function GetInsertedMemberSymbolRudeEditKind(newSymbol As ISymbol, insertingIntoExistingContainingType As Boolean) As RudeEditKind
EncapsulateField\VisualBasicEncapsulateFieldService.vb (2)
116Dim containingTypeMemberNames = field.ContainingType.GetAccessibleMembersInThisAndBaseTypes(Of ISymbol)(field.ContainingType).Select(Function(s) s.Name) 129Dim containingTypeMemberNames = field.ContainingType.GetAccessibleMembersInThisAndBaseTypes(Of ISymbol)(field.ContainingType).Select(Function(s) s.Name)
ExtractInterface\VisualBasicExtractInterfaceService.vb (2)
101typeToExtractFrom As INamedTypeSymbol, includedMembers As IEnumerable(Of ISymbol), 102symbolToDeclarationAnnotationMap As ImmutableDictionary(Of ISymbol, SyntaxAnnotation), cancellationToken As CancellationToken) As Task(Of Solution)
ExtractMethod\Extensions.vb (1)
363Public Function IsFunctionValue(symbol As ISymbol) As Boolean
ExtractMethod\VisualBasicMethodExtractor.Analyzer.vb (1)
30compilation As Compilation, symbol As ISymbol,
ExtractMethod\VisualBasicSelectionResult.vb (1)
208Private Shared Function IsCoClassImplicitConversion(info As TypeInfo, conversion As Conversion, coclassSymbol As ISymbol) As Boolean
GenerateMember\GenerateParameterizedMember\VisualBasicCommonGenerationServiceMethods.vb (1)
28Public Shared Function IsValidSymbol(symbol As ISymbol, semanticModel As SemanticModel) As Boolean
GenerateMember\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
51Protected Overrides Function IsValidSymbol(symbol As ISymbol, semanticModel As SemanticModel) As Boolean
GenerateMember\GenerateParameterizedMember\VisualBasicGenerateMethodService.vb (1)
36Protected Overrides Function IsValidSymbol(symbol As ISymbol, semanticModel As SemanticModel) As Boolean
GoToDefinition\VisualBasicGoToDefinitionSymbolService.vb (2)
21Protected Overrides Function FindRelatedExplicitlyDeclaredSymbol(symbol As ISymbol, compilation As Compilation) As ISymbol
InitializeParameter\VisualBasicInitializeMemberFromParameterCodeRefactoringProvider.vb (1)
85Protected Overrides Function TryUpdateTupleAssignment(blockStatement As IBlockOperation, parameter As IParameterSymbol, fieldOrProperty As ISymbol, editor As SyntaxEditor) As Boolean
LanguageServices\VisualBasicSymbolDisplayService.SymbolDescriptionBuilder.vb (6)
78Protected Overrides Function GetInitializerSourcePartsAsync(symbol As ISymbol) As Task(Of ImmutableArray(Of SymbolDisplayPart)) 90Protected Overrides Function ToMinimalDisplayParts(symbol As ISymbol, semanticModel As SemanticModel, position As Integer, format As SymbolDisplayFormat) As ImmutableArray(Of SymbolDisplayPart) 94Protected Overrides Function GetNavigationHint(symbol As ISymbol) As String 98Private Async Function GetFirstDeclarationAsync(Of T As SyntaxNode)(symbol As ISymbol) As Task(Of T) 110Private Async Function GetDeclarationsAsync(Of T As SyntaxNode)(symbol As ISymbol) As Task(Of List(Of T)) 169Protected Overrides Sub AddCaptures(symbol As ISymbol)
MetadataAsSource\VisualBasicMetadataAsSourceService.vb (1)
27Protected Overrides Async Function AddAssemblyInfoRegionAsync(document As Document, symbolCompilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As Task(Of Document)
NavigationBar\VisualBasicNavigationBarItemService.vb (3)
183member As ISymbol, 269Private Shared Function IncludeMember(symbol As ISymbol) As Boolean 391members As IEnumerable(Of ISymbol),
QuickInfo\VisualBasicSemanticQuickInfoProvider.vb (1)
176Function(n) As ISymbol
Rename\VisualBasicRenameIssuesService.vb (1)
19Public Function CheckLanguageSpecificIssues(semantic As SemanticModel, symbol As ISymbol, triggerToken As SyntaxToken, <NotNullWhen(True)> ByRef langError As String) As Boolean Implements IRenameIssuesService.CheckLanguageSpecificIssues
SignatureHelp\AbstractOrdinaryMethodSignatureHelpProvider.vb (3)
14member As ISymbol, 32Private Shared Function GetMemberGroupPreambleParts(symbol As ISymbol, semanticModel As SemanticModel, position As Integer) As IList(Of SymbolDisplayPart) 50Private Shared Function GetMemberGroupPostambleParts(symbol As ISymbol,
SignatureHelp\AbstractVisualBasicSignatureHelpProvider.vb (1)
51Protected Shared Sub AddExtensionPreamble(symbol As ISymbol, result As IList(Of SymbolDisplayPart))
SignatureHelp\AttributeSignatureHelpProvider.vb (2)
107within As ISymbol, 135namedParameters As List(Of ISymbol),
SignatureHelp\GenericNameSignatureHelpProvider.vb (1)
117Private Overloads Shared Function Convert(symbol As ISymbol, genericName As GenericNameSyntax, semanticModel As SemanticModel, structuralTypeDisplayService As IStructuralTypeDisplayService, documentationCommentFormattingService As IDocumentationCommentFormattingService) As SignatureHelpItem
SignatureHelp\InvocationExpressionSignatureHelpProvider.ElementAccess.vb (1)
19within As ISymbol,
SignatureHelp\InvocationExpressionSignatureHelpProvider.MemberGroup.vb (4)
16within As ISymbol, 17memberGroup As IEnumerable(Of ISymbol), 18cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) 38Private Shared Function GetMemberGroupItems(accessibleMembers As ImmutableArray(Of ISymbol),
SignatureHelp\InvocationExpressionSignatureHelpProvider.vb (1)
119Dim accessibleMembers = ImmutableArray(Of ISymbol).Empty
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.NormalType.vb (1)
22within As ISymbol,
VisualBasicNamingStyleDiagnosticAnalyzer.vb (1)
21Protected Overrides Function ShouldIgnore(symbol As ISymbol) As Boolean
VisualBasicQualifyMemberAccessDiagnosticAnalyzer.vb (1)
26Protected Overrides Function CanMemberAccessBeQualified(containingSymbol As ISymbol, node As SyntaxNode) As Boolean
VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (2)
14Protected Overrides Sub HandleNamedTypeSymbolStart(context As SymbolStartAnalysisContext, onSymbolUsageFound As Action(Of ISymbol, ValueUsageInfo)) 37Private Shared Sub AnalyzeHandlesClause(context As SyntaxNodeAnalysisContext, onSymbolUsageFound As Action(Of ISymbol, ValueUsageInfo))
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (1)
InteractiveSessionTests.vb (1)
156Function lookupMember(c As Compilation, typeName As String, memberName As String) As ISymbol
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (79)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (3)
907ByRef syntax As MethodBaseSyntax) As ISymbol 1897ByRef syntax As ModifiedIdentifierSyntax) As ISymbol 2628Assert.Equal(Of ISymbol)(nsSymbolA, memSymbol)
Compilation\SemanticModelLookupSymbolsAPITests.vb (1)
349Private Shared Sub CheckSymbols(symbols As ImmutableArray(Of ISymbol), ParamArray descriptions As String())
Diagnostics\DiagnosticAnalyzerTests.vb (2)
1615Private Shared Sub verifyFlowGraphs(compilation As Compilation, flowGraphs As ImmutableArray(Of (Graph As ControlFlowGraph, AssociatedSymbol As ISymbol)), expectedFlowGraphs As String()) 1618Dim actualFlowGraphAndSymbol As (Graph As ControlFlowGraph, AssociatedSymbol As ISymbol) = flowGraphs(i)
Diagnostics\GetDiagnosticsTests.vb (1)
655Private Sub AnalyzeNode(node As SyntaxNode, containingSymbol As ISymbol, reportDiagnostic As Action(Of Diagnostic))
FlowAnalysis\FlowTestBase.vb (1)
105Protected Shared Function GetSymbolNamesJoined(Of T As ISymbol)(symbols As IEnumerable(Of T)) As String
Semantics\ForeachTest.vb (13)
1161Assert.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerable__GetEnumerator), loopInfo.GetEnumeratorMethod) 1162Assert.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__Current), loopInfo.CurrentProperty) 1163Assert.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__MoveNext), loopInfo.MoveNextMethod) 1164Assert.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_IDisposable__Dispose), loopInfo.DisposeMethod) 1201Assert.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerable__GetEnumerator), loopInfo.GetEnumeratorMethod) 1202Assert.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__Current), loopInfo.CurrentProperty) 1203Assert.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__MoveNext), loopInfo.MoveNextMethod) 1204Assert.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_IDisposable__Dispose), loopInfo.DisposeMethod) 1257Assert.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__Current), loopInfo0.CurrentProperty) 1258Assert.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerator__MoveNext), loopInfo0.MoveNextMethod) 1259Assert.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_IDisposable__Dispose), loopInfo0.DisposeMethod) 1265Assert.Equal(Of ISymbol)(comp.GetSpecialTypeMember(SpecialMember.System_Collections_IEnumerable__GetEnumerator), loopInfo1.GetEnumeratorMethod) ' No longer using System.Array method. 1381Private Function GetSymbolNamesSortedAndJoined(Of T As ISymbol)(symbols As IEnumerable(Of T)) As String
Semantics\ForLoopTest.vb (1)
650Private Function GetSymbolNamesSortedAndJoined(Of T As ISymbol)(symbols As IEnumerable(Of T)) As String
Semantics\GetExtendedSemanticInfoTests.vb (2)
9182Dim sortedMethodGroup As ISymbol() = memberGroup.AsEnumerable().OrderBy(Function(s) s.ToTestDisplayString()).ToArray() 9375Dim sortedMethodGroup As ISymbol() = memberGroup.AsEnumerable().OrderBy(Function(s) s.ToTestDisplayString()).ToArray()
Semantics\GotoTests.vb (9)
210Assert.Equal(Of ISymbol)(declaredSymbol, semanticSummary.Symbol) 241Assert.Equal(Of ISymbol)(declaredSymbol0, semanticSummary0.Symbol) 250Assert.Equal(Of ISymbol)(declaredSymbol0, semanticSummary1.Symbol) 284Assert.Equal(Of ISymbol)(declaredSymbol, semanticSummary.Symbol) 318Assert.NotEqual(Of ISymbol)(declaredSymbolOuter, semanticSummary.Symbol) 319Assert.Equal(Of ISymbol)(declaredSymbolInner, semanticSummary.Symbol) 357Assert.Equal(Of ISymbol)(declaredSymbol, semanticSummary.Symbol) 393Assert.Equal(Of ISymbol)(declaredSymbol, semanticSummary.Symbol) 427Assert.Equal(Of ISymbol)(declaredSymbol, semanticSummary.Symbol)
Semantics\IFOperatorTest.vb (1)
1235Private Function GetSymbolNamesSortedAndJoined(Of T As ISymbol)(symbols As IEnumerable(Of T)) As String
Semantics\MeMyBaseMyClassTests.vb (2)
544Public Function LookUpSymbolTest(comp As VisualBasicCompilation, name As String, Optional index As Integer = 1, Optional expectedCount As Integer = 0, Optional expectedString As String = "") As ISymbol 561Public Sub GetSymbolInfoTest(comp As VisualBasicCompilation, nodeName As String, expectedSymbol As ISymbol)
Semantics\MultiDimensionalTest.vb (2)
321Private Function GetDeclareSymbolTest(compilation As VisualBasicCompilation, expectedSymbolName As String, Optional index As Integer = 1) As ISymbol 368Private Function GetSymbolNamesSortedAndJoined(Of T As ISymbol)(symbols As IEnumerable(Of T)) As String
Semantics\NameOfTests.vb (39)
54Dim group As ImmutableArray(Of ISymbol) 453Dim group As ImmutableArray(Of ISymbol) 525Dim group As ImmutableArray(Of ISymbol) 609Dim group As ImmutableArray(Of ISymbol) 661Dim group As ImmutableArray(Of ISymbol) 711Dim group As ImmutableArray(Of ISymbol) 764Dim group As ImmutableArray(Of ISymbol) 814Dim group As ImmutableArray(Of ISymbol) 864Dim group As ImmutableArray(Of ISymbol) 941Dim group As ImmutableArray(Of ISymbol) 1054Dim group As ImmutableArray(Of ISymbol) 1122Dim group As ImmutableArray(Of ISymbol) 1187Dim group As ImmutableArray(Of ISymbol) 1269Dim group As ImmutableArray(Of ISymbol) 1351Dim group As ImmutableArray(Of ISymbol) 1432Dim group As ImmutableArray(Of ISymbol) 1512Dim group As ImmutableArray(Of ISymbol) 1643Dim group As ImmutableArray(Of ISymbol) 1736Dim group As ImmutableArray(Of ISymbol) 1793Dim group As ImmutableArray(Of ISymbol) 1850Dim group As ImmutableArray(Of ISymbol) 1907Dim group As ImmutableArray(Of ISymbol) 2049Dim group As ImmutableArray(Of ISymbol) 2148Dim group As ImmutableArray(Of ISymbol) 2249Dim group As ImmutableArray(Of ISymbol) 2355Dim group As ImmutableArray(Of ISymbol) 2459Dim group As ImmutableArray(Of ISymbol) 2792Dim group As ImmutableArray(Of ISymbol) 2867Dim group As ImmutableArray(Of ISymbol) 2932Dim group As ImmutableArray(Of ISymbol) 2995Dim group As ImmutableArray(Of ISymbol) 3056Dim group As ImmutableArray(Of ISymbol) 3117Dim group As ImmutableArray(Of ISymbol) 3177Dim group As ImmutableArray(Of ISymbol) 3240Dim group As ImmutableArray(Of ISymbol) 3301Dim group As ImmutableArray(Of ISymbol) 3358Dim group As ImmutableArray(Of ISymbol) 3417Dim group As ImmutableArray(Of ISymbol) 3473Dim group As ImmutableArray(Of ISymbol)
Semantics\UsingStatementTest.vb (2)
317Private Function VerifyDeclaredSymbolForUsingStatements(compilation As VisualBasicCompilation, index As Integer, ParamArray variables As String()) As List(Of ISymbol) 323Dim symbols = New List(Of ISymbol)()
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (11)
DocumentationComments\DocCommentTests.vb (7)
4996Array.Sort(list, Function(x As ISymbol, y As ISymbol) compilation.CompareSourceLocations(x.Locations(0), y.Locations(0))) 11941Private Shared Function FilterOfSymbolKindOnly(symbols As ImmutableArray(Of ISymbol), ParamArray kinds() As SymbolKind) As ImmutableArray(Of ISymbol) 11948Private Shared Sub AssertLookupResult(actual As ImmutableArray(Of ISymbol), ParamArray expected() As String) 11952Private Function CheckSymbolInfoOnly(model As SemanticModel, syntax As ExpressionSyntax, ParamArray expected() As String) As ImmutableArray(Of ISymbol) 12071Private Sub TestSymbolAndTypeInfoForType(model As SemanticModel, syntax As TypeSyntax, expected As ISymbol)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (2)
147Assert.Equal(Of ISymbol)(localType, symbol) 179Assert.Equal(Of ISymbol)(member, propSymbol)
SymbolsTests\Source\BindingsTests.vb (2)
456Dim symbols As ImmutableArray(Of ISymbol) 492Assert.Equal(Of ISymbol)(importsYellowSymInfo.Type, symbol)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (2)
Syntax\GeneratedTests.vb (1)
86Public Overrides Function GetErrorDisplayString(symbol As ISymbol) As String
TestSyntaxNodes.vb (1)
1099Public Overrides Function GetErrorDisplayString(symbol As ISymbol) As String
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (14)
BasicTestBase.vb (1)
831Dim graphAndSymbol As (Graph As FlowAnalysis.ControlFlowGraph, AssociatedSymbol As ISymbol) = ControlFlowGraphVerifier.GetControlFlowGraph(syntaxNode, model)
CompilationTestUtils.vb (11)
513Public CandidateSymbols As ImmutableArray(Of ISymbol) = ImmutableArray.Create(Of ISymbol)() 514Public AllSymbols As ImmutableArray(Of ISymbol) = ImmutableArray.Create(Of ISymbol)() 518Public MemberGroup As ImmutableArray(Of ISymbol) = ImmutableArray.Create(Of ISymbol)() 1182Public Function VerifyIsGlobal(globalNS1 As ISymbol, Optional expected As Boolean = True) As NamespaceSymbol 1193Public Sub CheckSymbols(Of TSymbol As ISymbol)(symbols As ImmutableArray(Of TSymbol), ParamArray descriptions As String()) 1205Public Sub CheckSymbols(Of TSymbol As ISymbol)(symbols As TSymbol(), ParamArray descriptions As String()) 1209Public Sub CheckSymbol(symbol As ISymbol, description As String) 1227Public Sub CheckSymbolsUnordered(Of TSymbol As ISymbol)(symbols As ImmutableArray(Of TSymbol), ParamArray descriptions As String())
SemanticModelTestBase.vb (2)
88Protected Function GetStartSpanErrorMessage(syntax As SyntaxNode, tpSymbol As ISymbol) As String 126Friend Function GetLookupSymbols(compilation As Compilation, filename As String, Optional container As NamespaceOrTypeSymbol = Nothing, Optional name As String = Nothing, Optional arity As Integer? = Nothing, Optional includeReducedExtensionMethods As Boolean = False, Optional mustBeStatic As Boolean = False) As List(Of ISymbol)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (99)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (5)
166Private Shared Function IsNamespaceOrTypeRelatedSymbol(symbol As ISymbol) As Boolean 172Private Function GetAliasOrAnySymbol(model As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol 187symbol As ISymbol, 215Private Shared Function GetCorrectedName(token As SyntaxToken, symbol As ISymbol) As String 233Private Shared Function NamesDiffer(symbol As ISymbol,
Classification\SyntaxClassification\NameSyntaxClassifier.vb (2)
98symbol As ISymbol, 153symbol As ISymbol,
CodeGeneration\NamedTypeGenerator.vb (1)
62newMembers As IList(Of ISymbol),
CodeGeneration\NamespaceGenerator.vb (2)
60newMembers As IList(Of ISymbol), 106Private Function GenerateImportsStatement(import As ISymbol) As ImportsStatementSyntax
CodeGeneration\VisualBasicCodeGenerationHelpers.vb (3)
67Public Function GenerateImplementsClause(explicitInterfaceOpt As ISymbol) As ImplementsClauseSyntax 178symbol As ISymbol, 198Public Function GetReuseableSyntaxNodeForSymbol(Of T As SyntaxNode)(symbol As ISymbol, options As CodeGenerationContextInfo) As T
CodeGeneration\VisualBasicCodeGenerationService.vb (1)
759Public Overrides Function UpdateDeclarationMembers(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newMembers As IList(Of ISymbol), options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode
CodeGeneration\VisualBasicSyntaxGenerator.vb (2)
2843explicitInterfaceImplementations As ImmutableArray(Of ISymbol), 2865Private Function GenerateInterfaceMember(method As ISymbol) As QualifiedNameSyntax
ExpressionSyntaxGeneratorVisitor.vb (3)
22Public Overrides Function DefaultVisit(symbol As ISymbol) As ExpressionSyntax 26Private Shared Function AddInformationTo(Of TExpressionSyntax As ExpressionSyntax)(expression As TExpressionSyntax, symbol As ISymbol) As TExpressionSyntax 74Private Shared Function CreateMemberAccessExpression(symbol As ISymbol, container As ExpressionSyntax, simpleName As SimpleNameSyntax) As ExpressionSyntax
FindSymbols\VisualBasicReferenceFinder.vb (7)
23symbol As ISymbol, 25cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of ISymbol)) Implements ILanguageServiceReferenceFinder.DetermineCascadedSymbolsAsync 31Return SpecializedTasks.EmptyImmutableArray(Of ISymbol) 38cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of ISymbol)) 44ImmutableArray(Of ISymbol).Empty, 51cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of ISymbol)) 66Select DirectCast(childProperty, ISymbol)
InvocationExpressionSyntaxExtensions.vb (1)
49Dim symbol As ISymbol = semanticModel.GetSymbolInfo(invocationExpression.Expression).Symbol
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb\ExpressionSyntaxExtensions.vb (1)
450Private Function CanReplace(symbol As ISymbol) As Boolean
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb\SymbolExtensions.vb (2)
11Public Function IsMyNamespace(symbol As ISymbol, compilation As Compilation) As Boolean 23Public Function IsMyFormsProperty(symbol As ISymbol, compilation As Compilation) As Boolean
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb\SymbolExtensions.vb (2)
10Public Function FindRelatedExplicitlyDeclaredSymbol(symbol As ISymbol, compilation As Compilation) As ISymbol
Recommendations\VisualBasicRecommendationServiceRunner.vb (34)
30Private Overloads Function GetSymbols() As ImmutableArray(Of ISymbol) 33Return ImmutableArray(Of ISymbol).Empty 64Return ImmutableArray(Of ISymbol).Empty 81Private Function IsWritableFieldOrLocal(symbol As ISymbol) As Boolean 95Private Function GetSymbolsForGlobalStatementContext() As ImmutableArray(Of ISymbol) 99Private Function GetUnqualifiedSymbolsForQueryIntoContext() As ImmutableArray(Of ISymbol) 103Return ImmutableArray(Of ISymbol).CastUp( 109Private Function GetUnqualifiedSymbolsForLabelContext() As ImmutableArray(Of ISymbol) 113Private Function GetUnqualifiedSymbolsForRaiseEvent() As ImmutableArray(Of ISymbol) 121Private Function GetUnqualifiedSymbolsForType() As ImmutableArray(Of ISymbol) 126Private Function GetUnqualifiedSymbolsForExpressionOrStatementContext() As ImmutableArray(Of ISymbol) 153Private Shared Function IsInEligibleDelegate(s As ISymbol) As Boolean 162Private Function GetSymbolsForQualifiedNameSyntax(node As QualifiedNameSyntax) As ImmutableArray(Of ISymbol) 170Return ImmutableArray(Of ISymbol).Empty 173Dim symbols As ImmutableArray(Of ISymbol) 191Private Function GetSymbolsForMemberAccessExpression(node As MemberAccessExpressionSyntax) As ImmutableArray(Of ISymbol) 194Return ImmutableArray(Of ISymbol).Empty 215Dim container As ISymbol = leftHandTypeInfo.Type 237Return ImmutableArray(Of ISymbol).Empty 277Return ImmutableArray(Of ISymbol).Empty 285Return ImmutableArray(Of ISymbol).Empty 300Return ImmutableArray(Of ISymbol).Empty 304Dim symbols As ImmutableArray(Of ISymbol) 356Private Function FilterEventsAndGeneratedSymbols(node As MemberAccessExpressionSyntax, s As ISymbol) As Boolean 384Private Function FilterToValidAccessibleSymbols(symbols As ImmutableArray(Of ISymbol)) As ImmutableArray(Of ISymbol) 393Dim typeOrAssemblySymbol As ISymbol = _context.SemanticModel.GetDeclaredSymbol(typeBlock, _cancellationToken) 413Return ImmutableArray(Of ISymbol).Empty 442Private Function IsValidAccessibleInterfaceOrContainer(symbol As ISymbol, within As ISymbol) As Boolean 463Private Function IsOrContainsValidAccessibleInterface(namespaceOrTypeSymbol As INamespaceOrTypeSymbol, within As ISymbol) As Boolean 483Private Function IsValidAccessibleClassOrContainer(symbol As ISymbol, within As ISymbol) As Boolean 511Private Function IsOrContainsValidAccessibleClass(namespaceOrTypeSymbol As INamespaceOrTypeSymbol, within As ISymbol) As Boolean
Rename\VisualBasicRenameRewriterLanguageService.vb (10)
50Private ReadOnly _renamedSymbol As ISymbol 483Dim symbols As IEnumerable(Of ISymbol) 676newReferencedSymbols As IEnumerable(Of ISymbol)) As Boolean 684renamedSymbol As ISymbol, 685renameSymbol As ISymbol, 686referencedSymbols As IEnumerable(Of ISymbol), 799renameSymbol As ISymbol, renamedSymbol As ISymbol, 900renamedSymbol As ISymbol, 971Public Overrides Sub TryAddPossibleNameConflicts(symbol As ISymbol, replacementText As String, possibleNameConflicts As ICollection(Of String))
SemanticModelExtensions.vb (3)
32cancellationToken As CancellationToken) As IList(Of ISymbol) 38Return SpecializedCollections.EmptyList(Of ISymbol)() 45cancellationToken As CancellationToken) As IList(Of ISymbol)
Simplification\Simplifiers\AbstractVisualBasicSimplifier.vb (1)
150Private Shared Function ValidateAliasForTarget(aliasReplacement As IAliasSymbol, semanticModel As SemanticModel, node As ExpressionSyntax, symbol As ISymbol) As Boolean
Simplification\Simplifiers\ExpressionSimplifier.vb (2)
273symbol As ISymbol, 299symbol As ISymbol,
Simplification\VisualBasicSimplificationService.Expander.vb (2)
684symbol As ISymbol) As ExpressionSyntax 705symbol As ISymbol,
StringExtensions.vb (2)
34Public Function EscapeIdentifier(text As String, Optional afterDot As Boolean = False, Optional symbol As ISymbol = Nothing, Optional withinAsyncMethod As Boolean = False) As String 61Public Function ToIdentifierToken(text As String, Optional afterDot As Boolean = False, Optional symbol As ISymbol = Nothing, Optional withinAsyncMethod As Boolean = False) As SyntaxToken
TypeSyntaxGeneratorVisitor.vb (2)
27Public Overrides Function DefaultVisit(node As ISymbol) As TypeSyntax 31Private Shared Function AddInformationTo(Of TTypeSyntax As TypeSyntax)(type As TTypeSyntax, symbol As ISymbol) As TTypeSyntax
VisualBasicSemanticFacts.vb (7)
64Public Function GetDeclaredSymbol(semanticModel As SemanticModel, token As SyntaxToken, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.GetDeclaredSymbol 223Public Function GetDeclaredSymbols(semanticModel As SemanticModel, memberDeclaration As SyntaxNode, cancellationToken As CancellationToken) As IEnumerable(Of ISymbol) Implements ISemanticFacts.GetDeclaredSymbols 241Public Function FindFieldOrPropertyForArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForArgument 256Public Function FindFieldOrPropertyForAttributeArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForAttributeArgument 260Public Function GetBestOrAllSymbols(semanticModel As SemanticModel, node As SyntaxNode, token As SyntaxToken, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) Implements ISemanticFacts.GetBestOrAllSymbols 262ImmutableArray(Of ISymbol).Empty, 270Public Function GetLocalFunctionSymbols(compilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As ImmutableArray(Of IMethodSymbol) Implements ISemanticFacts.GetLocalFunctionSymbols
VisualBasicSemanticFactsService.vb (1)
126Private Function ISemanticFactsService_GenerateUniqueName(semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, filter As Func(Of ISymbol, Boolean), usedNames As IEnumerable(Of String), cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueName
VisualBasicSymbolDeclarationService.vb (1)
26Public Function GetDeclarations(symbol As ISymbol) As ImmutableArray(Of SyntaxReference) Implements ISymbolDeclarationService.GetDeclarations
VisualBasicTypeInferenceService.TypeInferrer.vb (2)
367Private Shared Function InferTypeInArgument(argument As ArgumentSyntax, index As Integer, symbols As IEnumerable(Of ISymbol)) As IEnumerable(Of TypeInferenceInfo) 783Private Function GetDeclaredMemberSymbolFromOriginalSemanticModel(currentSemanticModel As SemanticModel, declarationInCurrentTree As DeclarationStatementSyntax) As ISymbol
Microsoft.CodeAnalysis.Workspaces (1228)
AbstractCodeGenerationService.cs (12)
66public TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) 116public TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 141public abstract TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 272IEnumerable<ISymbol> members, 295IEnumerable<ISymbol> members, 302foreach (var member in members) 326IEnumerable<ISymbol> members, 334foreach (var member in members) 343private SyntaxNode? GetNewMember(TCodeGenerationContextInfo info, CodeGenerationDestination codeGenerationDestination, ISymbol member, CancellationToken cancellationToken) 359ISymbol member, 374private static bool GeneratingEnum(IEnumerable<ISymbol> members) 456public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
AbstractCodeGenerationService_FindDeclaration.cs (1)
24public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken)
AbstractFlagsEnumGenerator.cs (1)
49var containingSymbol = type.ContainingSymbol;
AbstractSemanticFactsService.cs (10)
30private static readonly Func<ISymbol, bool> s_LocalNameFilter = s => 73string baseName, Func<ISymbol, bool> filter, 90protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken) 113var impl = type.FindImplementationForInterfaceMember(methodToLookFor) ?? methodToLookFor; 151public ISymbol GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 181public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 190public ISymbol FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 193public ISymbol FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 196public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 202public ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken)
AbstractSpeculationAnalyzer.cs (26)
322protected bool SymbolsAreCompatible(ISymbol? symbol, ISymbol? newSymbol, bool requireNonNullSymbols = false) 326ISymbol? symbol, 327ISymbol? newSymbol, 399private static bool CompareAcrossSemanticModels(ISymbol symbol, ISymbol newSymbol) 645private static bool IsStaticAccess(ISymbol? symbol) 683var originalExpressionSymbol = this.OriginalSemanticModel.GetSymbolInfo(currentOriginalNode).Symbol; 684var replacedExpressionSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(currentReplacedNode).Symbol; 703private static bool IsSymbolSystemObjectInstanceMethod([NotNullWhen(true)] ISymbol? symbol) 714var attributeSym = this.OriginalSemanticModel.GetSymbolInfo(attribute).Symbol; 715var newAttributeSym = this.SpeculativeSemanticModel.GetSymbolInfo(newAttribute).Symbol; 783var implementationMember = expressionType.FindImplementationForInterfaceMember(getEnumerator); 818var symbol = this.OriginalSemanticModel.GetSymbolInfo(type).Symbol; 820ISymbol? newSymbol; 836private static bool IsDelegateInvoke(ISymbol symbol) 842private static bool IsAnonymousDelegateInvoke(ISymbol symbol) 858var symbol = originalSymbolInfo.Symbol; 859var newSymbol = newSymbolInfo.Symbol; 885for (var overriddenMember = newSymbol.GetOverriddenMember(); overriddenMember != null; overriddenMember = overriddenMember.GetOverriddenMember()) 938ISymbol symbol, 939ISymbol newSymbol, 969var implementationMember = newSymbolContainingType.FindImplementationForInterfaceMember(symbol); 1016var receiverSymbol = semanticModel.GetSymbolInfo(receiver).GetAnySymbol(); 1029private bool SymbolsHaveCompatibleParameterLists(ISymbol originalSymbol, ISymbol newSymbol, TExpressionSyntax originalInvocation)
AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
123protected static bool IsEnumHasFlag(ISymbol symbol)
AccessibilityExtensions.cs (3)
14internal static bool MatchesSymbol(this Accessibility accessibility, ISymbol symbol) 23private static Accessibility GetAccessibility(ISymbol symbol) 25for (var currentSymbol = symbol; currentSymbol != null; currentSymbol = currentSymbol.ContainingSymbol)
AsyncSymbolVisitor`1.cs (2)
14public override ValueTask<TResult> Visit(ISymbol? symbol) 17public override ValueTask<TResult> DefaultVisit(ISymbol symbol)
Classification\SyntaxClassification\AbstractNameSyntaxClassifier.cs (4)
16protected ISymbol? TryGetSymbol(SyntaxNode node, SymbolInfo symbolInfo) 18var symbol = symbolInfo.GetAnySymbol(); 31ISymbol symbol, 43protected static bool IsStaticSymbol(ISymbol symbol)
CodeGenerationAbstractMethodSymbol.cs (2)
91public override ISymbol ContainingSymbol => this.ContainingType; 101public virtual ISymbol AssociatedSymbol => null;
CodeGenerationAbstractNamedTypeSymbol.cs (1)
114public ISymbol AssociatedSymbol { get; internal set; }
CodeGenerationFieldSymbol.cs (1)
104public ISymbol AssociatedSymbol => null;
CodeGenerationHelpers.cs (3)
41public static TSyntaxNode? AddAnnotationsTo<TSyntaxNode>(ISymbol symbol, TSyntaxNode? syntax) where TSyntaxNode : SyntaxNode 117ISymbol symbol, string commentToken, [NotNullWhen(true)] out string? comment, CancellationToken cancellationToken = default) 151public static IEnumerable<ISymbol> GetMembers(INamedTypeSymbol namedType)
CodeGenerationNamedTypeSymbol.cs (5)
25private readonly ImmutableArray<ISymbol> _members; 41ImmutableArray<ISymbol> members, 119public static ImmutableArray<ISymbol> CandidateSymbols 123return ImmutableArray.Create<ISymbol>(); 162public override ImmutableArray<ISymbol> GetMembers()
CodeGenerationNamespaceInfo.cs (7)
18private readonly IList<ISymbol> _imports; 20private CodeGenerationNamespaceInfo(IList<ISymbol> imports) 25IList<ISymbol> imports) 27var info = new CodeGenerationNamespaceInfo(imports ?? SpecializedCollections.EmptyList<ISymbol>()); 37public static IList<ISymbol> GetImports(INamespaceSymbol @namespace) 40private static IList<ISymbol> GetImports(CodeGenerationNamespaceInfo info) 43? SpecializedCollections.EmptyList<ISymbol>()
CodeGenerationNamespaceOrTypeSymbol.cs (3)
30public virtual ImmutableArray<ISymbol> GetMembers() 31=> ImmutableArray.Create<ISymbol>(); 33public ImmutableArray<ISymbol> GetMembers(string name)
CodeGenerationSymbol.cs (4)
82public virtual ISymbol ContainingSymbol => null; 173public ISymbol OriginalDefinition 222public bool Equals(ISymbol other) 225public bool Equals(ISymbol other, SymbolEqualityComparer equalityComparer)
CodeGenerationSymbolFactory.cs (5)
27public static bool IsCodeGenerationSymbol(this ISymbol symbol) 425ImmutableArray<ISymbol> members = default, 444ImmutableArray<ISymbol> members = default, 496members: ImmutableArray.Create<ISymbol>(invokeMethod), 505public static INamespaceSymbol CreateNamespaceSymbol(string name, IList<ISymbol>? imports = null, IList<INamespaceOrTypeSymbol>? members = null)
CodeGenerationTypeSymbol.cs (2)
62public ISymbol FindImplementationForInterfaceMember(ISymbol interfaceMember) => null;
CodeGenerator.cs (2)
86public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 92public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
Editing\DeclarationModifiers.cs (1)
65public static DeclarationModifiers From(ISymbol symbol)
Editing\SymbolEditor.cs (39)
99public async Task<ISymbol> GetCurrentSymbolAsync(ISymbol symbol, CancellationToken cancellationToken = default) 120var currentSymbol = await GetSymbolAsync(_currentSolution, projectId, symbolId, cancellationToken).ConfigureAwait(false); 146private static async Task<ISymbol> GetSymbolAsync(Solution solution, ProjectId projectId, string symbolId, CancellationToken cancellationToken) 181public async Task<IReadOnlyList<SyntaxNode>> GetCurrentDeclarationsAsync(ISymbol symbol, CancellationToken cancellationToken = default) 183var currentSymbol = await this.GetCurrentSymbolAsync(symbol, cancellationToken).ConfigureAwait(false); 190private IEnumerable<SyntaxNode> GetDeclarations(ISymbol symbol) 201private bool TryGetBestDeclarationForSingleEdit(ISymbol symbol, out SyntaxNode declaration) 232public async Task<ISymbol> EditOneDeclarationAsync( 233ISymbol symbol, 237var currentSymbol = await this.GetCurrentSymbolAsync(symbol, cancellationToken).ConfigureAwait(false); 256public Task<ISymbol> EditOneDeclarationAsync( 257ISymbol symbol, 271private static void CheckSymbolArgument(ISymbol currentSymbol, ISymbol argSymbol) 279private async Task<ISymbol> EditDeclarationAsync( 280ISymbol currentSymbol, 299var newSymbol = model.GetDeclaredSymbol(newDeclaration, cancellationToken); 319public Task<ISymbol> EditOneDeclarationAsync( 320ISymbol symbol, 345public Task<ISymbol> EditOneDeclarationAsync( 346ISymbol symbol, 362private async Task<ISymbol> EditOneDeclarationAsync( 363ISymbol symbol, 369var currentSymbol = await this.GetCurrentSymbolAsync(symbol, cancellationToken).ConfigureAwait(false); 395public async Task<ISymbol> EditOneDeclarationAsync( 396ISymbol symbol, 397ISymbol member, 401var currentSymbol = await this.GetCurrentSymbolAsync(symbol, cancellationToken).ConfigureAwait(false); 404var currentMember = await this.GetCurrentSymbolAsync(member, cancellationToken).ConfigureAwait(false); 428public Task<ISymbol> EditOneDeclarationAsync( 429ISymbol symbol, 430ISymbol member, 453public async Task<ISymbol> EditAllDeclarationsAsync( 454ISymbol symbol, 458var currentSymbol = await this.GetCurrentSymbolAsync(symbol, cancellationToken).ConfigureAwait(false); 490var newSymbol = model.GetDeclaredSymbol(newDeclaration, cancellationToken); 511public Task<ISymbol> EditAllDeclarationsAsync( 512ISymbol symbol,
Editing\SymbolEditorExtensions.cs (3)
21ISymbol symbol, 57public static async Task<ISymbol> SetBaseTypeAsync( 93public static Task<ISymbol> SetBaseTypeAsync(
Editing\SyntaxGenerator.cs (7)
226ImmutableArray<ISymbol>.CastUp(method.ExplicitInterfaceImplementations)); 410ImmutableArray<ISymbol>.CastUp(property.ExplicitInterfaceImplementations)); 467ImmutableArray<ISymbol>.CastUp(indexer.ExplicitInterfaceImplementations)); 506ImmutableArray<ISymbol>.CastUp(symbol.ExplicitInterfaceImplementations)); 722public SyntaxNode Declaration(ISymbol symbol) 823private static bool CanBeDeclared(ISymbol symbol) 898SyntaxNode declaration, ImmutableArray<ISymbol> explicitInterfaceImplementations, bool removeDefaults = true);
ExternalAccess\Pythia\Api\PythiaSemanticModelExtensions.cs (1)
12public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\Api\UnitTestingSymbolExtensions.cs (1)
12public static string GetSymbolKeyString(this ISymbol symbol, CancellationToken cancellationToken)
FindSymbols\Declarations\DeclarationFinder.cs (6)
24ArrayBuilder<ISymbol> list, 75ArrayBuilder<ISymbol> list, 94internal static ImmutableArray<ISymbol> FilterByCriteria(ImmutableArray<ISymbol> symbols, SymbolFilter criteria) 97private static bool MeetCriteria(ISymbol symbol, SymbolFilter filter) 120private static bool IsNonTypeMember(ISymbol symbol)
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (14)
23public static async Task<ImmutableArray<ISymbol>> FindAllDeclarationsWithNormalQueryAsync( 35return ImmutableArray<ISymbol>.Empty; 49return ImmutableArray<ISymbol>.Empty; 59internal static async Task<ImmutableArray<ISymbol>> FindAllDeclarationsWithNormalQueryInCurrentProcessAsync( 62using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 80using var _ = ArrayBuilder<ISymbol>.GetInstance(out var buffer); 95using var _ = ArrayBuilder<ISymbol>.GetInstance(out var buffer); 115using var _ = ArrayBuilder<ISymbol>.GetInstance(out var buffer); 133async Task AddAllAsync(ArrayBuilder<ISymbol> buffer, bool mapSymbol) 142foreach (var symbol in buffer) 144var mappedSymbol = mapSymbol 155private static async Task<ImmutableArray<ISymbol>> RehydrateAsync( 158var result = ArrayBuilder<ISymbol>.GetInstance(array.Count); 163var rehydrated = await dehydrated.TryRehydrateAsync(solution, cancellationToken).ConfigureAwait(false);
FindSymbols\Declarations\DeclarationFinder_SourceDeclarations.cs (20)
27public static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithNormalQueryAsync( 42return ImmutableArray<ISymbol>.Empty; 55return ImmutableArray<ISymbol>.Empty; 65public static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithNormalQueryAsync( 80return ImmutableArray<ISymbol>.Empty; 93return ImmutableArray<ISymbol>.Empty; 103public static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithPatternAsync( 126return ImmutableArray<ISymbol>.Empty; 136public static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithPatternAsync( 159return ImmutableArray<ISymbol>.Empty; 177internal static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithNormalQueryInCurrentProcessAsync( 182using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 192internal static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithNormalQueryInCurrentProcessAsync( 195using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 204private static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithPatternInCurrentProcessAsync( 205string pattern, Func<SearchQuery, Task<ImmutableArray<ISymbol>>> searchAsync) 239internal static Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithPatternInCurrentProcessAsync( 247internal static Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithPatternInCurrentProcessAsync( 255private static string? GetContainer(ISymbol symbol) 257var container = symbol.ContainingSymbol;
FindSymbols\FindReferences\BaseTypeFinder.cs (4)
18public static async ValueTask<ImmutableArray<ISymbol>> FindOverriddenAndImplementedMembersAsync( 19ISymbol symbol, Solution solution, CancellationToken cancellationToken) 21var results = ArrayBuilder<ISymbol>.GetInstance(); 29foreach (var member in type.GetMembers(symbol.Name))
FindSymbols\FindReferences\DependentProjectsFinder.cs (4)
27Solution solution, ImmutableArray<ISymbol> symbols, IImmutableSet<Project> projects, CancellationToken cancellationToken) 58Solution solution, ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 89Solution solution, ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 93foreach (var symbol in symbols)
FindSymbols\FindReferences\DependentTypeFinder.cs (3)
259var resolvedSymbol = info.TryResolve(semanticModel, cancellationToken); 281var resolvedType = info.TryResolve(semanticModel, cancellationToken); 413solution, ImmutableArray.Create<ISymbol>(type), solution.Projects.ToImmutableHashSet(), cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\DependentTypeFinder_Remote.cs (1)
89var rehydrated = await item.TryRehydrateAsync(solution, cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (6)
18where TSymbol : ISymbol 54var container = GetContainer(symbol); 67private static ISymbol? GetContainer(ISymbol symbol) 69for (var current = symbol; current != null; current = current.ContainingSymbol) 97ISymbol container,
FindSymbols\FindReferences\Finders\AbstractMethodOrPropertyOrEventSymbolReferenceFinder.cs (1)
15where TSymbol : ISymbol
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (36)
28ISymbol symbol, Project project, CancellationToken cancellationToken); 30public abstract ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 31ISymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken); 34ISymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, FindReferencesSearchOptions options, CancellationToken cancellationToken); 37ISymbol symbol, FindReferencesDocumentState state, FindReferencesSearchOptions options, CancellationToken cancellationToken); 40ISymbol symbol, FindReferencesDocumentState state, SyntaxToken token, CancellationToken cancellationToken) 54ISymbol searchSymbol, FindReferencesDocumentState state, SyntaxNode node, CancellationToken cancellationToken) 62ISymbol searchSymbol, FindReferencesDocumentState state, SymbolInfo symbolInfo, CancellationToken cancellationToken) 67foreach (var candidate in symbolInfo.CandidateSymbols) 164ISymbol symbol, 186ISymbol symbol, 250ISymbol symbol, 288ISymbol symbol, 397ISymbol symbol, 432ISymbol symbol, 471ISymbol symbol, 505ISymbol symbol, 532ISymbol symbol, 548var constructor = state.SemanticModel.GetSymbolInfo(node, cancellationToken).Symbol; 562protected static bool Matches(SymbolInfo info, ISymbol notNullOriginalUnreducedSymbol2) 567foreach (var symbol in info.CandidateSymbols) 576protected static bool Matches(ISymbol? symbol1, ISymbol notNullOriginalUnreducedSymbol2) 775internal static ImmutableDictionary<string, string> GetAdditionalFindUsagesProperties(ISymbol definition) 786var containingSymbol = definition.ContainingSymbol; 803var symbol = semanticModel.GetDeclaredSymbol(node); 815private static bool TryGetAdditionalProperty(string propertyName, ISymbol symbol, out KeyValuePair<string, string> additionalProperty) 829where TSymbol : ISymbol 847ISymbol symbol, Project project, CancellationToken cancellationToken) 855ISymbol symbol, HashSet<string>? globalAliases, Project project, 864ISymbol symbol, FindReferencesDocumentState state, FindReferencesSearchOptions options, CancellationToken cancellationToken) 871public sealed override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 872ISymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken) 881return new(ImmutableArray<ISymbol>.Empty); 884protected virtual ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 887return new(ImmutableArray<ISymbol>.Empty);
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (3)
20private static bool ShouldFindReferencesInGlobalSuppressions(ISymbol symbol, [NotNullWhen(returnValue: true)] out string? documentationCommentId) 33static bool SupportsGlobalSuppression(ISymbol symbol) 55ISymbol symbol,
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (1)
238var constructor = state.SemanticModel.GetSymbolInfo(node, cancellationToken).Symbol;
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (3)
18protected sealed override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 27.ToImmutableArray<ISymbol>(); 31.CastArray<ISymbol>();
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.UnderlyingNamedTypeVisitor.cs (1)
37public override INamedTypeSymbol? DefaultVisit(ISymbol symbol)
FindSymbols\FindReferences\Finders\FieldSymbolReferenceFinder.cs (2)
18protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 26: new(ImmutableArray<ISymbol>.Empty);
FindSymbols\FindReferences\Finders\ILanguageServiceReferenceFinder.cs (2)
19Task<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 20ISymbol symbol, Project project, CancellationToken cancellationToken);
FindSymbols\FindReferences\Finders\IReferenceFinder.cs (5)
27ISymbol symbol, Project project, CancellationToken cancellationToken); 37ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 38ISymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken); 53ISymbol symbol, HashSet<string>? globalAliases, 65ISymbol symbol,
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (4)
18protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 30return new(ImmutableArray.Create<ISymbol>(method.PartialDefinitionPart.TypeParameters[ordinal])); 33return new(ImmutableArray.Create<ISymbol>(method.PartialImplementationPart.TypeParameters[ordinal])); 36return new(ImmutableArray<ISymbol>.Empty);
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (5)
27protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 33using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 47private static void Add<TSymbol>(ArrayBuilder<ISymbol> result, ImmutableArray<TSymbol> enumerable) where TSymbol : ISymbol 49result.AddRange(enumerable.Cast<ISymbol>());
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (6)
21protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 30? new(ImmutableArray.Create<ISymbol>(symbol.ContainingType)) 34private static ImmutableArray<ISymbol> GetOtherPartsOfPartial(IMethodSymbol symbol) 37return ImmutableArray.Create<ISymbol>(symbol.PartialDefinitionPart); 40return ImmutableArray.Create<ISymbol>(symbol.PartialImplementationPart); 42return ImmutableArray<ISymbol>.Empty;
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (14)
48protected override async ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 55return ImmutableArray<ISymbol>.Empty; 57using var _ = ArrayBuilder<ISymbol>.GetInstance(out var symbols); 69private static void CascadeBetweenAnonymousDelegateParameters(IParameterSymbol parameter, ArrayBuilder<ISymbol> symbols) 79IParameterSymbol parameter, ArrayBuilder<ISymbol> symbols, CancellationToken cancellationToken) 87ArrayBuilder<ISymbol> results, 129ArrayBuilder<ISymbol> results, 137var symbol = semanticModel.GetDeclaredSymbol(token.GetRequiredParent(), cancellationToken); 168var declaredSymbol = semanticModel.GetDeclaredSymbol(current); 179ArrayBuilder<ISymbol> results) 182var containingSymbol = parameter.ContainingSymbol; 200ArrayBuilder<ISymbol> results) 227ArrayBuilder<ISymbol> results, 237ArrayBuilder<ISymbol> results)
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (2)
20protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 29? new(ImmutableArray<ISymbol>.Empty)
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (6)
24protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync( 30using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 39private static void CascadeToBackingFields(IPropertySymbol symbol, ArrayBuilder<ISymbol> result) 41foreach (var member in symbol.ContainingType.GetMembers()) 51private static void CascadeToAccessors(IPropertySymbol symbol, ArrayBuilder<ISymbol> result) 57private static void CascadeToPrimaryConstructorParameters(IPropertySymbol property, ArrayBuilder<ISymbol> result, CancellationToken cancellationToken)
FindSymbols\FindReferences\FindReferencesProgress.cs (2)
31public void OnDefinitionFound(ISymbol symbol) 35public void OnReferenceFound(ISymbol symbol, ReferenceLocation location)
FindSymbols\FindReferences\FindReferencesSearchEngine.BidirectionalSymbolSet.cs (3)
44public override ImmutableArray<ISymbol> GetAllSymbols() 50var workQueue = new Stack<ISymbol>(); 57var current = workQueue.Pop();
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (19)
44private readonly ConcurrentDictionary<ISymbol, SymbolGroup> _symbolToGroup = new(MetadataUnifyingEquivalenceComparer.Instance); 68public Task FindReferencesAsync(ISymbol symbol, CancellationToken cancellationToken) 72ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 142private async Task ReportGroupsAsync(ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 144foreach (var symbol in symbols) 148private async ValueTask<SymbolGroup> ReportGroupAsync(ISymbol symbol, CancellationToken cancellationToken) 164foreach (var groupSymbol in group.Symbols) 178ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 187private async Task ProcessProjectAsync(Project project, ImmutableArray<ISymbol> allSymbols, CancellationToken cancellationToken) 189using var _1 = PooledDictionary<ISymbol, PooledHashSet<string>>.GetInstance(out var symbolToGlobalAliases); 195foreach (var symbol in allSymbols) 252Dictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases, 269foreach (var symbol in symbols) 283ISymbol symbol, 306ImmutableArray<ISymbol> allSymbols, 307PooledDictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases, 310foreach (var symbol in allSymbols) 336private static void FreeGlobalAliases(PooledDictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases) 342private static bool InvolvesInheritance(ISymbol symbol)
FindSymbols\FindReferences\FindReferencesSearchEngine.NonCascadingSymbolSet.cs (2)
19private readonly ImmutableArray<ISymbol> _symbols; 24public override ImmutableArray<ISymbol> GetAllSymbols()
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (26)
44public abstract ImmutableArray<ISymbol> GetAllSymbols(); 97foreach (var symbol in symbols) 103private static async Task<ISymbol> MapToAppropriateSymbolAsync( 104Solution solution, ISymbol symbol, CancellationToken cancellationToken) 109var searchSymbol = symbol; 127var sourceSymbol = await SymbolFinder.FindSourceDefinitionAsync(searchSymbol, solution, cancellationToken).ConfigureAwait(false); 142var workQueue = new Stack<ISymbol>(); 145foreach (var symbol in symbols) 151var currentSymbol = workQueue.Pop(); 165var workQueue = new Stack<ISymbol>(); 172var currentSymbol = workQueue.Pop(); 181FindReferencesSearchEngine engine, ImmutableArray<ISymbol> symbols, MetadataUnifyingSymbolHashSet seenSymbols, Stack<ISymbol> workQueue, CancellationToken cancellationToken) 183foreach (var symbol in symbols) 188FindReferencesSearchEngine engine, ISymbol symbol, MetadataUnifyingSymbolHashSet seenSymbols, Stack<ISymbol> workQueue, CancellationToken cancellationToken) 196foreach (var cascade in cascaded) 202async Task<ISymbol> MapAndAddLinkedSymbolsAsync(ISymbol symbol) 205foreach (var linked in await SymbolFinder.FindLinkedSymbolsAsync(symbol, solution, cancellationToken).ConfigureAwait(false)) 225FindReferencesSearchEngine engine, ISymbol symbol, 226MetadataUnifyingSymbolHashSet seenSymbols, Stack<ISymbol> workQueue, 259ISymbol symbol, 261Stack<ISymbol> workQueue, 277foreach (var match in matches) 282if (symbol.GetOverriddenMember() is ISymbol overriddenMember)
FindSymbols\FindReferences\FindReferencesSearchEngine.UnidirectionalSymbolSet.cs (4)
34private readonly ImmutableHashSet<ISymbol> _upSymbols; 46public override ImmutableArray<ISymbol> GetAllSymbols() 57var workQueue = new Stack<ISymbol>(); 64var current = workQueue.Pop();
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (18)
21ISymbol originalSymbol, IImmutableSet<Document> documents, CancellationToken cancellationToken) 36var hasInheritanceRelationshipCache = new Dictionary<(ISymbol searchSymbol, ISymbol candidateSymbol), bool>(); 58async ValueTask PerformSearchInProjectAsync(ImmutableArray<ISymbol> symbols, Project project) 60using var _ = PooledDictionary<ISymbol, PooledHashSet<string>>.GetInstance(out var symbolToGlobalAliases); 80ImmutableArray<ISymbol> symbols, 82PooledDictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases) 92foreach (var symbol in symbols) 102ISymbol symbol, Document document, FindReferencesDocumentState state) 142async ValueTask<(bool matched, ISymbol candidate, CandidateReason candidateReason)> HasInheritanceRelationshipAsync( 143ISymbol symbol, SymbolInfo symbolInfo) 148foreach (var candidate in symbolInfo.CandidateSymbols) 157async ValueTask<bool> HasInheritanceRelationshipSingleAsync(ISymbol searchSymbol, [NotNullWhen(true)] ISymbol? candidate) 173ISymbol searchSymbol, ISymbol candidate) 185foreach (var symbolUp in searchSymbolUpSet.GetAllSymbols()) 195foreach (var candidateUp in candidateSymbolUpSet.GetAllSymbols())
FindSymbols\FindReferences\FindReferencesSearchOptions.cs (1)
79public static FindReferencesSearchOptions GetFeatureOptionsForStartingSymbol(ISymbol symbol)
FindSymbols\FindReferences\MetadataUnifyingEquivalenceComparer.cs (6)
11internal sealed class MetadataUnifyingEquivalenceComparer : IEqualityComparer<ISymbol> 13public static readonly IEqualityComparer<ISymbol> Instance = new MetadataUnifyingEquivalenceComparer(); 19public bool Equals(ISymbol? x, ISymbol? y) 38public int GetHashCode(ISymbol obj) 50private static bool IsInSource(ISymbol symbol)
FindSymbols\FindReferences\MetadataUnifyingSymbolHashSet.cs (1)
9internal sealed class MetadataUnifyingSymbolHashSet : HashSet<ISymbol>
FindSymbols\FindReferences\NoOpStreamingFindReferencesProgress.cs (1)
29public ValueTask OnReferenceFoundAsync(SymbolGroup group, ISymbol symbol, ReferenceLocation location, CancellationToken cancellationToken) => default;
FindSymbols\FindReferences\StreamingFindReferencesProgress.cs (2)
56foreach (var symbol in group.Symbols) 67public ValueTask OnReferenceFoundAsync(SymbolGroup group, ISymbol symbol, ReferenceLocation location, CancellationToken cancellationToken)
FindSymbols\IFindReferencesProgress.cs (2)
19void OnDefinitionFound(ISymbol symbol); 20void OnReferenceFound(ISymbol symbol, ReferenceLocation location);
FindSymbols\IStreamingFindReferencesProgress.cs (5)
17/// Represents a group of <see cref="ISymbol"/>s that should be treated as a single entity for 28public ImmutableHashSet<ISymbol> Symbols { get; } 32public SymbolGroup(ImmutableArray<ISymbol> symbols) 51foreach (var symbol in Symbols) 75ValueTask OnReferenceFoundAsync(SymbolGroup group, ISymbol symbol, ReferenceLocation location, CancellationToken cancellationToken);
FindSymbols\ReferencedSymbol.cs (2)
29public ISymbol Definition { get; } 42ISymbol definition,
FindSymbols\ReferenceLocationExtensions.cs (7)
16public static async Task<Dictionary<ISymbol, List<Location>>> FindReferencingSymbolsAsync( 22var result = new Dictionary<ISymbol, List<Location>>(); 51Dictionary<ISymbol, List<Location>> result) 55var containingSymbol = GetEnclosingMethodOrPropertyOrField(semanticModel, reference); 69private static ISymbol? GetEnclosingMethodOrPropertyOrField( 73var enclosingSymbol = semanticModel.GetEnclosingSymbol(reference.Location.SourceSpan.Start); 75for (var current = enclosingSymbol; current != null; current = current.ContainingSymbol)
FindSymbols\StreamingProgressCollector.cs (4)
20/// Collects all the <see cref="ISymbol"/> definitions and <see cref="ReferenceLocation"/> 31private readonly Dictionary<ISymbol, List<ReferenceLocation>> _symbolToLocations = new(); 70foreach (var definition in group.Symbols) 82public ValueTask OnReferenceFoundAsync(SymbolGroup group, ISymbol definition, ReferenceLocation location, CancellationToken cancellationToken)
FindSymbols\SymbolCallerInfo.cs (4)
23public ISymbol CallingSymbol { get; } 33public ISymbol CalledSymbol { get; } 44ISymbol callingSymbol, 45ISymbol calledSymbol,
FindSymbols\SymbolFinder.cs (18)
26public static ISymbol FindSymbolAtPosition( 42public static Task<ISymbol> FindSymbolAtPositionAsync( 60internal static async Task<ISymbol> FindSymbolAtPositionAsync( 105public static async Task<ISymbol> FindSymbolAtPositionAsync( 121public static Task<ISymbol?> FindSourceDefinitionAsync( 122ISymbol? symbol, Solution solution, CancellationToken cancellationToken = default) 142return SpecializedTasks.Null<ISymbol>(); 145private static async Task<ISymbol?> FindSourceDefinitionWorkerAsync( 146ISymbol symbol, 204private static bool InSource(ISymbol symbol) 223where TSymbol : ISymbol 248/// In order to be returned the other symbols must have the same <see cref="ISymbol.Name"/> and <see 249/// cref="ISymbol.Kind"/> as <paramref name="symbol"/>. This matches general user intuition that these are all 250/// the 'same' symbol, and should be examined, regardless of the project context and <see cref="ISymbol"/> they 253internal static async Task<ImmutableArray<ISymbol>> FindLinkedSymbolsAsync( 254ISymbol symbol, Solution solution, CancellationToken cancellationToken) 257var linkedSymbols = new HashSet<ISymbol> { symbol }; 287var linkedSymbol = semanticModel.GetDeclaredSymbol(linkedNode, cancellationToken);
FindSymbols\SymbolFinder.FindReferencesServerCallback.cs (4)
30private readonly Dictionary<SerializableSymbolAndProjectId, ISymbol> _definitionMap = new(); 68using var _ = PooledDictionary<SerializableSymbolAndProjectId, ISymbol>.GetInstance(out var map); 72var symbol = await symbolAndProjectId.TryRehydrateAsync(_solution, cancellationToken).ConfigureAwait(false); 97ISymbol? symbol;
FindSymbols\SymbolFinder_Callers.cs (4)
24ISymbol symbol, Solution solution, CancellationToken cancellationToken = default) 33ISymbol symbol, Solution solution, IImmutableSet<Document>? documents, CancellationToken cancellationToken = default) 41var foundSymbol = await FindSourceDefinitionAsync(symbol, solution, cancellationToken).ConfigureAwait(false); 77ISymbol symbol,
FindSymbols\SymbolFinder_Declarations_AllDeclarations.cs (2)
16public static async Task<IEnumerable<ISymbol>> FindDeclarationsAsync( 28public static async Task<IEnumerable<ISymbol>> FindDeclarationsAsync(
FindSymbols\SymbolFinder_Declarations_CustomQueries.cs (10)
28public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, Func<string, bool> predicate, CancellationToken cancellationToken = default) 34public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, Func<string, bool> predicate, SymbolFilter filter, CancellationToken cancellationToken = default) 43internal static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithCustomQueryAsync( 53return ImmutableArray<ISymbol>.Empty; 58using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 73public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, Func<string, bool> predicate, CancellationToken cancellationToken = default) 79public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, Func<string, bool> predicate, SymbolFilter filter, CancellationToken cancellationToken = default) 88internal static async Task<ImmutableArray<ISymbol>> FindSourceDeclarationsWithCustomQueryAsync( 98return ImmutableArray<ISymbol>.Empty; 114return ImmutableArray<ISymbol>.Empty;
FindSymbols\SymbolFinder_Declarations_SourceDeclarations.cs (8)
20public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, string name, bool ignoreCase, CancellationToken cancellationToken = default) 26public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync( 40public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Project project, string name, bool ignoreCase, CancellationToken cancellationToken = default) 46public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync( 67public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync(Solution solution, string pattern, CancellationToken cancellationToken = default) 77public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync( 95public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync(Project project, string pattern, CancellationToken cancellationToken = default) 105public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync(
FindSymbols\SymbolFinder_FindReferences_Current.cs (3)
22ISymbol symbol, 71ISymbol symbol, 86ISymbol symbol,
FindSymbols\SymbolFinder_FindReferences_Legacy.cs (6)
26ISymbol symbol, 39ISymbol symbol, 59ISymbol symbol, 81ISymbol symbol, 97ISymbol symbol, 116ISymbol symbol,
FindSymbols\SymbolFinder_FindRenamableReferences.cs (1)
16ImmutableArray<ISymbol> symbols,
FindSymbols\SymbolFinder_Helpers.cs (5)
20private static bool IsAccessible(ISymbol symbol) 35ISymbol? searchSymbol, 36ISymbol? symbolToMatch, 76ISymbol searchSymbol, 77ISymbol symbolToMatch,
FindSymbols\SymbolFinder_Hierarchy.cs (35)
26public static async Task<IEnumerable<ISymbol>> FindOverridesAsync( 27ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 36internal static async Task<ImmutableArray<ISymbol>> FindOverridesArrayAsync( 37ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 39var results = ArrayBuilder<ISymbol>.GetInstance(); 52foreach (var m in type.GetMembers(symbol.Name)) 54var sourceMember = await FindSourceDefinitionAsync(m, solution, cancellationToken).ConfigureAwait(false); 55var bestMember = sourceMember ?? m; 68internal static async Task<bool> IsOverrideAsync(Solution solution, ISymbol member, ISymbol symbol, CancellationToken cancellationToken) 70for (var current = member; current != null; current = current.GetOverriddenMember()) 82public static async Task<IEnumerable<ISymbol>> FindImplementedInterfaceMembersAsync( 83ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 91internal static Task<ImmutableArray<ISymbol>> FindImplementedInterfaceMembersArrayAsync( 92ISymbol symbol, Solution solution, CancellationToken cancellationToken) 103internal static async Task<ImmutableArray<ISymbol>> FindImplementedInterfaceMembersArrayAsync( 104ISymbol symbol, 139using var _ = ArrayBuilder<ISymbol>.GetInstance(out var builder); 157foreach (var interfaceMember in interfaceType.GetMembers(symbol.Name)) 159var sourceMethod = await FindSourceDefinitionAsync(interfaceMember, solution, cancellationToken).ConfigureAwait(false); 160var bestMethod = sourceMethod ?? interfaceMember; 164foreach (var implementation in implementations) 181return ImmutableArray<ISymbol>.Empty; 194/// "derived", but can be found with <see cref="FindImplementationsAsync(ISymbol, Solution, 211/// "derived", but can be found with <see cref="FindImplementationsAsync(ISymbol, Solution, 322public static async Task<IEnumerable<ISymbol>> FindImplementationsAsync( 323ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 342/// <inheritdoc cref="FindImplementationsAsync(ISymbol, Solution, IImmutableSet{Project}, CancellationToken)"/> 346internal static async Task<ImmutableArray<ISymbol>> FindMemberImplementationsArrayAsync( 347ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 350return ImmutableArray<ISymbol>.Empty; 361using var _ = ArrayBuilder<ISymbol>.GetInstance(out var results); 365foreach (var implementation in implementations) 367var sourceDef = await FindSourceDefinitionAsync(implementation, solution, cancellationToken).ConfigureAwait(false); 368var bestDef = sourceDef ?? implementation;
FindSymbols\SymbolTree\SymbolTreeInfo.cs (14)
24/// produce a corresponding <see cref="ISymbol"/> that can be used by a feature. The primary purpose of this index 121public Task<ImmutableArray<ISymbol>> FindAsync( 132public async Task<ImmutableArray<ISymbol>> FindAsync( 145private Task<ImmutableArray<ISymbol>> FindCoreAsync( 170private async Task<ImmutableArray<ISymbol>> FuzzyFindAsync( 174var result = ArrayBuilder<ISymbol>.GetInstance(); 188private async Task<ImmutableArray<ISymbol>> FindAsync( 194using var results = TemporaryArray<ISymbol>.Empty; 210return ImmutableArray<ISymbol>.Empty; 372int index, INamespaceOrTypeSymbol rootContainer, ref TemporaryArray<ISymbol> results, CancellationToken cancellationToken) 389using var containerSymbols = TemporaryArray<ISymbol>.Empty; 391foreach (var containerSymbol in containerSymbols) 480using var tempBuilder = TemporaryArray<ISymbol>.Empty; 487foreach (var symbol in tempBuilder)
FindSymbols\TopLevelSyntaxTree\DeclaredSymbolInfo.cs (1)
238public ISymbol? TryResolve(SemanticModel semanticModel, CancellationToken cancellationToken)
GeneratedCodeUtilities.cs (1)
19ISymbol symbol, INamedTypeSymbol generatedCodeAttribute)
ICodeGenerationService.cs (4)
84TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 124TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 174Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken); 179bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken);
IParameterSymbolExtensions.cs (1)
42foreach (var member in containingType.GetMembers(parameter.Name))
ISemanticFacts.cs (6)
65ISymbol? GetDeclaredSymbol(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken); 90IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, 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); 105ImmutableArray<IMethodSymbol> GetLocalFunctionSymbols(Compilation compilation, ISymbol symbol, CancellationToken cancellationToken);
ISemanticFactsExtensions.cs (2)
100foreach (var symbol in symbolInfo.CandidateSymbols) 111private static bool IsUserDefinedOperator([NotNullWhen(returnValue: true)] ISymbol? symbol)
ISemanticFactsService.cs (1)
35Func<ISymbol, bool> filter, IEnumerable<string> usedNames, CancellationToken cancellationToken);
ISymbolDeclarationService.cs (1)
17ImmutableArray<SyntaxReference> GetDeclarations(ISymbol symbol);
ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (2)
20private readonly HashSet<ISymbol> _visited = new(); 22public override bool DefaultVisit(ISymbol node)
ISymbolExtensions_Accessibility.cs (11)
17this ISymbol symbol, 18ISymbol within, 39this ISymbol symbol, 51this ISymbol symbol, 64ISymbol symbol, 83ISymbol symbol, 84ISymbol within, // must be assembly or named type symbol 180private static bool IsNamedTypeAccessible(INamedTypeSymbol type, ISymbol within) 218ISymbol within) 253ISymbol within, 413ISymbol within,
ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
16private readonly HashSet<ISymbol> _visited = new(); 28public override void DefaultVisit(ISymbol node)
ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
15public override Accessibility DefaultVisit(ISymbol node)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (63)
66public static ISymbol? FindImplementationForAbstractMember(this INamedTypeSymbol? type, ISymbol symbol) 77private static bool ImplementationExists(INamedTypeSymbol classOrStructType, ISymbol member) 82ISymbol member, 83Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 151ISymbol member, 152Func<INamedTypeSymbol, ISymbol, bool> isValid, 155var implementation = classOrStructType.FindImplementationForInterfaceMember(member); 175public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembers( 181Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> GetMembers; 201static ImmutableArray<ISymbol> GetImplicitlyImplementableMembers(INamedTypeSymbol type, ISymbol within) 214static bool IsPropertyWithNonPublicImplementableAccessor(ISymbol member) 231static bool IsImplicitlyImplementable(ISymbol member, ISymbol within) 248private static bool IsImplementable(ISymbol m) 251public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembersInThis( 261var implementation = classOrStructType.FindImplementationForInterfaceMember(m); 269public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembersInThis( 272Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 280var implementation = classOrStructType.FindImplementationForInterfaceMember(m); 288public static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedExplicitMembers( 302private static ImmutableArray<ISymbol> GetExplicitlyImplementableMembers(INamedTypeSymbol type, ISymbol within) 314private static bool IsPropertyWithInaccessibleImplementableAccessor(ISymbol member, ISymbol within) 326private static bool IsInaccessibleImplementableAccessor(IMethodSymbol? accessor, ISymbol within) 329private static ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)> GetAllUnimplementedMembers( 332Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented, 333Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 334Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 344return ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)>.Empty; 349return ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)>.Empty; 355return ImmutableArray<(INamedTypeSymbol type, ImmutableArray<ISymbol> members)>.Empty; 406private static ImmutableArray<ISymbol> GetUnimplementedMembers( 409Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented, 410Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation, 411Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter, 425public static IEnumerable<ISymbol> GetAttributeNamedParameters( 428ISymbol within) 441foreach (var member in type.GetMembers()) 443var namedParameter = IsAttributeNamedParameter(member, within ?? compilation.Assembly); 452private static ISymbol? IsAttributeNamedParameter( 453ISymbol symbol, 454ISymbol within) 494private static ImmutableArray<ISymbol> GetMembers(INamedTypeSymbol type, ISymbol within) 507public static ImmutableArray<ISymbol> GetOverridableMembers( 513var result = new Dictionary<ISymbol, int>(); 544Dictionary<ISymbol, int> result, INamedTypeSymbol containingType, 547foreach (var member in type.GetMembers()) 558private static bool IsOverridable(ISymbol member, INamedTypeSymbol containingType) 579Dictionary<ISymbol, int> result, INamedTypeSymbol containingType, CancellationToken cancellationToken) 581foreach (var member in containingType.GetMembers()) 591var overriddenMember = member.GetOverriddenMember(); 598private static bool IsEqualsObjectOverride(ISymbol? member) 609private static bool IsEqualsObject(ISymbol member)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs\ISymbolExtensions.cs (88)
19public static string ToNameDisplayString(this ISymbol symbol) 22public static string ToSignatureDisplayString(this ISymbol symbol) 25public static bool HasPublicResultantVisibility(this ISymbol symbol) 28public static SymbolVisibility GetResultantVisibility(this ISymbol symbol) 75public static ISymbol? GetOverriddenMember(this ISymbol? symbol) 84public static ImmutableArray<ISymbol> ExplicitInterfaceImplementations(this ISymbol symbol) 87IEventSymbol @event => ImmutableArray<ISymbol>.CastUp(@event.ExplicitInterfaceImplementations), 88IMethodSymbol method => ImmutableArray<ISymbol>.CastUp(method.ExplicitInterfaceImplementations), 89IPropertySymbol property => ImmutableArray<ISymbol>.CastUp(property.ExplicitInterfaceImplementations), 90_ => ImmutableArray.Create<ISymbol>(), 93public static ImmutableArray<ISymbol> ExplicitOrImplicitInterfaceImplementations(this ISymbol symbol) 96return ImmutableArray<ISymbol>.Empty; 107public static ImmutableArray<ISymbol> ImplicitInterfaceImplementations(this ISymbol symbol) 110public static bool IsOverridable([NotNullWhen(true)] this ISymbol? symbol) 119public static bool IsImplementableMember([NotNullWhen(true)] this ISymbol? symbol) 152public static INamedTypeSymbol? GetContainingTypeOrThis(this ISymbol symbol) 162public static bool IsErrorType([NotNullWhen(true)] this ISymbol? symbol) 165public static bool IsModuleType([NotNullWhen(true)] this ISymbol? symbol) 168public static bool IsInterfaceType([NotNullWhen(true)] this ISymbol? symbol) 171public static bool IsArrayType([NotNullWhen(true)] this ISymbol? symbol) 174public static bool IsTupleType([NotNullWhen(true)] this ISymbol? symbol) 177public static bool IsAnonymousFunction([NotNullWhen(true)] this ISymbol? symbol) 180public static bool IsKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind) 183public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind) 186public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind1, SymbolKind kind2) 192public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, SymbolKind kind1, SymbolKind kind2, SymbolKind kind3) 198public static bool MatchesKind([NotNullWhen(true)] this ISymbol? symbol, params SymbolKind[] kinds) 204public static bool IsReducedExtension([NotNullWhen(true)] this ISymbol? symbol) 207public static bool IsEnumMember([NotNullWhen(true)] this ISymbol? symbol) 210public static bool IsExtensionMethod(this ISymbol symbol) 213public static bool IsLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 216public static bool IsAnonymousOrLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 219public static bool IsModuleMember([NotNullWhen(true)] this ISymbol? symbol) 222public static bool IsConstructor([NotNullWhen(true)] this ISymbol? symbol) 225public static bool IsStaticConstructor([NotNullWhen(true)] this ISymbol? symbol) 228public static bool IsDestructor([NotNullWhen(true)] this ISymbol? symbol) 231public static bool IsUserDefinedOperator([NotNullWhen(true)] this ISymbol? symbol) 234public static bool IsConversion([NotNullWhen(true)] this ISymbol? symbol) 237public static bool IsOrdinaryMethod([NotNullWhen(true)] this ISymbol? symbol) 240public static bool IsOrdinaryMethodOrLocalFunction([NotNullWhen(true)] this ISymbol? symbol) 243public static bool IsDelegateType([NotNullWhen(true)] this ISymbol? symbol) 246public static bool IsAnonymousType([NotNullWhen(true)] this ISymbol? symbol) 249public static bool IsNormalAnonymousType([NotNullWhen(true)] this ISymbol? symbol) 252public static bool IsAnonymousDelegateType([NotNullWhen(true)] this ISymbol? symbol) 255public static bool IsAnonymousTypeProperty([NotNullWhen(true)] this ISymbol? symbol) 258public static bool IsTupleField([NotNullWhen(true)] this ISymbol? symbol) 261public static bool IsIndexer([NotNullWhen(true)] this ISymbol? symbol) 264public static bool IsWriteableFieldOrProperty([NotNullWhen(true)] this ISymbol? symbol) 272public static bool IsRequired([NotNullWhen(true)] this ISymbol? symbol) 275public static ITypeSymbol? GetMemberType(this ISymbol? symbol) 285public static int GetArity(this ISymbol symbol) 294public static ISymbol? GetOriginalUnreducedDefinition(this ISymbol? symbol) 337public static bool IsFunctionValue([NotNullWhen(true)] this ISymbol? symbol) 340public static bool IsThisParameter([NotNullWhen(true)] this ISymbol? symbol) 344public static ISymbol? ConvertThisParameterToType(this ISymbol? symbol) 354public static bool IsParams([NotNullWhen(true)] this ISymbol? symbol) 357public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol? symbol) 365public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 373public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 386public static ImmutableArray<ITypeSymbol> GetTypeArguments(this ISymbol? symbol) 394public static ImmutableArray<ITypeSymbol> GetAllTypeArguments(this ISymbol symbol) 409public static bool IsAttribute([NotNullWhen(true)] this ISymbol? symbol) 418public static bool RequiresUnsafeModifier([NotNullWhen(true)] this ISymbol? member) 425this ISymbol? symbol, 468public static bool IsStaticType([NotNullWhen(true)] this ISymbol? symbol) 471public static bool IsNamespace([NotNullWhen(true)] this ISymbol? symbol) 475[NotNullWhen(true)] this ISymbol? symbol, ISymbol withinType, IAssemblySymbol withinAssembly, CancellationToken cancellationToken) 495public static IEnumerable<IPropertySymbol> GetValidAnonymousTypeProperties(this ISymbol symbol) 501public static Accessibility ComputeResultantAccessibility(this ISymbol? symbol, ITypeSymbol finalDestination) 527public static bool IsInaccessibleLocal(this ISymbol symbol, int position) 545public static bool IsAccessor([NotNullWhen(true)] this ISymbol? symbol) 548public static bool IsPropertyAccessor([NotNullWhen(true)] this ISymbol? symbol) 551public static bool IsEventAccessor([NotNullWhen(true)] this ISymbol? symbol) 554public static bool IsFromSource(this ISymbol symbol) 557public static bool IsNonImplicitAndFromSource(this ISymbol symbol) 560public static ITypeSymbol? GetSymbolType(this ISymbol? symbol) 576public static bool IsAwaitableNonDynamic([NotNullWhen(true)] this ISymbol? symbol, SemanticModel semanticModel, int position) 715public static bool IsKind<TSymbol>(this ISymbol symbol, SymbolKind kind, [NotNullWhen(true)] out TSymbol? result) where TSymbol : class, ISymbol 732public static bool IsSymbolWithSpecialDiscardName(this ISymbol symbol) 741public static bool IsObsolete(this ISymbol symbol)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (10)
401public static bool CanSupportCollectionInitializer(this ITypeSymbol typeSymbol, ISymbol within) 432public static IEnumerable<T> GetAccessibleMembersInBaseTypes<T>(this ITypeSymbol containingType, ISymbol within) where T : class, ISymbol 443public static ImmutableArray<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol? containingType, ISymbol within) where T : class, ISymbol 488public static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, ISymbol within) where T : class, ISymbol 498private static IEnumerable<T> SelectAccessibleMembers<T>(this IEnumerable<ITypeSymbol>? types, string memberName, ISymbol within) where T : class, ISymbol 683foreach (var member in type.GetMembers())
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISymbolExtensions.cs\ISymbolExtensions.cs (1)
15public static DeclarationModifiers GetSymbolModifiers(this ISymbol symbol)
LanguageServices\FixAllSpanMappingService\AbstractFixAllSpanMappingService.cs (1)
46var symbol = semanticModel.GetDeclaredSymbol(decl, cancellationToken);
NamingStyleRules.cs (5)
26internal bool TryGetApplicableRule(ISymbol symbol, out NamingRule applicableRule) 45private bool IsSymbolNameAnalyzable(ISymbol symbol) 66private static bool DoesSymbolImplementAnotherSymbol(ISymbol symbol) 88private static bool IsInterfaceImplementation(ISymbol symbol) 101foreach (var implementedInterfaceMember in implementedInterfaceMembersWithSameName)
OperationExtensions.cs (2)
27public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 224public static RefKind GetRefKind(this IReturnOperation? operation, ISymbol containingSymbol)
ReassignedVariable\AbstractReassignedVariableService.cs (9)
48using var _1 = PooledDictionary<ISymbol, bool>.GetInstance(out var symbolToIsReassigned); 105var symbol = semanticModel.GetSymbolInfo(identifier, cancellationToken).Symbol; 131bool IsSymbolReassigned([NotNullWhen(true)] ISymbol? symbol) 153var methodOrProperty = parameter.ContainingSymbol; 230ISymbol localOrParameter, 264var symbol = semanticModel.GetSymbolInfo(id, cancellationToken).Symbol; 288bool AreEquivalent(ISymbol localOrParameter, ISymbol? symbol) 311bool DefinitelyAssignedOnEntry(DataFlowAnalysis? analysis, ISymbol? localOrParameter)
Recommendations\AbstractRecommendationService.cs (2)
46var enclosingSymbol = context.SemanticModel.GetEnclosingSymbol(context.LeftToken.SpanStart, cancellationToken); 72internal bool ShouldIncludeSymbol(ISymbol symbol)
Recommendations\AbstractRecommendationServiceRunner.cs (17)
49private ImmutableArray<ISymbol> GetMemberSymbolsForParameter(IParameterSymbol parameter, int position, bool useBaseReferenceAccessibility, bool unwrapNullable, bool isForDereference) 57private ImmutableArray<ISymbol> TryGetMemberSymbolsForLambdaParameter( 145foreach (var invocationSymbol in invocationSymbols) 183ImmutableArray<ISymbol> candidateSymbols, 193foreach (var candidateSymbol in candidateSymbols) 268protected ImmutableArray<ISymbol> GetSymbolsForNamespaceDeclarationNameContext<TNamespaceDeclarationSyntax>() 273return ImmutableArray<ISymbol>.Empty; 285protected static bool IsNonIntersectingNamespace(ISymbol recommendationSymbol, SyntaxNode declarationSyntax) 310protected ImmutableArray<ISymbol> GetMemberSymbols( 311ISymbol container, 329return ImmutableArray<ISymbol>.Empty; 341protected ImmutableArray<ISymbol> LookupSymbolsInContainer( 356using var _ = ArrayBuilder<ISymbol>.GetInstance(containerMembers.Length, out var result); 358foreach (var member in containerMembers) 367var originalMember = member.GetOriginalUnreducedDefinition(); 446protected static ImmutableArray<ISymbol> SuppressDefaultTupleElements(INamespaceOrTypeSymbol container, ImmutableArray<ISymbol> symbols)
Recommendations\IRecommendationService.cs (7)
22private readonly ImmutableArray<ISymbol> _namedSymbols; 23private readonly ImmutableArray<ISymbol> _unnamedSymbols; 28public ImmutableArray<ISymbol> NamedSymbols => _namedSymbols.NullToEmpty(); 33public ImmutableArray<ISymbol> UnnamedSymbols => _unnamedSymbols.NullToEmpty(); 35public RecommendedSymbols(ImmutableArray<ISymbol> namedSymbols) 41ImmutableArray<ISymbol> namedSymbols, 42ImmutableArray<ISymbol> unnamedSymbols = default)
Recommendations\Recommender.cs (3)
19public static IEnumerable<ISymbol> GetRecommendedSymbolsAtPosition( 35public static Task<IEnumerable<ISymbol>> GetRecommendedSymbolsAtPositionAsync( 45public static async Task<ImmutableArray<ISymbol>> GetRecommendedSymbolsAtPositionAsync(
Remote\RemoteArguments.cs (7)
66Solution solution, ISymbol symbol, CancellationToken cancellationToken) 74public static SerializableSymbolAndProjectId Create(ISymbol symbol, Project project, CancellationToken cancellationToken) 78ISymbol symbol, Solution solution, CancellationToken cancellationToken, 92ISymbol symbol, Project project, CancellationToken cancellationToken, 105public async ValueTask<ISymbol?> TryRehydrateAsync( 114var symbol = SymbolKey.ResolveString( 212var symbol = await Alias.TryRehydrateAsync(solution, cancellationToken).ConfigureAwait(false);
Rename\ConflictEngine\ConflictResolver.cs (18)
53ISymbol symbol, 132private static ImmutableArray<ISymbol> SymbolsForEnclosingInvocationExpressionWorker(SyntaxNode invocationExpression, SemanticModel semanticModel, CancellationToken cancellationToken) 147private static bool LocalVariableConflictPerLanguage(SyntaxToken tokenOrNode, Document document, ImmutableArray<ISymbol> newReferencedSymbols) 170private static bool IsRenameValid(MutableConflictResolution conflictResolution, ISymbol renamedSymbol) 178ISymbol renamedSymbol, 179ISymbol originalSymbol, 231ISymbol renamedSymbol, 232ISymbol renameSymbol, 233IEnumerable<ISymbol> referencedSymbols, 248IEnumerable<ISymbol> otherThingsNamedTheSameExcludeMethodAndParameterizedProperty; 327private static void AddConflictingSymbolLocations(IEnumerable<ISymbol> conflictingSymbols, MutableConflictResolution conflictResolution, IDictionary<Location, Location> reverseMappedLocations) 329foreach (var newSymbol in conflictingSymbols) 348IEnumerable<ISymbol> symbols, 354foreach (var symbol in symbols) 361var overriddenSymbol = symbol.GetOverriddenMember(); 386private static string GetString(ISymbol symbol) 403private static async Task<Location?> GetSymbolLocationAsync(Solution solution, ISymbol symbol, CancellationToken cancellationToken) 407var originalsourcesymbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, solution, cancellationToken).ConfigureAwait(false);
Rename\ConflictEngine\ConflictResolver.Session.cs (17)
213var renamedSymbolInNewSolution = await GetRenamedSymbolInCurrentSolutionAsync(conflictResolution).ConfigureAwait(false); 314var renamedSymbolInNewSolution = await GetRenamedSymbolInCurrentSolutionAsync(conflictResolution).ConfigureAwait(false); 371ImmutableArray<ISymbol> newReferencedSymbols = default; 456var renameSymbol = _renameLocationSet.Symbol; 469private async Task<ImmutableHashSet<ISymbol>?> GetNonConflictSymbolsAsync(Project currentProject) 480ImmutableArray<ISymbol> symbols, ImmutableHashSet<ISymbol>? nonConflictSymbols) 484foreach (var symbol in symbols) 509ISymbol renamedSymbolInNewSolution, 511ImmutableArray<ISymbol> newReferencedSymbols) 569foreach (var symbol in newReferencedSymbols) 598var overridingSymbol = await SymbolFinder.FindSymbolAtPositionAsync(solution.GetRequiredDocument(newLocation.SourceTree), newLocation.SourceSpan.Start, cancellationToken: _cancellationToken).ConfigureAwait(false); 608var overriddenSymbol = overridingSymbol.GetOverriddenMember(); 647private ImmutableArray<ISymbol> GetSymbolsInNewSolution(Document newDocument, SemanticModel newDocumentSemanticModel, RenameActionAnnotation conflictAnnotation, SyntaxNodeOrToken tokenOrNode) 670private async Task<ISymbol> GetRenamedSymbolInCurrentSolutionAsync(MutableConflictResolution conflictResolution) 680var newSymbol = await SymbolFinder.FindSymbolAtPositionAsync(document, start, cancellationToken: _cancellationToken).ConfigureAwait(false); 701var symbol = _renameLocationSet.Symbol;
Rename\ConflictEngine\DeclarationConflictHelpers.cs (6)
37private static ImmutableArray<Location> GetConflictLocations(ISymbol renamedMember, 38IEnumerable<ISymbol> potentiallyConflictingMembers, 40Func<ISymbol, ImmutableArray<ImmutableArray<ITypeSymbol>>> getAllSignatures) 42var signatureToConflictingMember = new Dictionary<ImmutableArray<ITypeSymbol>, ISymbol>(ConflictingSignatureComparer.Instance); 44foreach (var member in potentiallyConflictingMembers) 56if (signatureToConflictingMember.TryGetValue(signature, out var conflictingSymbol))
Rename\IRemoteRenamerService.cs (1)
155ISymbol symbol, Solution solution, CodeCleanupOptionsProvider fallbackOptions, SerializableRenameLocations serializableLocations, CancellationToken cancellationToken)
Rename\IRenameRewriterLanguageService.cs (18)
36ISymbol symbol, 54ISymbol renamedSymbol, 55ISymbol renameSymbol, 56IEnumerable<ISymbol> referencedSymbols, 71ISymbol renameSymbol, 72ISymbol renamedSymbol, 86ISymbol renamedSymbol, 101IEnumerable<ISymbol> newReferencedSymbols); 126public abstract Task<ImmutableArray<Location>> ComputeDeclarationConflictsAsync(string replacementText, ISymbol renamedSymbol, ISymbol renameSymbol, IEnumerable<ISymbol> referencedSymbols, Solution baseSolution, Solution newSolution, IDictionary<Location, Location> reverseMappedLocations, CancellationToken cancellationToken); 127public abstract Task<ImmutableArray<Location>> ComputeImplicitReferenceConflictsAsync(ISymbol renameSymbol, ISymbol renamedSymbol, IEnumerable<ReferenceLocation> implicitReferenceLocations, CancellationToken cancellationToken); 128public abstract ImmutableArray<Location> ComputePossibleImplicitUsageConflicts(ISymbol renamedSymbol, SemanticModel semanticModel, Location originalDeclarationLocation, int newDeclarationLocationStartingPosition, CancellationToken cancellationToken); 131public abstract bool LocalVariableConflict(SyntaxToken token, IEnumerable<ISymbol> newReferencedSymbols); 132public abstract void TryAddPossibleNameConflicts(ISymbol symbol, string newName, ICollection<string> possibleNameConflicts); 135IEnumerable<ISymbol> properties, string newPropertyName, ArrayBuilder<Location> conflicts) 139foreach (var symbol in properties)
Rename\LightweightRenameLocations.cs (3)
53public async Task<SymbolicRenameLocations?> ToSymbolicLocationsAsync(ISymbol symbol, CancellationToken cancellationToken) 78ISymbol symbol, Solution solution, SymbolRenameOptions options, CodeCleanupOptionsProvider fallbackOptions, CancellationToken cancellationToken) 123public Task<ConflictResolution> ResolveConflictsAsync(ISymbol symbol, string replacementText, ImmutableArray<SymbolKey> nonConflictSymbolKeys, CancellationToken cancellationToken)
Rename\Renamer.cs (5)
42public static Task<Solution> RenameSymbolAsync(Solution solution, ISymbol symbol, string newName, OptionSet? optionSet, CancellationToken cancellationToken = default) 46Solution solution, ISymbol symbol, SymbolRenameOptions options, string newName, CancellationToken cancellationToken = default) 151internal static Task<LightweightRenameLocations> FindRenameLocationsAsync(Solution solution, ISymbol symbol, SymbolRenameOptions options, CodeCleanupOptionsProvider fallbackOptions, CancellationToken cancellationToken) 156ISymbol symbol, 204ISymbol symbol,
Rename\Renamer.RenameSymbolDocumentAction.cs (2)
53var symbol = semanticModel.GetRequiredDeclaredSymbol(matchingTypeDeclaration, cancellationToken); 109var symbol = semanticModel.GetDeclaredSymbol(matchingDeclaration, cancellationToken);
Rename\RenameRewriterParameters.cs (2)
27internal readonly ISymbol RenameSymbol; 48ISymbol renameSymbol,
Rename\RenameUtilities.cs (23)
26internal static SyntaxToken UpdateAliasAnnotation(SyntaxToken token, ISymbol aliasSymbol, string replacementText) 44internal static ImmutableArray<ISymbol> GetSymbolsTouchingPosition( 50? ImmutableArray.Create<ISymbol>(semanticInfo.DeclaredSymbol) 73private static bool IsSymbolDefinedInsideMethod(ISymbol symbol) 82internal static IEnumerable<Document> GetDocumentsAffectedByRename(ISymbol symbol, Solution solution, IEnumerable<RenameLocation> renameLocations) 120private static bool ShouldRenameOnlyAffectDeclaringProject(ISymbol symbol) 151var symbol = semanticFacts.GetDeclaredSymbol(semanticModel, token, cancellationToken); 186public static IEnumerable<ISymbol> GetOverloadedSymbols(ISymbol symbol) 193foreach (var member in containingType.GetMembers()) 204public static async Task<ISymbol?> TryGetPropertyFromAccessorOrAnOverrideAsync( 205ISymbol symbol, Solution solution, CancellationToken cancellationToken) 214var originalSourceSymbol = await SymbolFinder.FindSourceDefinitionAsync( 229foreach (var methodImplementor in methodImplementors) 231var propertyAccessorOrAnOverride = await TryGetPropertyFromAccessorOrAnOverrideAsync(methodImplementor, solution, cancellationToken).ConfigureAwait(false); 299public static async Task<ISymbol?> TryGetRenamableSymbolAsync( 302var symbol = await SymbolFinder.FindSymbolAtPositionAsync(document, position, cancellationToken: cancellationToken).ConfigureAwait(false); 306var definitionSymbol = await FindDefinitionSymbolAsync(symbol, document.Project.Solution, cancellationToken).ConfigureAwait(false); 315public static async Task<ISymbol> FindDefinitionSymbolAsync( 316ISymbol symbol, Solution solution, CancellationToken cancellationToken) 322var foundSymbol = await SymbolFinder.FindSourceDefinitionAsync( 325var bestSymbol = foundSymbol ?? symbol; 381var property = await RenameUtilities.TryGetPropertyFromAccessorOrAnOverrideAsync(bestSymbol, solution, cancellationToken).ConfigureAwait(false);
Rename\SymbolicRenameLocations.cs (9)
31public readonly ISymbol Symbol; 37public readonly ImmutableArray<ISymbol> ReferencedSymbols; 40ISymbol symbol, 46ImmutableArray<ISymbol> referencedSymbols) 66ISymbol symbol, Solution solution, SymbolRenameOptions options, CodeCleanupOptionsProvider cleanupOptions, CancellationToken cancellationToken) 90using var _1 = ArrayBuilder<ISymbol>.GetInstance(out var mergedReferencedSymbols); 122ISymbol symbol, Solution solution, CancellationToken cancellationToken) 126foreach (var overloadedSymbol in RenameUtilities.GetOverloadedSymbols(symbol)) 133ISymbol symbol,
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (11)
31ISymbol referencedSymbol, ISymbol originalSymbol, Solution solution, bool considerSymbolReferences, CancellationToken cancellationToken) 116static bool IsConstructorForType(ISymbol possibleConstructor, ISymbol possibleType) 125ISymbol symbol, Solution solution, CancellationToken cancellationToken) 127var result = await RenameUtilities.TryGetPropertyFromAccessorOrAnOverrideAsync( 150ISymbol referencedSymbol, ISymbol originalSymbol, Solution solution, CancellationToken cancellationToken) 231internal static async Task<IEnumerable<RenameLocation>> GetRenamableReferenceLocationsAsync(ISymbol referencedSymbol, ISymbol originalSymbol, ReferenceLocation location, Solution solution, CancellationToken cancellationToken) 313ISymbol originalSymbol,
Rename\SymbolicRenameLocations.SearchResult.cs (2)
17public readonly ImmutableArray<ISymbol> ReferencedSymbols; 22ImmutableArray<ISymbol> referencedSymbols)
Rename\TokenRenameInfo.cs (5)
13public IEnumerable<ISymbol> Symbols { get; private set; } 16public TokenRenameInfo(bool hasSymbols, IEnumerable<ISymbol> symbols, bool isMemberGroup) 23public static TokenRenameInfo CreateMemberGroupTokenInfo(IEnumerable<ISymbol> symbols) 33public static TokenRenameInfo CreateSingleSymbolTokenInfo(ISymbol symbol) 47symbols: SpecializedCollections.EmptyEnumerable<ISymbol>()
SemanticModelExtensions.cs (11)
47public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 59public static ISymbol GetRequiredEnclosingSymbol(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 66where TSymbol : class, ISymbol 68for (var symbol = semanticModel.GetEnclosingSymbol(position, cancellationToken); 81public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken) 84(ISymbol)semanticModel.Compilation.Assembly; 93public static IEnumerable<ISymbol> GetExistingSymbols( 115public static HashSet<ISymbol> GetAllDeclaredSymbols( 118var symbols = new HashSet<ISymbol>(); 129HashSet<ISymbol> symbols, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 131var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
Shared\Extensions\IFindReferencesResultExtensions.cs (4)
20this ISymbol definition) 47this ISymbol definition, FindReferencesSearchOptions options, bool showMetadataSymbolsWithoutReferences) 111ISymbol symbol) 121ISymbol symbol)
Shared\Extensions\IMethodSymbolExtensions.cs (2)
181this IMethodSymbol method, ISymbol accessibleWithin, 211static bool shouldRemoveAttribute(AttributeData a, (INamedTypeSymbol[] removeAttributeTypes, ISymbol accessibleWithin) arg)
Shared\Extensions\INamespaceSymbolExtensions.cs (1)
194foreach (var namespaceOrType in members)
Shared\Extensions\IPropertySymbolExtensions.cs (2)
41this IPropertySymbol property, ISymbol accessibleWithin, params INamedTypeSymbol[] attributesToRemove) 69static bool ShouldRemoveAttribute(AttributeData a, (INamedTypeSymbol[] attributesToRemove, ISymbol accessibleWithin) arg)
Shared\Extensions\ISymbolExtensions.cs (23)
38this ISymbol symbol, 52this ISymbol symbol, 93ISymbol symbol, 113ISymbol symbol, INamedTypeSymbol? hideModuleNameAttribute, ImmutableArray<AttributeData> attributes = default) 227public static DocumentationComment GetDocumentationComment(this ISymbol symbol, Compilation compilation, CultureInfo? preferredCulture = null, bool expandIncludes = false, bool expandInheritdoc = false, CancellationToken cancellationToken = default) 230private static DocumentationComment GetDocumentationComment(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, CultureInfo? preferredCulture, bool expandIncludes, bool expandInheritdoc, CancellationToken cancellationToken) 266static bool IsEligibleForAutomaticInheritdoc(ISymbol symbol) 303private static XNode[] RewriteInheritdocElements(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode node, CancellationToken cancellationToken) 340private static XNode[] RewriteMany(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode[] nodes, CancellationToken cancellationToken) 351private static XNode[]? RewriteInheritdocElement(ISymbol memberSymbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XElement element, CancellationToken cancellationToken) 356var candidate = GetCandidateSymbol(memberSymbol); 367ISymbol? symbol; 383visitedSymbols ??= new HashSet<ISymbol>(); 465static ISymbol? GetCandidateSymbol(ISymbol memberSymbol) 649this ImmutableArray<T> symbols, bool hideAdvancedMembers, Compilation compilation) where T : ISymbol 672private static ImmutableArray<T> RemoveOverriddenSymbolsWithinSet<T>(this ImmutableArray<T> symbols) where T : ISymbol 678var overriddenMember = symbol.GetOverriddenMember(); 687this ImmutableArray<T> symbols, bool hideAdvancedMembers, Compilation compilation) where T : ISymbol
Shared\Extensions\ISymbolExtensions_2.cs (1)
11public static bool IsImplicitValueParameter([NotNullWhen(returnValue: true)] this ISymbol? symbol)
Shared\Extensions\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
21public override ITypeSymbol DefaultVisit(ISymbol node)
Shared\Extensions\ITypeSymbolExtensions.cs (13)
30public static async Task<ImmutableArray<ISymbol>> FindImplementationsForInterfaceMemberAsync( 32ISymbol interfaceMember, 45using var _ = ArrayBuilder<ISymbol>.GetInstance(out var builder); 50return ImmutableArray<ISymbol>.Empty; 56return ImmutableArray<ISymbol>.Empty; 80return ImmutableArray<ISymbol>.Empty; 88var originalInterfaceMember = interfaceMember.OriginalDefinition; 99var constructedInterfaceMember = 118var result = currentType.FindImplementations(constructedInterfaceMember, solution.Services); 132public static ISymbol? FindImplementations(this ITypeSymbol typeSymbol, ISymbol constructedInterfaceMember, SolutionServices services) 141private static ISymbol? FindImplementations<TSymbol>( 144SolutionServices services) where TSymbol : class, ISymbol
Shared\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
31public override ITypeSymbol DefaultVisit(ISymbol node)
Shared\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
26public override ITypeSymbol DefaultVisit(ISymbol node)
Shared\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
21public override ITypeSymbol DefaultVisit(ISymbol node)
Shared\Extensions\SemanticEquivalence.cs (1)
139return EqualityComparer<ISymbol>.Default.Equals(info1.Symbol, info2.Symbol);
Shared\Extensions\SemanticModelExtensions.cs (10)
23private static ISymbol? MapSymbol(ISymbol? symbol, ITypeSymbol? type) 90ISymbol? declaredSymbol = null; 91var allSymbols = ImmutableArray<ISymbol?>.Empty; 102var overriddingSymbol = semanticFacts.GetDeclaredSymbol(semanticModel, overriddingIdentifier.Value, cancellationToken); 103var overriddenSymbol = overriddingSymbol.GetOverriddenMember(); 105allSymbols = overriddenSymbol is null ? ImmutableArray<ISymbol?>.Empty : ImmutableArray.Create<ISymbol?>(overriddenSymbol); 118? ImmutableArray<ISymbol?>.Empty 143allSymbols = ImmutableArray.Create<ISymbol?>(type);
Shared\Extensions\SyntaxGeneratorExtensions.cs (20)
43public static ImmutableArray<ISymbol> CreateMemberDelegatingConstructor( 50ImmutableDictionary<string, ISymbol>? parameterToExistingMemberMap, 81IDictionary<string, ISymbol>? parameterToExistingFieldMap) 94.Except(parameterToExistingFieldMap?.Values ?? SpecializedCollections.EmptyEnumerable<ISymbol>()) 101public static ImmutableArray<ISymbol> CreateFieldsForParameters( 104using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 123public static ImmutableArray<ISymbol> CreatePropertiesForParameters( 126using var _ = ArrayBuilder<ISymbol>.GetInstance(out var result); 161private static bool TryGetValue(IDictionary<string, ISymbol>? dictionary, string key, [NotNullWhen(true)] out string? value) 164if (dictionary != null && dictionary.TryGetValue(key, out var symbol)) 216IDictionary<string, ISymbol>? parameterToExistingFieldMap, 466public static async Task<ISymbol> OverrideAsync( 468ISymbol symbol, 496private static DeclarationModifiers GetOverrideModifiers(ISymbol symbol) 556this SyntaxGenerator generator, IMethodSymbol method, ISymbol throughMember) 575this SyntaxGenerator generator, ISymbol member, ISymbol throughMember) 640static SyntaxNode GenerateContainerName(SyntaxGenerator factory, ISymbol throughMember) 651IPropertySymbol property, ISymbol? throughMember, bool preferAutoProperties) 675IPropertySymbol property, ISymbol? throughMember, bool preferAutoProperties)
Shared\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (6)
30ImmutableArray<ISymbol> symbols, 61ImmutableArray<ISymbol> symbols, 107ImmutableArray<ISymbol> members, 211ImmutableArray<ISymbol> members, SyntaxNode localNameExpression, 220foreach (var member in members) 268ImmutableArray<ISymbol> members)
Shared\Extensions\TokenSemanticInfo.cs (8)
17null, null, ImmutableArray<ISymbol>.Empty, null, null, default); 19public readonly ISymbol DeclaredSymbol; 21public readonly ImmutableArray<ISymbol> ReferencedSymbols; 27ISymbol declaredSymbol, 29ImmutableArray<ISymbol> referencedSymbols, 42public ImmutableArray<ISymbol> GetSymbols(bool includeType) 44var result = ArrayBuilder<ISymbol>.GetInstance(); 57public ISymbol GetAnySymbol(bool includeType)
Shared\Utilities\SemanticMap.cs (1)
33public IEnumerable<ISymbol> AllReferencedSymbols
Shared\Utilities\SignatureComparer.cs (4)
27public bool HaveSameSignature(ISymbol symbol1, ISymbol symbol2, bool caseSensitive) 139public bool HaveSameSignatureAndConstraintsAndReturnTypeAndAccessors(ISymbol symbol1, ISymbol symbol2, bool caseSensitive)
SimplificationHelpers.cs (4)
64public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 70var typeSymbol = SymbolAnnotation.GetSymbol(annotation1, semanticModel.Compilation); 94public static bool IsValidSymbolInfo([NotNullWhen(true)] ISymbol? symbol) 115internal static bool ShouldSimplifyThisOrMeMemberAccessExpression(SimplifierOptions options, ISymbol symbol)
SymbolAnnotation.cs (3)
17public static SyntaxAnnotation Create(ISymbol symbol) 20public static ISymbol? GetSymbol(SyntaxAnnotation annotation, Compilation compilation) 23public static ImmutableArray<ISymbol> GetSymbols(SyntaxAnnotation annotation, Compilation compilation)
SymbolEquivalenceComparer.cs (12)
37IEqualityComparer<ISymbol?> 137public bool Equals(ISymbol? x, ISymbol? y) 146public bool Equals(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 152private bool EqualsCore(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 155public int GetHashCode(ISymbol? x) 158private static ISymbol UnwrapAlias(ISymbol symbol) 161private static SymbolKind GetKindAndUnwrapAlias(ref ISymbol symbol) 179private static bool IsObjectType(ISymbol symbol)
SymbolEquivalenceComparer.EquivalenceVisitor.cs (6)
37public bool AreEquivalent(ISymbol? x, ISymbol? y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 113private bool AreEquivalentWorker(ISymbol x, ISymbol y, SymbolKind k, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 273private static bool HaveSameLocation(ISymbol x, ISymbol y)
SymbolEquivalenceComparer.GetHashCodeVisitor.cs (4)
22private readonly Func<int, ISymbol, int> _symbolAggregator; 36public int GetHashCode(ISymbol? x, int currentHash) 59private int GetHashCodeWorker(ISymbol x, int currentHash) 152foreach (var candidate in errorType.CandidateSymbols)
SymbolInfoExtensions.cs (6)
14public static ImmutableArray<ISymbol> GetAllSymbols(this SymbolInfo info) 17private static ImmutableArray<ISymbol> GetAllSymbolsWorker(this SymbolInfo info) 25var builder = ArrayBuilder<ISymbol>.GetInstance(info.CandidateSymbols.Length + 1); 32public static ISymbol? GetAnySymbol(this SymbolInfo info) 35public static ImmutableArray<ISymbol> GetBestOrAllSymbols(this SymbolInfo info) 46return ImmutableArray<ISymbol>.Empty;
SymbolKey.AbstractSymbolKey.cs (1)
10where TSymbol : class, ISymbol
SymbolKey.AliasSymbolKey.cs (3)
40var target = targetResolution.GetAnySymbol(); 58SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target, 61var symbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken);
SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (2)
21public static void Create(ISymbol symbol, SymbolKeyWriter visitor) 57var symbol = semanticModel.GetSymbolInfo(node, reader.CancellationToken)
SymbolKey.BodyLevelSymbolKey.cs (8)
20public static ImmutableArray<Location> GetBodyLevelSourceLocations(ISymbol symbol, CancellationToken cancellationToken) 39public static void Create(ISymbol symbol, SymbolKeyWriter visitor) 70var container = symbol.ContainingSymbol; 101private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 207foreach (var container in containingSymbol) 231var symbol = resolution.GetAnySymbol(); 255private static IEnumerable<(ISymbol symbol, int ordinal)> EnumerateSymbols( 264var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
SymbolKey.cs (30)
30/// the "same" <see cref="ISymbol.ContainingType"/> and 31/// equal <see cref="ISymbol.MetadataName"/>.</item> 33/// the "same" <see cref="ISymbol.ContainingType"/>, 34/// equal <see cref="ISymbol.MetadataName"/>, 40/// the "same" <see cref="ISymbol.ContainingAssembly"/>. 41/// <see cref="ISymbol.MetadataName"/> is not used because module identity is not important in practice.</item> 43/// the "same" <see cref="ISymbol.ContainingSymbol"/>, 44/// equal <see cref="ISymbol.MetadataName"/>, 48/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 49/// equal <see cref="ISymbol.MetadataName"/>. 54/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 55/// equal <see cref="ISymbol.MetadataName"/>.</item> 59/// the "same" the "same" <see cref="ISymbol.ContainingType"/>, 60/// the "same" <see cref="ISymbol.MetadataName"/>, and have 64/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 65/// the "same" <see cref="ISymbol.MetadataName"/>.</item> 67/// the "same" <see cref="ISymbol.ContainingSymbol"/> and 68/// the "same" <see cref="ISymbol.MetadataName"/>.</item> 75/// cref="SyntaxTree"/> is enumerated to list all the symbols with the same <see cref="ISymbol.Name"/> and <see 76/// cref="ISymbol.Kind"/> as the original symbol. The symbol with the same index in the destination tree as the 134public static SymbolKey Create(ISymbol? symbol, CancellationToken cancellationToken = default) 153public static bool CanCreate(ISymbol symbol, CancellationToken cancellationToken) 206public static string CreateString(ISymbol? symbol, CancellationToken cancellationToken = default) 210internal static string CreateStringWorker(int version, ISymbol? symbol, CancellationToken cancellationToken = default) 237/// to the corresponding <see cref="ISymbol"/> in a future <see cref="Compilation"/>. 248where TSymbol : class, ISymbol 264ImmutableArray<ISymbol>.CastUp(symbols.Builder.ToImmutable()), 301string? metadataName) where TSymbol : ISymbol 310foreach (var member in members) 320public static bool IsBodyLevelSymbol(ISymbol symbol)
SymbolKey.NamespaceSymbolKey.cs (3)
64var containingContextualSymbol = containerKind switch 693 => (ISymbol?)null, 90foreach (var container in containingSymbolResolution)
SymbolKey.ParameterSymbolKey.cs (1)
39foreach (var container in containingSymbolResolution)
SymbolKey.SymbolKeyReader.cs (14)
332private readonly Stack<ISymbol?> _contextualSymbolStack = new(); 385where TOwningSymbol : ISymbol 425public ContextualSymbolPopper PushContextualSymbol(ISymbol? contextualSymbol) 431private void PopContextualSymbol(ISymbol? contextualSymbol) 438public ISymbol? CurrentContextualSymbol 459private readonly ISymbol? _contextualSymbol; 461public ContextualSymbolPopper(SymbolKeyReader reader, ISymbol? contextualSymbol) 486public SymbolKeyResolution ReadSymbolKey(ISymbol? contextualSymbol, out string? failureReason) 556Func<TContextualSymbol, int, ISymbol?>? getContextualSymbol, 575var nextContextualSymbol = contextualSymbol is null ? null : getContextualSymbol?.Invoke(contextualSymbol, i); 608Func<TContextualSymbol, int, ISymbol?>? getContextualSymbol, 610where TContextualSymbol : ISymbol 611where TSymbol : ISymbol 746var symbol = semanticModel.GetDeclaredSymbol(node, CancellationToken);
SymbolKey.SymbolKeyWriter.cs (5)
57private readonly Action<ISymbol> _writeSymbolKey; 64private readonly Dictionary<ISymbol, int> _symbolToId = new(); 128internal void WriteSymbolKey(ISymbol? symbol) 273where TSymbol : ISymbol 490public bool ShouldWriteTypeParameterOrdinal(ISymbol symbol, out int methodIndex)
SymbolKey.TupleTypeSymbolKey.cs (1)
41using var _3 = ArrayBuilder<ISymbol>.GetInstance(out var elementTypes);
SymbolKey.TypeParameterSymbolKey.cs (1)
61foreach (var containingSymbol in containingSymbolResolution)
SymbolKeyExtensions.cs (1)
11public static SymbolKey GetSymbolKey(this ISymbol? symbol, CancellationToken cancellationToken = default)
SymbolKeyResolution.cs (8)
11/// single <see cref="ISymbol"/> then that will be returned in <see cref="Symbol"/>. Otherwise, if the key resolves 20private readonly ImmutableArray<ISymbol> _candidateSymbols; 22internal SymbolKeyResolution(ISymbol? symbol) 29internal SymbolKeyResolution(ImmutableArray<ISymbol> candidateSymbols, CandidateReason candidateReason) 38public ISymbol? Symbol { get; } 40public ImmutableArray<ISymbol> CandidateSymbols => _candidateSymbols.NullToEmpty(); 42public Enumerator<ISymbol> GetEnumerator() 45internal Enumerable<TSymbol> OfType<TSymbol>() where TSymbol : ISymbol
SymbolKeyResolution.Enumeration.cs (2)
9public readonly struct Enumerable<TSymbol> where TSymbol : ISymbol 20public struct Enumerator<TSymbol> where TSymbol : ISymbol
SymbolKeyResolutionExtensions.cs (1)
9internal static ISymbol? GetAnySymbol(this SymbolKeyResolution resolution)
SymbolSpecification.cs (7)
101public bool AppliesTo(ISymbol symbol) 163private static bool AnyMatches<TSymbolMatcher>(ImmutableArray<TSymbolMatcher> matchers, ISymbol symbol) 177private static bool AnyMatches(ImmutableArray<Accessibility> matchers, ISymbol symbol) 190private static bool AllMatches<TSymbolMatcher>(ImmutableArray<TSymbolMatcher> matchers, ISymbol symbol) 350bool MatchesSymbol(ISymbol symbol); 396public bool MatchesSymbol(ISymbol symbol) 519public bool MatchesSymbol(ISymbol symbol)
SymbolUsageAnalysis.AnalysisData.cs (14)
35private readonly PooledHashSet<ISymbol> _referenceTakenSymbolsBuilder; 40_referenceTakenSymbolsBuilder = PooledHashSet<ISymbol>.GetInstance(); 61protected abstract PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 66protected abstract PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 132public abstract void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId); 137public abstract void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol); 143protected static PooledDictionary<(ISymbol Symbol, IOperation Write), bool> CreateSymbolsWriteMap( 146var symbolsWriteMap = PooledDictionary<(ISymbol Symbol, IOperation Write), bool>.GetInstance(); 150protected static PooledDictionary<(ISymbol Symbol, IOperation Write), bool> UpdateSymbolsWriteMap( 151PooledDictionary<(ISymbol Symbol, IOperation Write), bool> symbolsWriteMap, 158(ISymbol, IOperation) key = (parameter, null); 178public void OnReadReferenceFound(ISymbol symbol) 199public void OnWriteReferenceFound(ISymbol symbol, IOperation operation, bool maybeWritten, bool isRef) 235foreach (var symbol in SymbolsWriteBuilder.Keys.Select(d => d.symbol).ToArray())
SymbolUsageAnalysis.BasicBlockAnalysisData.cs (8)
30private readonly Dictionary<ISymbol, PooledHashSet<IOperation>> _reachingWrites; 33=> _reachingWrites = new Dictionary<ISymbol, PooledHashSet<IOperation>>(); 64public void Clear(ISymbol symbol) 76public IEnumerable<IOperation> GetCurrentWrites(ISymbol symbol) 91public void OnWriteReferenceFound(ISymbol symbol, IOperation operation, bool maybeWritten) 115var uniqueSymbols = PooledHashSet<ISymbol>.GetInstance(); 128foreach (var symbol in uniqueSymbols) 195private static void AddEntries(Dictionary<ISymbol, PooledHashSet<IOperation>> result, BasicBlockAnalysisData source)
SymbolUsageAnalysis.cs (2)
25public static SymbolUsageResult Run(ControlFlowGraph cfg, ISymbol owningSymbol, CancellationToken cancellationToken) 32public static SymbolUsageResult Run(IOperation rootOperation, ISymbol owningSymbol, CancellationToken cancellationToken)
SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
25private DataFlowAnalyzer(ControlFlowGraph cfg, ISymbol owningSymbol) 40public static SymbolUsageResult RunAnalysis(ControlFlowGraph cfg, ISymbol owningSymbol, CancellationToken cancellationToken)
SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (17)
41private readonly PooledDictionary<CaptureId, PooledHashSet<(ISymbol, IOperation)>> _lValueFlowCapturesMap; 69private readonly PooledDictionary<(int firstBlockOrdinal, int lastBlockOrdinal), PooledHashSet<(ISymbol, IOperation)>> _symbolWritesInsideBlockRangeMap; 73ISymbol owningSymbol, 77PooledDictionary<(ISymbol symbol, IOperation operation), bool> symbolsWriteMap, 78PooledHashSet<ISymbol> symbolsRead, 99_lValueFlowCapturesMap = PooledDictionary<CaptureId, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 103_symbolWritesInsideBlockRangeMap = PooledDictionary<(int firstBlockOrdinal, int lastBlockOrdinal), PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 106public ISymbol OwningSymbol { get; } 108protected override PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 110protected override PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 118ISymbol owningSymbol, 131symbolsRead: PooledHashSet<ISymbol>.GetInstance(), 216private PooledHashSet<(ISymbol, IOperation)> GetOrCreateSymbolWritesInBlockRange(int firstBlockOrdinal, int lastBlockOrdinal, CancellationToken cancellationToken) 225writesInBlockRange = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 461public override void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 465captures = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 513public override void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol)
SymbolUsageAnalysis.OperationTreeAnalysisData.cs (8)
24PooledDictionary<(ISymbol symbol, IOperation operation), bool> symbolsWriteMap, 25PooledHashSet<ISymbol> symbolsRead, 35protected override PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 37protected override PooledDictionary<(ISymbol symbol, IOperation operation), bool> SymbolsWriteBuilder { get; } 42ISymbol owningSymbol, 47symbolsRead: PooledHashSet<ISymbol>.GetInstance(), 66public override void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 78public override void SetTargetsFromSymbolForDelegate(IOperation write, ISymbol symbol)
SymbolUsageAnalysis.Walker.cs (13)
27private ISymbol _currentContainingSymbol; 30private PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>> _pendingWritesMap; 36ISymbol containingSymbol, 52private void Visit(ISymbol containingSymbol, IEnumerable<IOperation> operations, AnalysisData analysisData, CancellationToken cancellationToken) 59_pendingWritesMap = PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 91private void OnReadReferenceFound(ISymbol symbol) 94private void OnWriteReferenceFound(ISymbol symbol, IOperation operation, ValueUsageInfo valueUsageInfo) 102private void OnLValueCaptureFound(ISymbol symbol, IOperation operation, CaptureId captureId) 108private void OnReferenceFound(ISymbol symbol, IOperation operation) 160private bool MakePendingWrite(IOperation operation, ISymbol symbolOpt) 167var set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 176set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 380private void ProcessPossibleDelegateCreationAssignment(ISymbol symbol, IOperation write)
SymbolUsageResult.cs (6)
17ImmutableDictionary<(ISymbol symbol, IOperation write), bool> symbolWritesMap, 18ImmutableHashSet<ISymbol> symbolsRead) 40public ImmutableDictionary<(ISymbol symbol, IOperation write), bool> SymbolWritesMap { get; } 45public ImmutableHashSet<ISymbol> SymbolsRead { get; } 54public IEnumerable<(ISymbol Symbol, IOperation WriteOperation)> GetUnreadSymbolWrites() 78public int GetSymbolWriteCount(ISymbol symbol)
SyntaxAnnotationExtensions.cs (1)
16where TSymbol : ISymbol
SyntaxGeneratorExtensions.cs (1)
72private static ITypeSymbol GetType(Compilation compilation, ISymbol symbol)
SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (5)
22ImmutableArray<ISymbol> members, 33foreach (var member in members) 84ImmutableArray<ISymbol> members, 104foreach (var symbol in members) 221ISymbol member,
Utilities\Documentation\DeferredDocumentationProvider.cs (1)
37var symbol = DocumentationCommentId.GetFirstSymbolForDeclarationId(documentationMemberID, _compilation);
Workspace\Solution\Solution.cs (2)
167internal ProjectId? GetOriginatingProjectId(ISymbol symbol) 171internal Project? GetOriginatingProject(ISymbol symbol)
Workspace\Solution\SolutionState.CompilationTracker.CompilationTrackerState.cs (3)
237/// cref="Solution.GetOriginatingProject(ISymbol)"/>. If <see cref="Compilation"/>s from other <see 319var symbol = compilation.GetAssemblyOrModuleSymbol(metadataReference); 325private static void RecordSourceOfAssemblySymbol(ISymbol? assemblyOrModuleSymbol, ProjectId projectId)
Workspace\Solution\SolutionState.CompilationTracker.cs (1)
86public bool ContainsAssemblyOrModuleOrDynamic(ISymbol symbol, bool primary)
Workspace\Solution\SolutionState.cs (4)
71private ConditionalWeakTable<ISymbol, ProjectId?>? _unrootedSymbolToProjectId; 72private static readonly Func<ConditionalWeakTable<ISymbol, ProjectId?>> s_createTable = () => new ConditionalWeakTable<ISymbol, ProjectId?>(); 1954private static readonly ConditionalWeakTable<ISymbol, ProjectId> s_assemblyOrModuleSymbolToProjectMap = new();
Workspace\Solution\SolutionState.GeneratedFileReplacingCompilationTracker.cs (1)
48public bool ContainsAssemblyOrModuleOrDynamic(ISymbol symbol, bool primary)
Workspace\Solution\SolutionState.ICompilationTracker.cs (1)
36bool ContainsAssemblyOrModuleOrDynamic(ISymbol symbol, bool primary);
Workspace\Solution\SolutionState.SymbolToProjectId.cs (5)
16public ProjectId? GetOriginatingProjectId(ISymbol? symbol) 68private ProjectId? GetOriginatingProjectIdWorker(ISymbol symbol) 88ISymbol symbol, ConditionalWeakTable<ISymbol, ProjectId?> unrootedSymbolToProjectId) 144ProjectId? TryGetProjectId(ISymbol symbol, bool primary)
Workspace\Solution\SolutionState.UnrootedSymbolSet.cs (14)
17/// A helper type for mapping <see cref="ISymbol"/> back to an originating <see cref="Project"/>. 20/// In IDE scenarios we have the need to map from an <see cref="ISymbol"/> to the <see cref="Project"/> that 28/// cref="ISymbol"/>. In other words, the <see cref="ISymbol"/> doesn't <c>root</c> the compilation. Because 54public readonly ImmutableArray<(int hashCode, WeakReference<ISymbol> symbol)> SecondaryReferencedSymbols; 59ImmutableArray<(int hashCode, WeakReference<ISymbol> symbol)> secondaryReferencedSymbols) 77using var _ = ArrayBuilder<(int hashcode, WeakReference<ISymbol> symbol)>.GetInstance( 82var symbol = compilation.GetAssemblyOrModuleSymbol(reference); 86secondarySymbols.Add((ReferenceEqualityComparer.GetHashCode(symbol), new WeakReference<ISymbol>(symbol))); 96public bool ContainsAssemblyOrModuleOrDynamic(ISymbol symbol, bool primary) 124if (cached.TryGetTarget(out var otherSymbol) && otherSymbol == symbol) 134private class WeakSymbolComparer : IComparer<(int hashcode, WeakReference<ISymbol> symbol)> 142public int Compare((int hashcode, WeakReference<ISymbol> symbol) x, (int hashcode, WeakReference<ISymbol> symbol) y)
Microsoft.CodeAnalysis.Workspaces.UnitTests (63)
FindAllDeclarationsTests.cs (2)
184var actualSymbol = (await SymbolFinder.FindDeclarationsAsync(solution.GetProject(submission1Id), "Inner", ignoreCase: false)).SingleOrDefault(); 185var expectedSymbol = (await solution.GetProject(submission0Id).GetCompilationAsync()).GlobalNamespace.GetMembers("Outer").SingleOrDefault().GetMembers("Inner").SingleOrDefault();
FindAllDeclarationsTests.TestSolutionsAndProject.cs (3)
30private static void Verify(string searchTerm, bool respectCase, SolutionKind workspaceKind, IEnumerable<ISymbol> declarations, params string[] expectedResults) 47private static void Verify(SolutionKind workspaceKind, IEnumerable<ISymbol> declarations, params string[] expectedResults) 62private static void VerifyResults(IEnumerable<ISymbol> declarations, string[] expectedResults)
FindReferencesTests.cs (8)
87var symbol = (await project.GetCompilationAsync()).GetTypeByMetadataName("C").GetMembers("X").First(); 170var symbol = semanticModel.GetDeclaredSymbol(declareMethod); 206var symbol = semanticModel.GetDeclaredSymbol(propertyStatement); 274var symbol = semanticModel.GetDeclaredSymbol(declareMethod); 311var boo = typeB.GetMembers("Boo").First(); 423var nameProperty = compilation.GetTypeByMetadataName("A.C").GetMembers("Uri").Single(); 467var baseVirtualMethodSymbol = baseType.GetMembers("SomeMethod").Single(); 471var overriddenMethodSymbol = derivedType.GetMembers("SomeMethod").Single();
SerializationTests.cs (3)
69var symbol = model.GetSpeculativeSymbolInfo(0, name, SpeculativeBindingOption.BindAsExpression).Symbol; 89var id = SymbolAnnotation.GetSymbol(annotation, model.Compilation); 90var did = SymbolAnnotation.GetSymbol(dannotation, model.Compilation);
SymbolKeyTests.cs (42)
58foreach (var symbol in GetDeclaredSymbols(compilation)) 65static void Test(ISymbol symbol, Compilation compilation) 72static void TestVersion(ISymbol symbol, Compilation compilation, int version) 76var found = SymbolKey.ResolveString(id, compilation).GetAnySymbol(); 714var a_b_m = a_b.GetMembers().Single(s => s.Name == "M"); 722var a_string_b_m = a_string_b.GetMembers().Single(s => s.Name == "M"); 728var a_string_b_int_m = a_string_b_int.GetMembers().Single(s => s.Name == "M"); 736var a_b_int_m = a_b_int.GetMembers().Single(s => s.Name == "M"); 812var xSymbol = testModel.LookupSymbols(position).First(s => s.Name == "x"); 859var xSymbol = testModel.LookupSymbols(position).First(s => s.Name == "x"); 914foreach (var symbol in symbols) 919var found = SymbolKey.ResolveString(id, compilation).GetAnySymbol(); 950var symbol = GetAllSymbols( 960var found = SymbolKey.ResolveString(id, compilation2).GetAnySymbol(); 987var symbol = GetAllSymbols( 997var found = SymbolKey.ResolveString(id, compilation2).GetAnySymbol(); 1033var found = SymbolKey.ResolveString(id, compilation2).GetAnySymbol(); 1068var found = SymbolKey.ResolveString(id, compilation2).GetAnySymbol(); 1117var found = SymbolKey.ResolveString(id, compilation2).GetAnySymbol(); 1164var found = SymbolKey.ResolveString(id, compilation2).GetAnySymbol(); 1216var found = SymbolKey.ResolveString(id, compilation1).GetAnySymbol(); 1228var found = SymbolKey.ResolveString(id, compilation1).GetAnySymbol(); 1351foreach (var symbol in symbols) 1366private static void TestRoundTrip(IEnumerable<ISymbol> symbols, Compilation compilation, Func<ISymbol, object> fnId = null) 1368foreach (var symbol in symbols) 1374private static void TestRoundTrip(ISymbol symbol, Compilation compilation, Func<ISymbol, object> fnId = null) 1378var found = SymbolKey.ResolveString(id, compilation).GetAnySymbol(); 1415private List<ISymbol> GetAllSymbols( 1418var list = new List<ISymbol>(); 1425List<ISymbol> list, Func<SyntaxNode, bool> predicate) 1429var symbol = model.GetDeclaredSymbol(node); 1451private List<ISymbol> GetDeclaredSymbols(Compilation compilation) 1453var list = new List<ISymbol>(); 1458private void GetDeclaredSymbols(INamespaceOrTypeSymbol container, List<ISymbol> symbols) 1460foreach (var member in container.GetMembers()) 1471private static IEnumerable<ISymbol> GetInteriorSymbols(ISymbol containingSymbol, Compilation compilation) 1473var results = new List<ISymbol>(); 1491private static void GetInteriorSymbols(SemanticModel model, SyntaxNode root, List<ISymbol> symbols) 1495var symbol = model.GetDeclaredSymbol(token);
UtilityTest\DocumentationCommentIdTests.cs (5)
28var sym = DocumentationCommentId.GetFirstSymbolForDeclarationId(id, compilation); 33where TSymbol : ISymbol 35var symbol = DocumentationCommentId.GetFirstSymbolForDeclarationId(expectedId, compilation); 43where TSymbol : ISymbol 56var sym = DocumentationCommentId.GetSymbolsForReferenceId(id, compilation).FirstOrDefault();
Microsoft.VisualStudio.IntegrationTest.Utilities (1)
InProcess\ExtractInterfaceDialog_InProc.cs (1)
130return listItems.Cast<SymbolViewModel<ISymbol>>()
Microsoft.VisualStudio.LanguageServices (219)
CallHierarchy\CallHierarchyCommandHandler.cs (1)
91var symbolUnderCaret = await SymbolFinder.FindSymbolAtPositionAsync(
CallHierarchy\CallHierarchyItem.cs (1)
37ISymbol symbol,
CallHierarchy\CallHierarchyProvider.cs (5)
57ISymbol symbol, Project project, ImmutableArray<Location> callsites, CancellationToken cancellationToken) 84private static ISymbol GetTargetSymbol(ISymbol symbol) 104public async Task<IEnumerable<AbstractCallFinder>> CreateFindersAsync(ISymbol symbol, Project project, CancellationToken cancellationToken) 131foreach (var implementedInterfaceMember in implementedInterfaceMembers)
CallHierarchy\Finders\AbstractCallFinder.cs (4)
34ISymbol symbol, 104var symbol = resolution.Symbol; 148protected virtual async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken) 180protected abstract Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken);
CallHierarchy\Finders\BaseMemberFinder.cs (2)
21public BaseMemberFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 29protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\CallToOverrideFinder.cs (3)
18public CallToOverrideFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 25protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 30foreach (var @override in overrides)
CallHierarchy\Finders\FieldReferenceFinder.cs (2)
19public FieldReferenceFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 32protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\ImplementerFinder.cs (4)
22public ImplementerFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 35protected override Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 38protected override async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken) 42foreach (var implementation in implementations)
CallHierarchy\Finders\InterfaceImplementationCallFinder.cs (2)
22public InterfaceImplementationCallFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 32protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\MethodCallFinder.cs (2)
20public MethodCallFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 35protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\OverridingMemberFinder.cs (4)
22public OverridingMemberFinder(ISymbol symbol, ProjectId projectId, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider) 31protected override Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 34protected override async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken) 38foreach (var @override in overrides)
ChangeSignature\ChangeSignatureDialogViewModel.cs (1)
52ISymbol symbol,
ChangeSignature\VisualStudioChangeSignatureOptionsService.cs (1)
35ISymbol symbol,
CommonControls\MemberSelectionViewModel.cs (13)
25private readonly ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> _symbolToDependentsMap; 26private readonly ImmutableDictionary<ISymbol, MemberSymbolViewModel> _symbolToMemberViewMap; 31ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> dependentsMap, 135public ImmutableArray<(ISymbol member, bool makeAbstract)> GetSelectedMembers() 170private ImmutableHashSet<ISymbol> FindDependentsRecursively(ISymbol member) 172var queue = new Queue<ISymbol>(); 175var visited = new HashSet<ISymbol>(); 176var result = new HashSet<ISymbol>(); 181var currentMember = queue.Dequeue(); 184foreach (var dependent in _symbolToDependentsMap[currentMember].Result)
ExtractClass\ExtractClassViewModel.cs (2)
26ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> memberToDependentsMap,
ExtractClass\VisualStudioExtractClassOptionsService.cs (1)
52public async Task<ExtractClassOptions?> GetExtractClassOptionsAsync(Document document, INamedTypeSymbol selectedType, ImmutableArray<ISymbol> selectedMembers, CancellationToken cancellationToken)
ExtractInterface\VisualStudioExtractInterfaceOptionsService.cs (1)
51List<ISymbol> extractableMembers,
F1Help\AbstractHelpContextService.cs (1)
48public abstract string FormatSymbol(ISymbol symbol);
F1Help\IHelpContextService.cs (1)
20string FormatSymbol(ISymbol symbol);
Implementation\ContainedLanguageRefactorNotifyService.cs (3)
35public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 38public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 71private static ContainedLanguageRenameType GetRenameType(ISymbol symbol)
Implementation\VsRefactorNotifyService.cs (5)
36public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 73public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure) 112ISymbol symbol, 131ISymbol symbol, 159private static bool TryGetRenamingRQNameForSymbol(ISymbol symbol, out string rqname)
Library\ClassView\AbstractSyncClassViewCommandHandler.cs (2)
84var symbol = memberDeclaration != null 111private static bool IsValidSymbolToSynchronize(ISymbol symbol)
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (5)
204var symbol = memberListItem.ResolveTypedSymbol(compilation); 247private void BuildMemberOf(ISymbol containingSymbol) 288private void BuildXmlDocumentation(ISymbol symbol, Compilation compilation) 446private static bool ShowReturnsDocumentation(ISymbol symbol) 453private static bool ShowValueDocumentation(ISymbol symbol)
Library\ObjectBrowser\AbstractListItemFactory.cs (20)
65protected abstract string GetMemberDisplayString(ISymbol memberSymbol); 66protected abstract string GetMemberAndTypeDisplayString(ISymbol memberSymbol); 68protected MemberListItem CreateFullyQualifiedMemberListItem(ISymbol memberSymbol, ProjectId projectId, bool hidden) 77protected MemberListItem CreateInheritedMemberListItem(ISymbol memberSymbol, ProjectId projectId, bool hidden) 80protected MemberListItem CreateSimpleMemberListItem(ISymbol memberSymbol, ProjectId projectId, bool hidden) 83private MemberListItem CreateMemberListItem(ISymbol memberSymbol, ProjectId projectId, bool hidden, bool isInherited) 130private static bool IncludeSymbol(ISymbol symbol) 136private static bool IncludeMemberSymbol(ISymbol symbol, IAssemblySymbol assemblySymbol) 172where TSymbol : class, ISymbol 187where TSymbol : class, ISymbol 316private static ImmutableArray<ISymbol> GetMemberSymbols(INamedTypeSymbol namedTypeSymbol, Compilation compilation) 319var symbolBuilder = ImmutableArray.CreateBuilder<ISymbol>(members.Length); 321foreach (var member in members) 332private static ImmutableArray<ISymbol> GetInheritedMemberSymbols(INamedTypeSymbol namedTypeSymbol, Compilation compilation) 334var symbolBuilder = ImmutableArray.CreateBuilder<ISymbol>(); 336HashSet<ISymbol> overriddenMembers = null; 343foreach (var member in baseType.GetMembers()) 376private static void AddOverriddenMembers(INamedTypeSymbol namedTypeSymbol, ref HashSet<ISymbol> overriddenMembers) 378foreach (var member in namedTypeSymbol.GetMembers()) 382for (var overriddenMember = member.GetOverriddenMember(); overriddenMember != null; overriddenMember = overriddenMember.GetOverriddenMember())
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (2)
428var symbol = symbolListItem.ResolveSymbol(compilation); 543var symbol = symbolListItem.ResolveSymbol(compilation);
Library\ObjectBrowser\Extensions.cs (1)
29public static string GetMemberNavInfoNameOrEmpty(this ISymbol memberSymbol)
Library\ObjectBrowser\Lists\MemberListItem.cs (2)
12internal class MemberListItem : SymbolListItem<ISymbol> 17internal MemberListItem(ProjectId projectId, ISymbol symbol, string displayText, string fullNameText, string searchText, bool isHidden, bool isInherited)
Library\ObjectBrowser\Lists\SymbolListItem.cs (2)
26protected SymbolListItem(ProjectId projectId, ISymbol symbol, string displayText, string fullNameText, string searchText, bool isHidden) 69public ISymbol ResolveSymbol(Compilation compilation)
Library\ObjectBrowser\Lists\SymbolListItem`1.cs (1)
12where TSymbol : ISymbol
Library\ObjectBrowser\ObjectList.cs (2)
690var symbol = symbolListItem.ResolveSymbol(compilation); 759var symbol = symbolItem.ResolveSymbol(compilation);
Library\VsNavInfo\NavInfoFactory.cs (3)
35public IVsNavInfo CreateForSymbol(ISymbol symbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 115public IVsNavInfo CreateForMember(ISymbol memberSymbol, Project project, Compilation compilation, bool useExpandedHierarchy = false) 240private string GetMemberName(ISymbol memberSymbol)
MoveStaticMembers\StaticMemberSelectionViewModel.cs (18)
18private readonly ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> _symbolToDependentsMap; 19private readonly ImmutableDictionary<ISymbol, SymbolViewModel<ISymbol>> _symbolToMemberViewMap; 23ImmutableArray<SymbolViewModel<ISymbol>> members, 24ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> dependentsMap) 32public ImmutableArray<SymbolViewModel<ISymbol>> CheckedMembers => Members.WhereAsArray(m => m.IsChecked); 34private ImmutableArray<SymbolViewModel<ISymbol>> _members; 35public ImmutableArray<SymbolViewModel<ISymbol>> Members 75private static void SelectMembers(ImmutableArray<SymbolViewModel<ISymbol>> members, bool isChecked = true) 83private ImmutableHashSet<ISymbol> FindDependents(ISymbol member) 85var queue = new Queue<ISymbol>(); 88var visited = new HashSet<ISymbol>(); 89var result = new HashSet<ISymbol>(); 94var currentMember = queue.Dequeue(); 97foreach (var dependent in _symbolToDependentsMap[currentMember].Result)
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (3)
48public MoveStaticMembersOptions GetMoveMembersToTypeOptions(Document document, INamedTypeSymbol selectedType, ImmutableArray<ISymbol> selectedNodeSymbols) 97ImmutableArray<ISymbol> selectedNodeSymbols, 107new SymbolViewModel<ISymbol>(member, glyphService)
PickMembers\PickMembersDialogViewModel.cs (1)
33ImmutableArray<ISymbol> members,
PickMembers\VisualStudioPickMembersService.cs (1)
28ImmutableArray<ISymbol> members,
Progression\GraphBuilder.cs (12)
35private readonly Dictionary<GraphNode, ISymbol> _nodeToSymbolMap = new(); 119var symbol = symbolId.Value.Resolve(compilation, cancellationToken: cancellationToken).Symbol; 146public ProjectId GetContextProjectId(Project project, ISymbol symbol) 161public ISymbol GetSymbol(GraphNode node, CancellationToken cancellationToken) 165_nodeToSymbolMap.TryGetValue(node, out var symbol); 170public Task<GraphNode> AddNodeAsync(ISymbol symbol, GraphNode relatedNode, CancellationToken cancellationToken) 182ISymbol symbol, Project contextProject, Document contextDocument, CancellationToken cancellationToken) 199var newSymbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, contextProject.Solution, cancellationToken).ConfigureAwait(false); 242internal static async Task<GraphNode> GetOrCreateNodeAsync(Graph graph, ISymbol symbol, Solution solution, CancellationToken cancellationToken) 309private static async Task<GraphNode> GetOrCreateNodeForLocalVariableAsync(Graph graph, ISymbol localSymbol, Solution solution, CancellationToken cancellationToken) 327private static void UpdateLabelsForNode(ISymbol symbol, Solution solution, GraphNode node) 418private static void UpdatePropertiesForNode(ISymbol symbol, GraphNode node)
Progression\GraphNavigatorExtension.cs (1)
83var symbol = symbolId.Value.Resolve(await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false), cancellationToken: cancellationToken).Symbol;
Progression\GraphNodeCreation.cs (2)
21public static async Task<GraphNodeId> CreateNodeIdAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 62public static async Task<GraphNode> CreateNodeAsync(this Graph graph, ISymbol symbol, Solution solution, CancellationToken cancellationToken)
Progression\GraphNodeIdCreation.cs (7)
287public static async Task<GraphNodeId> GetIdForMemberAsync(ISymbol member, Solution solution, CancellationToken cancellationToken) 368private static IAssemblySymbol GetContainingAssembly(ISymbol symbol) 390private static async Task<Uri> GetAssemblyFullPathAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 466var containingSymbol = symbol.ContainingSymbol; 485internal static async Task<GraphNodeId> GetIdForLocalVariableAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 515private static async Task<int> GetLocalVariableIndexAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 541var current = semanticModel.GetDeclaredSymbol(node, cancellationToken);
Progression\GraphQueries\CallsGraphQuery.cs (6)
26var symbol = graphBuilder.GetSymbol(node, cancellationToken); 29foreach (var newSymbol in await GetCalledMethodSymbolsAsync(symbol, solution, cancellationToken).ConfigureAwait(false)) 42private static async Task<ImmutableArray<ISymbol>> GetCalledMethodSymbolsAsync( 43ISymbol symbol, Solution solution, CancellationToken cancellationToken) 45using var _ = ArrayBuilder<ISymbol>.GetInstance(out var symbols); 54var newSymbol = semanticModel.GetSymbolInfo(syntaxNode, cancellationToken).Symbol;
Progression\GraphQueries\ContainsChildrenGraphQuery.cs (1)
28var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\ContainsGraphQuery.cs (3)
36var symbol = graphBuilder.GetSymbol(node, cancellationToken); 39foreach (var newSymbol in SymbolContainment.GetContainedSymbols(symbol)) 53foreach (var newSymbol in await SymbolContainment.GetContainedSymbolsAsync(document, cancellationToken).ConfigureAwait(false))
Progression\GraphQueries\ImplementedByGraphQuery.cs (2)
27var symbol = graphBuilder.GetSymbol(node, cancellationToken); 35foreach (var implementation in implementations)
Progression\GraphQueries\ImplementsGraphQuery.cs (4)
29var symbol = graphBuilder.GetSymbol(node, cancellationToken); 32var implementedSymbols = ImmutableArray<ISymbol>.CastUp(namedType.AllInterfaces); 50GraphBuilder graphBuilder, GraphNode node, ImmutableArray<ISymbol> implementedSymbols, CancellationToken cancellationToken) 52foreach (var interfaceType in implementedSymbols)
Progression\GraphQueries\InheritedByGraphQuery.cs (1)
25var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\InheritsGraphQuery.cs (1)
36var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\IsCalledByGraphQuery.cs (1)
28var symbol = graphBuilder.GetSymbol(node, cancellationToken);
Progression\GraphQueries\IsUsedByGraphQuery.cs (2)
26var symbol = graphBuilder.GetSymbol(node, cancellationToken); 31var referencedSymbol = reference.Definition;
Progression\GraphQueries\OverriddenByGraphQuery.cs (2)
24var symbol = graphBuilder.GetSymbol(node, cancellationToken); 27var overriddenMember = symbol.GetOverriddenMember();
Progression\GraphQueries\OverridesGraphQuery.cs (2)
26var symbol = graphBuilder.GetSymbol(node, cancellationToken); 32foreach (var o in overrides)
Progression\IProgressionLanguageService.cs (2)
18string GetDescriptionForSymbol(ISymbol symbol, bool includeContainingSymbol); 19string GetLabelForSymbol(ISymbol symbol, bool includeContainingSymbol);
Progression\SymbolContainment.cs (7)
38public static async Task<ImmutableArray<ISymbol>> GetContainedSymbolsAsync(Document document, CancellationToken cancellationToken) 42using var _ = ArrayBuilder<ISymbol>.GetInstance(out var symbols); 48var symbol = semanticModel.GetDeclaredSymbol(syntaxNode, cancellationToken); 60private static bool IsTopLevelSymbol(ISymbol symbol) 76public static IEnumerable<ISymbol> GetContainedSymbols(ISymbol symbol) 80foreach (var member in namedType.GetMembers())
ProjectSystem\AbstractEntryPointFinder.cs (1)
30foreach (var member in symbol.GetMembers())
ProjectSystem\VisualStudioWorkspace.cs (3)
117public abstract bool TryGoToDefinition(ISymbol symbol, Project project, CancellationToken cancellationToken); 118public abstract Task<bool> TryGoToDefinitionAsync(ISymbol symbol, Project project, CancellationToken cancellationToken); 120public abstract bool TryFindAllReferences(ISymbol symbol, Project project, CancellationToken cancellationToken);
PullMemberUp\MainDialog\PullMemberUpDialogViewModel.cs (4)
31private readonly ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> _symbolToDependentsMap; 38ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> dependentsMap)
PullMemberUp\SymbolDependentsBuilder.cs (9)
20public static ImmutableDictionary<ISymbol, Task<ImmutableArray<ISymbol>>> FindMemberToDependentsMap( 21ImmutableArray<ISymbol> membersInType, 36private readonly ImmutableHashSet<ISymbol> _membersInType; 39private readonly HashSet<ISymbol> _dependents = new(); 40private readonly ISymbol _member; 44ImmutableArray<ISymbol> membersInType, 46ISymbol member, 56public async Task<ImmutableArray<ISymbol>> FindMemberDependentsAsync()
PullMemberUp\VisualStudioPullMemberUpService.cs (1)
40public PullMembersUpOptions GetPullMemberUpOptions(Document document, ImmutableArray<ISymbol> selectedMembers)
RQName\RQName.cs (1)
23public static string? From(ISymbol symbol)
Snippets\AbstractSnippetExpansionClient.cs (3)
746var newSymbol = newSymbolKey.Resolve(compilation, cancellationToken: CancellationToken.None).GetAnySymbol(); 753private static async Task<ImmutableArray<ISymbol>> GetReferencedSymbolsToLeftOfCaretAsync( 764return ImmutableArray<ISymbol>.Empty;
Utilities\MemberSymbolViewModel.cs (2)
14internal class MemberSymbolViewModel : SymbolViewModel<ISymbol> 55public MemberSymbolViewModel(ISymbol symbol, IGlyphService glyphService) : base(symbol, glyphService)
Utilities\SymbolViewModel.cs (1)
14internal class SymbolViewModel<T> : AbstractNotifyPropertyChanged where T : ISymbol
Venus\ContainedLanguageCodeSupport.cs (10)
97var eventMember = GetEventSymbol(document, objectTypeName, nameOfEvent, type, cancellationToken); 172var eventMember = GetEventSymbol(thisDocument, objectTypeName, nameOfEvent, type, cancellationToken); 267var member = LookupMemberId(type, uniqueMemberID); 325var symbol = FindSymbol(document, clrt, oldFullyQualifiedName, cancellationToken); 366private static bool IncludeMember(ISymbol member, CODEMEMBERTYPE memberType, Compilation compilation) 416private static ISymbol FindSymbol( 451internal static string ConstructMemberId(ISymbol member) 467internal static ISymbol LookupMemberId(INamedTypeSymbol type, string uniqueMemberID) 472foreach (var m in members) 483private static ISymbol GetEventSymbol(
Workspace\VisualStudioSymbolNavigationService.cs (3)
60ISymbol symbol, Project project, CancellationToken cancellationToken) 138Project project, ISymbol symbol, CancellationToken cancellationToken) 188public async Task<bool> TrySymbolNavigationNotifyAsync(ISymbol symbol, Project project, CancellationToken cancellationToken)
Workspace\VisualStudioSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (3)
35public CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution) 48private readonly ISymbol _symbol; 55ISymbol symbol,
Microsoft.VisualStudio.LanguageServices.CSharp (27)
CodeModel\CSharpCodeModelService.cs (9)
964var symbol = node is AttributeSyntax 995public override bool IsValidExternalSymbol(ISymbol symbol) 1014public override string GetExternalSymbolName(ISymbol symbol) 1024public override string GetExternalSymbolFullName(ISymbol symbol) 1034public override EnvDTE.vsCMAccess GetAccess(ISymbol symbol) 2517public override bool GetIsAbstract(SyntaxNode memberNode, ISymbol symbol) 2644public override bool GetIsShared(SyntaxNode memberNode, ISymbol symbol) 3606public override object GetFunctionExtender(string name, SyntaxNode node, ISymbol symbol) 3646public override object GetPropertyExtender(string name, SyntaxNode node, ISymbol symbol)
CodeModel\CSharpCodeModelService_Prototype.cs (4)
21public override string GetPrototype(SyntaxNode node, ISymbol symbol, PrototypeFlags flags) 555private static void AppendTypeNamePrototype(StringBuilder builder, bool includeNamespaces, bool includeGenerics, ISymbol symbol) 557var symbols = new Stack<ISymbol>(); 577var current = symbols.Pop();
CodeModel\MethodXml\MethodXmlBuilder.cs (3)
479var symbol = SemanticModel.GetSymbolInfo(memberAccessExpression).Symbol; 486var leftHandSymbol = SemanticModel.GetSymbolInfo(memberAccessExpression.Expression).Symbol; 518var symbol = SemanticModel.GetSymbolInfo(identifierName).Symbol;
LanguageService\CSharpHelpContextService.cs (3)
159ISymbol? symbol = null; 179var overloads = bindableParent != null ? semanticModel.GetMemberGroup(bindableParent) : ImmutableArray<ISymbol>.Empty; 547public override string? FormatSymbol(ISymbol? symbol)
ObjectBrowser\DescriptionBuilder.cs (2)
132private void BuildAccessibility(ISymbol symbol) 242private void BuildMemberModifiers(ISymbol memberSymbol)
ObjectBrowser\ListItemFactory.cs (2)
30protected override string GetMemberDisplayString(ISymbol memberSymbol) 33protected override string GetMemberAndTypeDisplayString(ISymbol memberSymbol)
Progression\CSharpProgressionLanguageService.cs (4)
94public string GetDescriptionForSymbol(ISymbol symbol, bool includeContainingSymbol) 97public string GetLabelForSymbol(ISymbol symbol, bool includeContainingSymbol) 100private static string GetSymbolText(ISymbol symbol, bool includeContainingSymbol, SymbolDisplayFormat displayFormat) 119private static ITypeSymbol GetType(ISymbol symbol)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (3)
GlyphExtensionsTests.cs (3)
190var symbol = CreateSymbolMock(kind, declaredAccessibility, isExtensionMethod, methodKind, containingType, isConst, elementType, target, pointedAtType, isWithEvents, typeKind); 194private static ISymbol CreateSymbolMock( 207var symbolMock = new Mock<ISymbol>(MockBehavior.Strict);
Microsoft.VisualStudio.LanguageServices.Implementation (53)
CodeModel\AbstractCodeModelService.cs (12)
208public EnvDTE.CodeElement CreateExternalCodeElement(CodeModelState state, ProjectId projectId, ISymbol symbol) 321public ISymbol? ResolveSymbol(Microsoft.CodeAnalysis.Workspace workspace, ProjectId projectId, SymbolKey symbolId) 492public void Rename(ISymbol symbol, string newName, Workspace workspace, ProjectCodeModelFactory projectCodeModelFactory) 523public abstract bool IsValidExternalSymbol(ISymbol symbol); 524public abstract string GetExternalSymbolName(ISymbol symbol); 525public abstract string GetExternalSymbolFullName(ISymbol symbol); 533public abstract EnvDTE.vsCMAccess GetAccess(ISymbol symbol); 709public abstract bool GetIsAbstract(SyntaxNode memberNode, ISymbol symbol); 722public abstract bool GetIsShared(SyntaxNode memberNode, ISymbol symbol); 1287public abstract object GetFunctionExtender(string name, SyntaxNode node, ISymbol symbol); 1289public abstract object GetPropertyExtender(string name, SyntaxNode node, ISymbol symbol); 1303public abstract string GetPrototype(SyntaxNode node, ISymbol symbol, PrototypeFlags flags);
CodeModel\CodeModelExtensions.cs (1)
22public static string GetEscapedFullName(this ISymbol symbol)
CodeModel\Collections\ExternalMemberCollection.cs (1)
60foreach (var member in typeSymbol.GetMembers())
CodeModel\Collections\ExternalOverloadsCollection.cs (1)
60foreach (var method in symbol.ContainingType.GetMembers(symbol.Name))
CodeModel\Collections\ExternalParameterCollection.cs (1)
48var symbol = this.ParentElement.LookupSymbol();
CodeModel\Collections\OverloadsCollection.cs (1)
64foreach (var method in symbol.ContainingType.GetMembers(symbol.Name))
CodeModel\Collections\PartialTypeCollection.cs (1)
53var symbol = ParentType.LookupSymbol();
CodeModel\ExternalElements\AbstractExternalCodeElement.cs (6)
24internal AbstractExternalCodeElement(CodeModelState state, ProjectId projectId, ISymbol symbol) 46internal ISymbol LookupSymbol() 48var symbol = CodeModelService.ResolveSymbol(this.State.Workspace, this.ProjectId, this.SymbolKey); 77var symbol = LookupSymbol(); 120var symbol = LookupSymbol(); 129var symbol = LookupSymbol();
CodeModel\ExternalElements\AbstractExternalCodeMember.cs (3)
15internal AbstractExternalCodeMember(CodeModelState state, ProjectId projectId, ISymbol symbol) 22var symbol = LookupSymbol(); 28var symbol = LookupSymbol();
CodeModel\ExternalElements\ExternalCodeVariable.cs (3)
18internal static EnvDTE.CodeVariable Create(CodeModelState state, ProjectId projectId, ISymbol symbol) 24private ExternalCodeVariable(CodeModelState state, ProjectId projectId, ISymbol symbol) 31var symbol = LookupSymbol();
CodeModel\ICodeModelService.cs (12)
84EnvDTE.CodeElement CreateExternalCodeElement(CodeModelState state, ProjectId projectId, ISymbol symbol); 105ISymbol? ResolveSymbol(Microsoft.CodeAnalysis.Workspace workspace, ProjectId projectId, SymbolKey symbolId); 126void Rename(ISymbol symbol, string newName, Workspace workspace, ProjectCodeModelFactory projectCodeModelFactory); 131bool IsValidExternalSymbol(ISymbol symbol); 136string GetExternalSymbolName(ISymbol symbol); 141string GetExternalSymbolFullName(ISymbol symbol); 149EnvDTE.vsCMAccess GetAccess(ISymbol symbol); 238bool GetIsAbstract(SyntaxNode memberNode, ISymbol symbol); 251bool GetIsShared(SyntaxNode memberNode, ISymbol symbol); 360object GetFunctionExtender(string name, SyntaxNode node, ISymbol symbol); 362object GetPropertyExtender(string name, SyntaxNode node, ISymbol symbol); 376string GetPrototype(SyntaxNode node, ISymbol symbol, PrototypeFlags flags);
CodeModel\InternalElements\AbstractCodeElement.cs (1)
85internal virtual ISymbol LookupSymbol()
CodeModel\InternalElements\CodeImport.cs (1)
89internal override ISymbol LookupSymbol()
CodeModel\InternalElements\CodeStruct.cs (1)
70var symbol = LookupSymbol();
CodeModel\InternalElements\CodeVariable.cs (1)
62var symbol = LookupSymbol();
CodeModel\MetadataNameHelpers.cs (2)
70var parts = new Stack<ISymbol>(); 72ISymbol symbol = typeSymbol;
CodeModel\MethodXml\AbstractMethodXmlBuilder.cs (1)
340protected virtual VariableKind GetVariableKind(ISymbol symbol)
RoslynVisualStudioWorkspace.cs (4)
93public override bool TryGoToDefinition(ISymbol symbol, Project project, CancellationToken cancellationToken) 97ISymbol symbol, Project project, CancellationToken cancellationToken) 114public override bool TryFindAllReferences(ISymbol symbol, Project project, CancellationToken cancellationToken) 135var symbol = symbolListItem.ResolveSymbol(compilation);
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (6)
CodeModel\Mocks\MockVisualStudioWorkspace.vb (3)
67Public Overrides Function TryGoToDefinition(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Boolean 71Public Overrides Function TryGoToDefinitionAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of Boolean) 75Public Overrides Function TryFindAllReferences(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Boolean
ProjectSystemShim\Framework\TestEnvironment.vb (3)
113Public Overrides Function TryGoToDefinition(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Boolean 117Public Overrides Function TryGoToDefinitionAsync(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Task(Of Boolean) 121Public Overrides Function TryFindAllReferences(symbol As ISymbol, project As Project, cancellationToken As CancellationToken) As Boolean
Microsoft.VisualStudio.LanguageServices.UnitTests (8)
ExtractInterface\ExtractInterfaceViewModelTests.vb (1)
303Dim memberViewModels = extractableMembers.Select(Function(member As ISymbol)
MoveStaticMembers\MoveStaticMembersViewModelTest.vb (2)
53Private Shared Function FindMemberByName(name As String, memberArray As ImmutableArray(Of SymbolViewModel(Of ISymbol))) As SymbolViewModel(Of ISymbol)
Progression\GraphNodeIdTests.vb (2)
14Private Shared Async Function AssertMarkedNodeIdIsAsync(code As String, expectedId As String, Optional language As String = "C#", Optional symbolTransform As Func(Of ISymbol, ISymbol) = Nothing) As Task
Progression\ProgressionTestState.vb (3)
35Public Async Function GetGraphWithMarkedSymbolNodeAsync(Optional symbolTransform As Func(Of ISymbol, ISymbol) = Nothing) As Task(Of Graph) 77Public Function GetMarkedSymbolAsync() As Task(Of ISymbol)
Microsoft.VisualStudio.LanguageServices.VisualBasic (29)
CodeModel\MethodXML\MethodXmlBuilder.vb (7)
161Private Function TryGenerateExpression(expression As ExpressionSyntax, Optional symbolOpt As ISymbol = Nothing, Optional generateAttributes As Boolean = False) As Boolean 167Private Function TryGenerateExpressionSansTag(expression As ExpressionSyntax, Optional symbolOpt As ISymbol = Nothing, Optional generateAttributes As Boolean = False) As Boolean 320Protected Overrides Function GetVariableKind(symbol As ISymbol) As VariableKind 334Private Shared Function GetFullNameText(symbol As ISymbol) As String 348Optional symbolOpt As ISymbol = Nothing, 400Optional symbolOpt As ISymbol = Nothing, 426Private Sub GenerateLastNameRef(symbol As ISymbol)
CodeModel\VisualBasicCodeModelService.vb (8)
1384Public Overrides Function IsValidExternalSymbol(symbol As ISymbol) As Boolean 1412Public Overrides Function GetExternalSymbolName(symbol As ISymbol) As String 1420Public Overrides Function GetExternalSymbolFullName(symbol As ISymbol) As String 1428Public Overrides Function GetAccess(symbol As ISymbol) As EnvDTE.vsCMAccess 2804Public Overrides Function GetIsAbstract(memberNode As SyntaxNode, symbol As ISymbol) As Boolean 2905Public Overrides Function GetIsShared(memberNode As SyntaxNode, symbol As ISymbol) As Boolean 4165Public Overrides Function GetFunctionExtender(name As String, node As SyntaxNode, symbol As ISymbol) As Object 4190Public Overrides Function GetPropertyExtender(name As String, node As SyntaxNode, symbol As ISymbol) As Object
CodeModel\VisualBasicCodeModelService_Prototype.vb (3)
31Public Overrides Function GetPrototype(node As SyntaxNode, symbol As ISymbol, flags As PrototypeFlags) As String 80Private Shared Function GetFunctionPrototype(symbol As ISymbol, parameters As ImmutableArray(Of IParameterSymbol), flags As PrototypeFlags) As String 159Private Shared Sub AppendName(builder As StringBuilder, symbol As ISymbol, flags As PrototypeFlags)
Help\VisualBasicHelpContextService.vb (2)
86Public Overloads Overrides Function FormatSymbol(symbol As ISymbol) As String 90Private Overloads Function FormatSymbol(symbol As ISymbol, isContainingType As Boolean) As String
ObjectBrowser\DescriptionBuilder.vb (2)
289Private Sub BuildAccessibility(symbol As ISymbol) 328Private Sub BuildMemberModifiers(memberSymbol As ISymbol)
ObjectBrowser\ListItemFactory.vb (2)
28Protected Overrides Function GetMemberAndTypeDisplayString(memberSymbol As ISymbol) As String 32Protected Overrides Function GetMemberDisplayString(memberSymbol As ISymbol) As String
Progression\VisualBasicProgressionLanguageService.vb (3)
67Public Function GetDescriptionForSymbol(symbol As ISymbol, includeContainingSymbol As Boolean) As String Implements IProgressionLanguageService.GetDescriptionForSymbol 77Public Function GetLabelForSymbol(symbol As ISymbol, includeContainingSymbol As Boolean) As String Implements IProgressionLanguageService.GetLabelForSymbol 81Private Shared Function GetSymbolText(symbol As ISymbol, includeContainingSymbol As Boolean, displayFormat As SymbolDisplayFormat) As String
Venus\ContainedLanguageStaticEventBinding.vb (2)
133Private Function GetMemberBlockOrBegin(member As ISymbol) As SyntaxNode 137Private Function GetMethodStatement(member As ISymbol) As MethodStatementSyntax
Microsoft.VisualStudio.LanguageServices.Xaml (10)
Features\Completion\IXamlCompletionService.cs (1)
17Task<ISymbol> GetSymbolAsync(XamlCompletionContext completionContext, string label, CancellationToken cancellationToken);
Features\Completion\XamlCompletionItem.cs (1)
27public ISymbol Symbol { get; set; }
Features\Definitions\XamlSymbolDefinition.cs (2)
14public ISymbol Symbol { get; } 16public XamlSymbolDefinition(ISymbol symbol)
Features\QuickInfo\XamlQuickInfo.cs (3)
19public ISymbol Symbol { get; } 24ISymbol symbol) 34ISymbol symbol = null)
Implementation\LanguageServer\Extensions\SymbolExtensions.cs (1)
24public static async Task<IEnumerable<TaggedText>> GetDescriptionAsync(this ISymbol symbol, TextDocument document, SymbolDescriptionOptions options, CancellationToken cancellationToken)
Implementation\LanguageServer\Handler\Completion\CompletionResolveHandler.cs (1)
75var symbol = await completionService.GetSymbolAsync(new XamlCompletionContext(document, offset), completionItem.Label, cancellationToken: cancellationToken).ConfigureAwait(false);
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (1)
157var symbol = symbolDefinition.Symbol;