91 references to ValueUsageInfo
Microsoft.CodeAnalysis.EditorFeatures (10)
ExternalAccess\VSTypeScript\Api\IVSTypeScriptFindUsagesContext.cs (10)
148=> new(SymbolUsageInfo.Create((ValueUsageInfo)valueUsageInfo)); 154None = ValueUsageInfo.None, 155Read = ValueUsageInfo.Read, 156Write = ValueUsageInfo.Write, 157Reference = ValueUsageInfo.Reference, 158Name = ValueUsageInfo.Name, 159ReadWrite = ValueUsageInfo.ReadWrite, 160ReadableReference = ValueUsageInfo.ReadableReference, 161WritableReference = ValueUsageInfo.WritableReference, 162ReadableWritableReference = ValueUsageInfo.ReadableWritableReference
Microsoft.CodeAnalysis.Features (18)
AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
208var valueUsageInfo = fieldReference.GetValueUsageInfo(owningSymbol);
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; 218_symbolValueUsageStateMap.Add(symbol, ValueUsageInfo.None); 237OnSymbolUsage(field, ValueUsageInfo.Write); 242private void OnSymbolUsage(ISymbol memberSymbol, ValueUsageInfo usageInfo) 252if (_symbolValueUsageStateMap.TryGetValue(memberSymbol, out var currentUsageInfo)) 261private bool TryRemove(ISymbol memberSymbol, out ValueUsageInfo valueUsageInfo) 282var valueUsageInfo = memberReference.GetValueUsageInfo(operationContext.ContainingSymbol); 284if (valueUsageInfo == ValueUsageInfo.ReadWrite) 310valueUsageInfo = ValueUsageInfo.Write; 335OnSymbolUsage(targetMethod, ValueUsageInfo.Read); 341OnSymbolUsage(targetMethod.ReducedFrom, ValueUsageInfo.Read); 356OnSymbolUsage(memberReference.Member.OriginalDefinition, ValueUsageInfo.ReadWrite); 372OnSymbolUsage(symbol.OriginalDefinition, ValueUsageInfo.ReadWrite); 384OnSymbolUsage(constructor, ValueUsageInfo.Read); 419if (TryRemove(member, out var valueUsageInfo) &&
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Extensions\ProtocolConversions.cs (1)
593var usageInfo = symbolUsageInfo.ValueUsageInfoOpt.Value;
Microsoft.CodeAnalysis.VisualBasic.Features (4)
VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (4)
14Protected Overrides Sub HandleNamedTypeSymbolStart(context As SymbolStartAnalysisContext, onSymbolUsageFound As Action(Of ISymbol, ValueUsageInfo)) 21onSymbolUsageFound(method, ValueUsageInfo.Read) 37Private Shared Sub AnalyzeHandlesClause(context As SyntaxNodeAnalysisContext, onSymbolUsageFound As Action(Of ISymbol, ValueUsageInfo)) 42onSymbolUsageFound(symbol, ValueUsageInfo.Read)
Microsoft.CodeAnalysis.Workspaces (57)
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (9)
650return SymbolUsageInfo.Create(ValueUsageInfo.WritableReference); 654return SymbolUsageInfo.Create(ValueUsageInfo.ReadableWritableReference); 658return SymbolUsageInfo.Create(ValueUsageInfo.ReadableReference); 662return SymbolUsageInfo.Create(ValueUsageInfo.Write); 672return SymbolUsageInfo.Create(ValueUsageInfo.Name); 677return SymbolUsageInfo.Create(ValueUsageInfo.Name); 714var valueUsageInfo = ValueUsageInfo.Read; 717valueUsageInfo |= ValueUsageInfo.Write;
OperationExtensions.cs (30)
24/// Returns the <see cref="ValueUsageInfo"/> for the given operation. 27public static ValueUsageInfo GetValueUsageInfo(this IOperation operation, ISymbol containingSymbol) 54return ValueUsageInfo.Write; 75return ValueUsageInfo.Write; 86return ValueUsageInfo.Write; 96return ValueUsageInfo.Write; 104return ValueUsageInfo.Write; 112return ValueUsageInfo.Write; 118return ValueUsageInfo.ReadWrite; 126? ValueUsageInfo.ReadWrite 127: ValueUsageInfo.Write; 133return ValueUsageInfo.ReadableWritableReference; 137return ValueUsageInfo.ReadWrite; 145~(ValueUsageInfo.Write | ValueUsageInfo.Reference); 151return ValueUsageInfo.Name; 158return ValueUsageInfo.ReadableReference; 161return ValueUsageInfo.WritableReference; 164return ValueUsageInfo.ReadableWritableReference; 167return ValueUsageInfo.Read; 174RefKind.RefReadOnly => ValueUsageInfo.ReadableReference, 175RefKind.Ref => ValueUsageInfo.ReadableWritableReference, 176_ => ValueUsageInfo.Read, 188return ValueUsageInfo.Read; 195? ValueUsageInfo.ReadWrite 196: ValueUsageInfo.Write; 204return ValueUsageInfo.Write; 213return ValueUsageInfo.ReadableWritableReference; 216return ValueUsageInfo.ReadableReference; 221return ValueUsageInfo.Read;
SymbolUsageAnalysis.Walker.cs (5)
94private void OnWriteReferenceFound(ISymbol symbol, IOperation operation, ValueUsageInfo valueUsageInfo) 97var isRef = valueUsageInfo == ValueUsageInfo.ReadableWritableReference; 112var valueUsageInfo = operation.GetValueUsageInfo(_currentContainingSymbol); 199OnWriteReferenceFound(symbolOpt, write, ValueUsageInfo.Write); 267OnWriteReferenceFound(operation.Symbol, operation, ValueUsageInfo.Write);
SymbolUsageInfo.cs (5)
15/// For methods, fields, properties, events, locals and parameters, this corresponds to values from <see cref="ValueUsageInfo"/>. 20public static readonly SymbolUsageInfo None = Create(ValueUsageInfo.None); 23public ValueUsageInfo? ValueUsageInfoOpt { get; } 29public SymbolUsageInfo(ValueUsageInfo? valueUsageInfoOpt, TypeOrNamespaceUsageInfo? typeOrNamespaceUsageInfoOpt) 37public static SymbolUsageInfo Create(ValueUsageInfo valueUsageInfo)
ValueUsageInfo.cs (8)
69public static bool IsReadFrom(this ValueUsageInfo valueUsageInfo) 70=> (valueUsageInfo & ValueUsageInfo.Read) != 0; 72public static bool IsWrittenTo(this ValueUsageInfo valueUsageInfo) 73=> (valueUsageInfo & ValueUsageInfo.Write) != 0; 75public static bool IsNameOnly(this ValueUsageInfo valueUsageInfo) 76=> (valueUsageInfo & ValueUsageInfo.Name) != 0; 78public static bool IsReference(this ValueUsageInfo valueUsageInfo) 79=> (valueUsageInfo & ValueUsageInfo.Reference) != 0;
Microsoft.VisualStudio.LanguageServices (1)
Extensions\SymbolUsageInfoExtensions.cs (1)
21var usageInfo = symbolUsageInfo.ValueUsageInfoOpt.Value;