1 implementation of Value
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
7925public IOperation Value { get; }
119 references to Value
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (1)
87ITypeSymbol? type = ResolveType(instanceArg.Value)?.WithNullableAnnotation(NullableAnnotation.None);
ILLink.RoslynAnalyzer (2)
DataFlow\FeatureChecksVisitor.cs (1)
45 return Visit (operation.Value, state);
DataFlow\LocalDataFlowVisitor.cs (1)
681 return Visit (operation.Value, state);
Microsoft.Analyzers.Extra (12)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
212.Value
CallAnalysis\Fixers\LegacyLoggingFixer.cs (7)
366var t = invocationOp.Arguments[0].Value.Type!; 386parameters.Add(gen.ParameterDeclaration("exception", gen.TypeExpression(invocationOp.Arguments[details.ExceptionParamIndex].Value.Type!))); 401var arrayCreation = (IArrayCreationOperation)paramsArg.Value; 431invocationOp.Arguments[0].Value.Type! 436args.Add(invocationOp.Arguments[details.ExceptionParamIndex].Value.Type!); 450var arrayCreation = (IArrayCreationOperation)paramsArg.Value; 506var arrayCreation = (IArrayCreationOperation)arg.Value;
CallAnalysis\StartsEndsWith.cs (3)
46var s = op.Arguments[0].Value.ConstantValue.Value as string; 50if (op.Arguments.Length > 1 && op.Arguments[1].Value.ConstantValue.HasValue) 52var comp = (StringComparison)op.Arguments[1].Value.ConstantValue.Value!;
UsingToStringInLoggersAnalyzer.cs (1)
66if (arg.Value is IInvocationOperation argOperation
Microsoft.Analyzers.Local (1)
CallAnalysis\ToInvariantString.cs (1)
42if (a.Value is IConversionOperation conv)
Microsoft.AspNetCore.App.Analyzers (6)
Http\HeaderDictionaryIndexerAnalyzer.cs (1)
35propertyReference.Arguments[0].Value is ILiteralOperation literalOperation &&
Kestrel\ListenOnIPv6AnyAnalyzer.cs (1)
77if (addressArgument!.Value is ILocalReferenceOperation localReferenceOperation)
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (1)
43if (!argument.Value.Syntax.IsKind(SyntaxKind.NumericLiteralExpression))
RouteHandlers\DetectAmbiguousRoutes.cs (1)
277return WalkDownConversion(arguments[i].Value);
RouteHandlers\RouteHandlerAnalyzer.cs (1)
230builder = WalkDownConversion(builderArgument.Value);
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
190return GetReceiverType(firstArg.Value.Syntax, invocation.SemanticModel, cancellationToken);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
StaticRouteHandlerModel\InvocationOperationExtensions.cs (1)
85IArgumentOperation argument => ResolveMethodFromOperation(argument.Value, semanticModel),
Microsoft.AspNetCore.Mvc.Analyzers (1)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
190return GetReceiverType(firstArg.Value.Syntax, invocation.SemanticModel, cancellationToken);
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
ActualApiResponseMetadataFactory.cs (2)
201if (TryGetStatusCode(argument.Value, out var statusCodeValue)) 209var operation = argument.Value;
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
190return GetReceiverType(firstArg.Value.Syntax, invocation.SemanticModel, cancellationToken);
Microsoft.CodeAnalysis (6)
Operations\ControlFlowGraphBuilder.cs (6)
2052if (arguments[i].Value is IInterpolatedStringHandlerCreationOperation creation) 2078var argument = arguments[i].Value switch 6305if (argument is { ArgumentKind: ArgumentKind.ParamArray, Value: IArrayCreationOperation array }) 6316AddStatement(Visit(argument.Value)); 6818if (arguments[i] is { Value: IInterpolatedStringHandlerArgumentPlaceholderOperation { PlaceholderKind: InterpolatedStringArgumentPlaceholderKind.TrailingValidityArgument } } arg) 6826outParameterPlaceholder = (IInterpolatedStringHandlerArgumentPlaceholderOperation)outParameterArgument.Value;
Microsoft.CodeAnalysis.CodeStyle (6)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (1)
85return TryAddHashedSymbol(invocation.Arguments[0].Value, seenHash: true);
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (4)
90if (invocation.Arguments[0].Value is ILiteralOperation { ConstantValue: { HasValue: true, Value: string value } } literal && 133return IsInvariantCultureReference(invocation.Arguments[formatProviderArgumentIndex].Value) 208var alignmentOp = invocation.Arguments[0].Value; 248=> argument.Value.ConstantValue is { HasValue: true, Value: ' ' };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
364operation.Value.Type.IsDelegateType())
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (2)
111invocationOperation.Arguments[0].Value, 133propertyReference.Arguments[0].Value,
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (7)
126var startOperation = invocation.Arguments[0].Value; 168var startOperation = invocation.Arguments[0].Value; 169var lengthOperation = invocation.Arguments[1].Value; 233if (!IsSubtraction(invocation.Arguments[1].Value, out var subtraction) || 244var startOperation = invocation.Arguments[0].Value; 283var startOperation = invocation.Arguments[0].Value; 300invocation.Arguments[1].Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
240if (argumentOp is not { Value.Type: { } valueType, Parameter.Type: { } parameterType })
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (3)
46Arguments: [IArgumentOperation { Value: IOperation arg }] 305if (arg is { Parameter: IParameterSymbol param, Value.Syntax: ExpressionSyntax captured }) 633Arguments: [IArgumentOperation { Value: IOperation arg }]
Microsoft.CodeAnalysis.CSharp.Features (12)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (2)
111invocationOperation.Arguments[0].Value, 133propertyReference.Arguments[0].Value,
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (7)
126var startOperation = invocation.Arguments[0].Value; 168var startOperation = invocation.Arguments[0].Value; 169var lengthOperation = invocation.Arguments[1].Value; 233if (!IsSubtraction(invocation.Arguments[1].Value, out var subtraction) || 244var startOperation = invocation.Arguments[0].Value; 283var startOperation = invocation.Arguments[0].Value; 300invocation.Arguments[1].Value);
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (3)
46Arguments: [IArgumentOperation { Value: IOperation arg }] 305if (arg is { Parameter: IParameterSymbol param, Value.Syntax: ExpressionSyntax captured }) 633Arguments: [IArgumentOperation { Value: IOperation arg }]
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
240if (argumentOp is not { Value.Type: { } valueType, Parameter.Type: { } parameterType })
Microsoft.CodeAnalysis.Features (13)
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
298IsParameterReference(invocation.Arguments[0].Value, parameter))
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (3)
380.Where(argument => argument.Value.Syntax is TExpressionSyntax 381&& !_syntaxFacts.IsDeclarationExpression(argument.Value.Syntax)) 501var argumentExpressionOperation = argumentOperation.Value;
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (1)
85return TryAddHashedSymbol(invocation.Arguments[0].Value, seenHash: true);
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (4)
90if (invocation.Arguments[0].Value is ILiteralOperation { ConstantValue: { HasValue: true, Value: string value } } literal && 133return IsInvariantCultureReference(invocation.Arguments[formatProviderArgumentIndex].Value) 208var alignmentOp = invocation.Arguments[0].Value; 248=> argument.Value.ConstantValue is { HasValue: true, Value: ' ' };
ValueTracking\ValueTracker.OperationCollector.cs (4)
31IArgumentOperation argumentOperation => ShouldTrackArgument(argumentOperation) ? VisitAsync(argumentOperation.Value, cancellationToken) : Task.CompletedTask, 240if (argumentOperation.Value is IExpressionStatementOperation 255if (argumentOperation.Value is IParameterReferenceOperation) 268if (argumentOperation.Value is ILiteralOperation)
Microsoft.CodeAnalysis.Test.Utilities (15)
Compilation\ControlFlowGraphVerifier.cs (2)
916&& arguments[0].Value.Type.SpecialType == SpecialType.System_Int32 917&& arguments[1].Value.Type.SpecialType == SpecialType.System_Int32;
Compilation\OperationTreeVerifier.cs (1)
919Visit(operation.Value);
Compilation\TestOperationVisitor.cs (1)
582Assert.Same(operation.Value, operation.ChildOperations.Single());
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
92AssignTo(argument.Value, localsSourceTypes, fieldsSourceTypes, argument.Parameter.Type);
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
80AssignTo(argument.Value, inConstructor, staticConstructorType, assignedToFields, mightBecomeReadOnlyFields);
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
73AssignTo(argument.Value, assignedToLocals, mightBecomeConstLocals);
Diagnostics\OperationTestAnalyzer.cs (8)
558TestAscendingArgument(operationContext, argument.Value, ref priorArgumentValue); 562if (argument.Value is IArrayCreationOperation arrayArgument) 668if (argument.Value.ConstantValue.HasValue && argument.Value.ConstantValue.Value == null) 1106if (argument.Value is IArrayCreationOperation arrayValue) 1111operationContext.ReportDiagnostic(Diagnostic.Create(LongParamsDescriptor, argument.Value.Syntax.GetLocation())); 1133if (argument.Value is IArrayCreationOperation arrayValue) 1138operationContext.ReportDiagnostic(Diagnostic.Create(LongParamsDescriptor, argument.Value.Syntax.GetLocation()));
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
364operation.Value.Type.IsDelegateType())
Microsoft.Interop.ComInterfaceGenerator (3)
Analyzers\ComHostingDoesNotSupportGeneratedComInterfaceAnalyzer.cs (1)
46|| ctor.Arguments[0].Value.ConstantValue.Value is not true)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (2)
200static Func<IInvocationOperation, (ITypeSymbol Type, Location location)?> CreateArgumentTypeLookup(int ordinal) => invocation => invocation.GetArgumentByOrdinal(ordinal).Value switch 235static Func<IInvocationOperation, (ITypeSymbol Type, Location location)?> CreateTypeOfArgumentTypeLookup(int ordinal) => invocation => invocation.GetArgumentByOrdinal(ordinal).Value switch
Microsoft.Interop.LibraryImportGenerator (10)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (7)
650if (managedTypeArgument.Value.IsNullLiteralOperation()) 652DiagnosticReporter managedTypeReporter = DiagnosticReporter.CreateForLocation(managedTypeArgument.Value.Syntax.GetLocation(), context.ReportDiagnostic); 655else if (managedTypeArgument.Value is ITypeOfOperation managedTypeOfOp) 671if (marshallerTypeArgument.Value.IsNullLiteralOperation()) 673DiagnosticReporter marshallerTypeReporter = DiagnosticReporter.CreateForLocation(marshallerTypeArgument.Value.Syntax.GetLocation(), context.ReportDiagnostic); 676else if (marshallerTypeArgument.Value is ITypeOfOperation marshallerTypeOfOp) 689if (marshalModeArgument.Value is not IFieldReferenceOperation { ConstantValue.Value: var marshalMode }
Analyzers\NativeMarshallingAttributeAnalyzer.cs (3)
91if (marshallerEntryPointTypeArgument.Value.IsNullLiteralOperation()) 93DiagnosticReporter diagnosticFactory = DiagnosticReporter.CreateForLocation(marshallerEntryPointTypeArgument.Value.Syntax.GetLocation(), context.ReportDiagnostic); 98if (marshallerEntryPointTypeArgument.Value is ITypeOfOperation typeOfOp)
System.Text.RegularExpressions.Generator (12)
UpgradeToGeneratedRegexAnalyzer.cs (4)
183if (!argument.Value.ConstantValue.HasValue) 190_ = RegexParser.ParseOptionsInPattern((string)argument.Value.ConstantValue.Value!, RegexOptions.None); 206if (!argument.Value.ConstantValue.HasValue) 211RegexOptions value = (RegexOptions)(int)argument.Value.ConstantValue.Value!;
UpgradeToGeneratedRegexCodeFixer.cs (8)
263return patternArgument.Value.ConstantValue.Value as string; 270return optionsArgument is null || !optionsArgument.Value.ConstantValue.HasValue ? 272(RegexOptions)(int)optionsArgument.Value.ConstantValue.Value!; 287string optionsLiteral = Literal(((RegexOptions)(int)argument.Value.ConstantValue.Value!).ToString()); 290else if (argument.Value is ILiteralOperation literalOperation) 294else if (argument.Value is IFieldReferenceOperation fieldReferenceOperation && 299else if (argument.Value.ConstantValue.Value is string str && str.Contains('\\')) 305return generator.LiteralExpression(argument.Value.ConstantValue.Value);