232 references to Expression
Aspire.Hosting.Analyzers (1)
AppHostAnalyzer.cs (1)
136
routePatternArgumentSyntax.
Expression
is not LiteralExpressionSyntax routePatternArgumentLiteralSyntax)
Microsoft.AspNetCore.App.Analyzers (6)
Kestrel\ListenOnIPv6AnyAnalyzer.cs (1)
63
Expression
: MemberAccessExpressionSyntax
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
417
if (argument.
Expression
is DeclarationExpressionSyntax declarationExpression &&
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (2)
300
if (routeStringArgument?.
Expression
is not LiteralExpressionSyntax literalExpression)
305
return new MapMethodParts(method, literalExpression, delegateArgument.
Expression
);
RouteHandlers\RouteHandlerAnalyzer.cs (1)
185
routePatternArgumentSyntax.
Expression
is not LiteralExpressionSyntax routePatternArgumentLiteralSyntax)
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
369
var lambdaExpression = arguments?.
Expression
as SimpleLambdaExpressionSyntax;
Microsoft.AspNetCore.App.CodeFixes (4)
Authorization\AddAuthorizationBuilderFixer.cs (1)
62
&& arguments[0].
Expression
is SimpleLambdaExpressionSyntax lambda)
Http\HeaderDictionaryAddFixer.cs (1)
130
arguments[1].
Expression
);
Http\HeaderDictionaryIndexerFixer.cs (1)
54
param = argumentSyntax.
Expression
;
WebApplicationBuilderFixer.cs (1)
114
|| initArgument.
Expression
is not LambdaExpressionSyntax lambdaExpr)
Microsoft.AspNetCore.OpenApi.SourceGenerators (2)
XmlCommentGenerator.Parser.cs (2)
172
if (argument.
Expression
is LiteralExpressionSyntax)
176
else if (argument.
Expression
is LambdaExpressionSyntax)
Microsoft.CodeAnalysis.CSharp (22)
_generated\0\Syntax.xml.Main.Generated.cs (1)
1662
=> node.Update((NameColonSyntax?)Visit(node.NameColon), VisitToken(node.RefKindKeyword), (ExpressionSyntax?)Visit(node.
Expression
) ?? throw new ArgumentNullException("expression"));
_generated\2\Syntax.xml.Syntax.Generated.cs (3)
2779
if (nameColon != this.NameColon || refKindKeyword != this.RefKindKeyword || expression != this.
Expression
)
2789
public ArgumentSyntax WithNameColon(NameColonSyntax? nameColon) => Update(nameColon, this.RefKindKeyword, this.
Expression
);
2790
public ArgumentSyntax WithRefKindKeyword(SyntaxToken refKindKeyword) => Update(this.NameColon, refKindKeyword, this.
Expression
);
Binder\Binder_Deconstruct.cs (1)
787
builder.Add(BindDeconstructionVariables(arg.
Expression
, diagnostics, ref declaration, ref expression));
Binder\Binder_Expressions.cs (8)
1045
ImmutableArray.Create(BindValue(arguments[0].
Expression
, diagnostics, BindValueKind.RValue)) :
1075
BoundExpression boundArgument = BindValue(argumentSyntax.
Expression
, diagnostics, BindValueKind.RValue);
1145
inferredName = InferTupleElementName(argumentSyntax.
Expression
);
3142
switch (argumentSyntax.
Expression
.Kind())
3204
argumentSyntax.
Expression
.CheckDeconstructionCompatibleArgument(diagnostics);
3213
if (argumentSyntax.
Expression
.Kind() == SyntaxKind.DeclarationExpression)
3218
var declarationExpression = (DeclarationExpressionSyntax)argumentSyntax.
Expression
;
3225
return BindArgumentExpression(diagnostics, argumentSyntax.
Expression
, refKind, allowArglist);
Binder\Binder_Invocation.cs (2)
2365
if (binder.EnclosingNameofArgument == node.ArgumentList.Arguments[0].
Expression
)
2379
var argument = node.ArgumentList.Arguments[0].
Expression
;
Binder\ExpressionVariableFinder.cs (2)
90
Visit(arg.
Expression
);
477
CollectVariablesFromDeconstruction(arg.
Expression
, deconstruction);
Binder\ForEachLoopBinder.cs (1)
115
CollectLocalsFromDeconstruction(arg.
Expression
, kind, locals, deconstructionStatement, enclosingBinderOpt);
Binder\LocalBinderFactory.cs (1)
233
var argumentExpression = node.ArgumentList.Arguments[0].
Expression
;
Symbols\Source\SourceFixedFieldSymbol.cs (2)
73
if (arguments.Count == 0 || arguments[0].
Expression
.Kind() == SyntaxKind.OmittedArraySizeExpression)
84
ExpressionSyntax sizeExpression = arguments[0].
Expression
;
Syntax\ArgumentSyntax.cs (1)
26
return this.Update(this.NameColon, refOrOutKeyword, this.
Expression
);
Microsoft.CodeAnalysis.CSharp.Analyzers (3)
MetaAnalyzers\CSharpRegisterActionAnalyzer.cs (2)
60
return invocation.ArgumentList.Arguments.Select(a => a.
Expression
);
68
return argument.
Expression
;
MetaAnalyzers\CSharpReportDiagnosticAnalyzer.cs (1)
33
return invocation.ArgumentList.Arguments.Select(a => a.
Expression
);
Microsoft.CodeAnalysis.CSharp.CodeStyle (31)
src\roslyn\src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
88
var argumentExpression = argumentNode.
Expression
;
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
102
if (argument.
Expression
is not IdentifierNameSyntax argumentIdentifier)
src\roslyn\src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (2)
110
ArgumentList.Arguments: [{
Expression
: LambdaExpressionSyntax whereLambda1 }],
150
Expression
: LambdaExpressionSyntax
src\roslyn\src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (3)
60
AddIneligibleFieldsForExpression(argument.
Expression
);
64
if (argument.
Expression
.IsNameOfArgumentExpression())
65
AddIneligibleFieldsForExpression(argument.
Expression
, alwaysRestricted: true);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
149
argumentIndex == arguments.Count - 1 && arguments[argumentIndex] is { RefKindKeyword.RawKind: (int)SyntaxKind.OutKeyword,
Expression
: DeclarationExpressionSyntax { Designation: SingleVariableDesignationSyntax singleVariable } }
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
238
var argumentType = semanticModel.GetTypeInfo(objectCreation.ArgumentList.Arguments[0].
Expression
, cancellationToken).Type;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (7)
539
if (argument.
Expression
.IsNameOfArgumentExpression())
581
siblingArgument.
Expression
is DeclarationExpressionSyntax { Designation: SingleVariableDesignationSyntax designation })
836
if (semanticModel.GetConstantValue(elementArgument.
Expression
, cancellationToken).Value is not int indexValue ||
976
if (arguments is [{
Expression
: ArrayCreationExpressionSyntax { Initializer: not null } or ImplicitArrayCreationExpressionSyntax }])
1004
if (arguments[0].
Expression
1025
var argExpression = argument.
Expression
;
1207
var expression = arguments.Single().
Expression
;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (3)
146
preMatches.Add(new(argumentList.Arguments[0].
Expression
, UseSpread: true, UseKeyValue: false));
176
spreadElements.Add(invocation.ArgumentList.Arguments[0].
Expression
);
194
var currentArgumentExpression = argumentList.Arguments[0].
Expression
;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
195
var arg0 = invocation.ArgumentList.Arguments[0].
Expression
;
196
var arg1 = invocation.ArgumentList.Arguments[1].
Expression
;
src\roslyn\src\Analyzers\CSharp\Analyzers\ValidateFormatString\CSharpValidateFormatStringDiagnosticAnalyzer.cs (1)
37
=> ((ArgumentSyntax)syntaxNode).
Expression
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
56
stylePreferences, argument.
Expression
, semanticModel, tupleElementType, cancellationToken))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
198
argument.
Expression
== expression;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (4)
88
if (nodeParent.GetRequiredParent().ChildNodes().OfType<ArgumentSyntax>().Any(a => a.
Expression
.IsKind(opposite)))
200
if (nodeParent is ArgumentSyntax argument && argument.
Expression
== node)
667
previousExpression = argumentList.Arguments[argumentIndex - 1].
Expression
;
702
nextExpression = argumentList.Arguments[argumentIndex + 1].
Expression
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
590
=> ((ArgumentSyntax)node).
Expression
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\CSharpInferredMemberNameSimplifier.cs (2)
29
var inferredName = node.
Expression
.TryGetInferredMemberName();
72
if (argument.NameColon is null && argument.
Expression
.TryGetInferredMemberName()?.Equals(name) == true)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (19)
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddExplicitCast\ArgumentFixer.cs (2)
18
=> argument.
Expression
;
21
=> oldArgument.WithExpression(oldArgument.
Expression
.Cast(conversionType));
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
166
var argumentExpression = tuple.Arguments[i].
Expression
;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
899
return arguments.SelectAsArray(a => indent(a.
Expression
));
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
65
var expressions = dummyObjectCreation.ArgumentList.Arguments.Select(a => a.
Expression
);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (2)
117
if (match.UseSpread && argument.
Expression
is CollectionExpressionSyntax collectionExpression)
133
result.Add(new(argument.
Expression
, match.UseSpread, UseKeyValue: false));
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
66
var expressions = dummyObjectCreation.ArgumentList.Arguments.Select(a => a.
Expression
);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (2)
126
var expression = arguments[0].
Expression
;
137
arguments.Select(a => a.
Expression
),
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (3)
134
a => a.
Expression
.Kind() != SyntaxKind.DefaultLiteralExpression && Equals(arrayElementType, semanticModel.GetTypeInfo(a.
Expression
).Type));
164
.Select(a => a.IsNode ? ((ArgumentSyntax)a.AsNode()!).
Expression
: a);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
107
if (existingArgument.Expression is InvocationExpressionSyntax { ArgumentList.Arguments: [{
Expression
: var nameofArgument }] } invocation &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\InternalExtensions.cs (1)
18
return DetermineParameterType(argument.
Expression
, semanticModel, cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (1)
108
argument.
Expression
, capitalize: false, cancellationToken: cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1835
var argumentExpression = invocation.ArgumentList.Arguments[0].
Expression
;
2383
var expr = arg.
Expression
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
31
=> new(argument.GetRefKind(), argument.NameColon?.Name.Identifier.ValueText, argument.
Expression
);
Microsoft.CodeAnalysis.CSharp.Features (54)
ChangeSignature\CSharpChangeSignatureService.cs (2)
654
lastArgumentExpression = lastArgument.
Expression
;
923
var listOfArguments = SeparatedList(newArguments.Skip(indexInExistingList).Select(a => ((ArgumentSyntax)(SyntaxNode)a).
Expression
), newArguments.GetSeparators().Skip(indexInExistingList));
ChangeSignature\UnifiedArgumentSyntax.cs (1)
66
? argument.
Expression
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
245
tupleExpression.Arguments.Count(a => nonConflictReferences.Contains(a.
Expression
)) == 1)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (3)
702
switch (argumentSyntax.
Expression
?.Kind())
707
return ((DeclarationExpressionSyntax)argumentSyntax.
Expression
).Type;
712
return argumentSyntax.
Expression
;
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
258
var selectExpression = invocationExpression.ArgumentList.Arguments.Single().
Expression
;
Debugging\CSharpProximityExpressionsService.RelevantExpressionsCollector.cs (1)
119
AddVariableExpressions(a.
Expression
, expressions);
Debugging\CSharpProximityExpressionsService_ExpressionTermCollector.cs (2)
396
AddSubExpressionTerms(arg.
Expression
, terms, ref flags);
399
terms.Add(ConvertToString(arg.
Expression
));
EditAndContinue\SyntaxComparer.cs (1)
1341
GetLocalNames(argument.
Expression
, ref result);
GenerateType\CSharpGenerateTypeService.cs (1)
370
objectCreationExpressionOpt.ArgumentList.Arguments is [{
Expression
: (kind: not SyntaxKind.DeclarationExpression) expression }])
InlineHints\CSharpInlineParameterNameHintsService.cs (1)
82
buffer.Add((argument.Span.Start, argument, parameter, GetKind(argument.
Expression
)));
IntroduceVariable\CSharpIntroduceVariableService.Rewriter.cs (2)
64
newNode.
Expression
.HasAnnotation(s_replacementAnnotation) &&
67
var inferredName = node.
Expression
.TryGetInferredMemberName();
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (2)
322
invocation.ArgumentList.Arguments[0].
Expression
.Kind() == SyntaxKind.DeclarationExpression)
341
var argumentExpression = currentInvocation.ArgumentList.Arguments[0].
Expression
.Parenthesize();
src\roslyn\src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
88
var argumentExpression = argumentNode.
Expression
;
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
102
if (argument.
Expression
is not IdentifierNameSyntax argumentIdentifier)
src\roslyn\src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (2)
110
ArgumentList.Arguments: [{
Expression
: LambdaExpressionSyntax whereLambda1 }],
150
Expression
: LambdaExpressionSyntax
src\roslyn\src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (3)
60
AddIneligibleFieldsForExpression(argument.
Expression
);
64
if (argument.
Expression
.IsNameOfArgumentExpression())
65
AddIneligibleFieldsForExpression(argument.
Expression
, alwaysRestricted: true);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
149
argumentIndex == arguments.Count - 1 && arguments[argumentIndex] is { RefKindKeyword.RawKind: (int)SyntaxKind.OutKeyword,
Expression
: DeclarationExpressionSyntax { Designation: SingleVariableDesignationSyntax singleVariable } }
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
238
var argumentType = semanticModel.GetTypeInfo(objectCreation.ArgumentList.Arguments[0].
Expression
, cancellationToken).Type;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (7)
539
if (argument.
Expression
.IsNameOfArgumentExpression())
581
siblingArgument.
Expression
is DeclarationExpressionSyntax { Designation: SingleVariableDesignationSyntax designation })
836
if (semanticModel.GetConstantValue(elementArgument.
Expression
, cancellationToken).Value is not int indexValue ||
976
if (arguments is [{
Expression
: ArrayCreationExpressionSyntax { Initializer: not null } or ImplicitArrayCreationExpressionSyntax }])
1004
if (arguments[0].
Expression
1025
var argExpression = argument.
Expression
;
1207
var expression = arguments.Single().
Expression
;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (3)
146
preMatches.Add(new(argumentList.Arguments[0].
Expression
, UseSpread: true, UseKeyValue: false));
176
spreadElements.Add(invocation.ArgumentList.Arguments[0].
Expression
);
194
var currentArgumentExpression = argumentList.Arguments[0].
Expression
;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
195
var arg0 = invocation.ArgumentList.Arguments[0].
Expression
;
196
var arg1 = invocation.ArgumentList.Arguments[1].
Expression
;
src\roslyn\src\Analyzers\CSharp\Analyzers\ValidateFormatString\CSharpValidateFormatStringDiagnosticAnalyzer.cs (1)
37
=> ((ArgumentSyntax)syntaxNode).
Expression
;
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddExplicitCast\ArgumentFixer.cs (2)
18
=> argument.
Expression
;
21
=> oldArgument.WithExpression(oldArgument.
Expression
.Cast(conversionType));
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
166
var argumentExpression = tuple.Arguments[i].
Expression
;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
899
return arguments.SelectAsArray(a => indent(a.
Expression
));
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
65
var expressions = dummyObjectCreation.ArgumentList.Arguments.Select(a => a.
Expression
);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (2)
117
if (match.UseSpread && argument.
Expression
is CollectionExpressionSyntax collectionExpression)
133
result.Add(new(argument.
Expression
, match.UseSpread, UseKeyValue: false));
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
66
var expressions = dummyObjectCreation.ArgumentList.Arguments.Select(a => a.
Expression
);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (2)
126
var expression = arguments[0].
Expression
;
137
arguments.Select(a => a.
Expression
),
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (3)
134
a => a.
Expression
.Kind() != SyntaxKind.DefaultLiteralExpression && Equals(arrayElementType, semanticModel.GetTypeInfo(a.
Expression
).Type));
164
.Select(a => a.IsNode ? ((ArgumentSyntax)a.AsNode()!).
Expression
: a);
UseNamedArguments\CSharpUseNamedArgumentsCodeRefactoringProvider.cs (1)
77
=> argumentSyntax.
Expression
;
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (26)
Microsoft.CodeQuality.Analyzers\Maintainability\CSharpUseCrossPlatformIntrinsicsFixer.cs (3)
48
if (binaryOpFunc(arguments[0].
Expression
, arguments[1].
Expression
) is not ExpressionSyntax replacementExpression)
72
if (unaryOpFunc(arguments[0].
Expression
) is not ExpressionSyntax replacementExpression)
Microsoft.NetCore.Analyzers\Performance\CSharpCollapseMultiplePathOperations.Fixer.cs (1)
77
if (argument.
Expression
is InvocationExpressionSyntax nestedInvocation &&
Microsoft.NetCore.Analyzers\Performance\CSharpDoNotUseCountWhenAnyCanBeUsed.Fixer.cs (1)
59
sourceExpression: invocation.ArgumentList.Arguments[0].
Expression
,
Microsoft.NetCore.Analyzers\Performance\CSharpPreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (1)
88
changedValueNode = invocation.ArgumentList.Arguments[1].
Expression
;
Microsoft.NetCore.Analyzers\Performance\CSharpPreferHashDataOverComputeHash.Fixer.cs (1)
83
firstArg.
Expression
,
Microsoft.NetCore.Analyzers\Performance\CSharpPreferIsEmptyOverCount.Fixer.cs (1)
41
countNode = invocationExpression.ArgumentList.Arguments[0].
Expression
;
Microsoft.NetCore.Analyzers\Performance\CSharpPreferLengthCountIsEmptyOverAny.Fixer.cs (2)
27
expression = invocation.ArgumentList.Arguments[0].
Expression
;
69
expression = invocation.ArgumentList.Arguments[0].
Expression
;
Microsoft.NetCore.Analyzers\Performance\CSharpRecommendCaseInsensitiveStringComparisonFixer.cs (1)
77
desiredExpression = argumentExpression.
Expression
;
Microsoft.NetCore.Analyzers\Performance\CSharpUseAsSpanInsteadOfRangeIndexer.Fixer.cs (1)
29
node = arg.
Expression
;
Microsoft.NetCore.Analyzers\Performance\CSharpUseStartsWithInsteadOfIndexOfComparisonWithZero.Fixer.cs (1)
29
SyntaxFactory.InitializerExpression(SyntaxKind.ArrayInitializerExpression, SyntaxFactory.SingletonSeparatedList(argumentSyntax.
Expression
))
Microsoft.NetCore.Analyzers\Performance\CSharpUseStringContainsCharOverloadWithSingleCharactersFixer.cs (1)
39
&& argumentSyntax.
Expression
is LiteralExpressionSyntax containedLiteralExpressionSyntax)
Microsoft.NetCore.Analyzers\Performance\CSharpUseStringMethodCharOverloadWithSingleCharacters.Fixer.cs (1)
42
stringArgumentNode.
Expression
is LiteralExpressionSyntax containedLiteralExpressionSyntax)
Microsoft.NetCore.Analyzers\Runtime\CSharpForwardCancellationTokenToInvocations.Fixer.cs (1)
74
return newArguments.Select(x => x.
Expression
);
Microsoft.NetCore.Analyzers\Runtime\CSharpPreferStreamAsyncMemoryOverloads.Fixer.cs (5)
62
arg1.
Expression
is IdentifierNameSyntax firstArgumentIdentifierName)
66
arg2.
Expression
is LiteralExpressionSyntax literal &&
71
arg3.
Expression
is MemberAccessExpressionSyntax thirdArgumentMemberAccessExpression &&
106
actualNode = argument.
Expression
;
121
actualNode = argument.
Expression
;
Microsoft.NetCore.Analyzers\Runtime\CSharpTestForEmptyStringsUsingStringLength.Fixer.cs (1)
21
return node is ArgumentSyntax argumentSyntax ? argumentSyntax.
Expression
: node;
Microsoft.NetCore.Analyzers\Runtime\CSharpTestForNaNCorrectly.Fixer.cs (1)
21
return node is ArgumentSyntax argumentSyntax ? argumentSyntax.
Expression
: node;
Microsoft.NetCore.Analyzers\Runtime\CSharpUseOrdinalStringComparison.Fixer.cs (2)
25
((ArgumentSyntax)node).
Expression
.IsKind(SyntaxKind.SimpleMemberAccessExpression);
30
if (((ArgumentSyntax)argument)?.
Expression
is MemberAccessExpressionSyntax memberAccess)
Microsoft.NetCore.Analyzers\Usage\CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullFixer.cs (1)
22
var nullableStructExpression = invocation.ArgumentList.Arguments[0].
Expression
;
Microsoft.CodeAnalysis.CSharp.Workspaces (26)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
960
if (node is ArgumentSyntax arg && arg.
Expression
!= null)
962
return SyntaxFactory.AttributeArgument(null, arg.NameColon, arg.
Expression
);
Recommendations\CSharpRecommendationServiceRunner.cs (1)
481
if (argument.
Expression
is IdentifierNameSyntax { Identifier.ValueText: var argumentIdentifier } &&
Simplification\CSharpSimplificationService.Expander.cs (7)
257
var inferredName = node.
Expression
.TryGetInferredMemberName();
271
var argumentType = _semanticModel.GetTypeInfo(node.
Expression
).ConvertedType;
274
node.
Expression
.Kind() != SyntaxKind.DeclarationExpression &&
277
if (TryCastTo(argumentType, node.
Expression
, newArgument.
Expression
, out var newArgumentExpressionWithCast))
303
elementName = argument.
Expression
?.TryGetInferredMemberName();
792
var typeinfo = semanticModel.GetTypeInfo(argument.
Expression
);
Simplification\Reducers\CSharpExtensionMethodReducer.cs (1)
73
var expression = argumentList.Arguments[0].
Expression
.Parenthesize();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
56
stylePreferences, argument.
Expression
, semanticModel, tupleElementType, cancellationToken))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
198
argument.
Expression
== expression;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (4)
88
if (nodeParent.GetRequiredParent().ChildNodes().OfType<ArgumentSyntax>().Any(a => a.
Expression
.IsKind(opposite)))
200
if (nodeParent is ArgumentSyntax argument && argument.
Expression
== node)
667
previousExpression = argumentList.Arguments[argumentIndex - 1].
Expression
;
702
nextExpression = argumentList.Arguments[argumentIndex + 1].
Expression
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
590
=> ((ArgumentSyntax)node).
Expression
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\CSharpInferredMemberNameSimplifier.cs (2)
29
var inferredName = node.
Expression
.TryGetInferredMemberName();
72
if (argument.NameColon is null && argument.
Expression
.TryGetInferredMemberName()?.Equals(name) == true)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
107
if (existingArgument.Expression is InvocationExpressionSyntax { ArgumentList.Arguments: [{
Expression
: var nameofArgument }] } invocation &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\InternalExtensions.cs (1)
18
return DetermineParameterType(argument.
Expression
, semanticModel, cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (1)
108
argument.
Expression
, capitalize: false, cancellationToken: cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1835
var argumentExpression = invocation.ArgumentList.Arguments[0].
Expression
;
2383
var expr = arg.
Expression
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
31
=> new(argument.GetRefKind(), argument.NameColon?.Name.Identifier.ValueText, argument.
Expression
);
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\AppContextDefaultsAnalyzer.cs (1)
74
if (args.
Expression
.Kind() != SyntaxKind.TrueLiteralExpression)
Microsoft.Maui.Controls.BindingSourceGen (9)
BindingSourceGenerator.cs (6)
58
&& invocation.ArgumentList.Arguments[1].
Expression
is not LiteralExpressionSyntax
59
&& invocation.ArgumentList.Arguments[1].
Expression
is not ObjectCreationExpressionSyntax;
68
&& invocation.ArgumentList.Arguments[0].
Expression
is not LiteralExpressionSyntax
69
&& invocation.ArgumentList.Arguments[0].
Expression
is not ObjectCreationExpressionSyntax
170
InterceptedMethodType.SetBinding => argumentList[1].
Expression
,
171
InterceptedMethodType.Create => argumentList[0].
Expression
,
InvocationParser.cs (2)
53
var firstArgument = argumentsList[0].
Expression
; // Guaranteed to have at least one argument (checked by the caller)
94
var secondArgument = argumentsList[1].
Expression
;
PathParser.cs (1)
183
var indexExpression = argumentList[0].
Expression
;
Microsoft.ML.InternalCodeAnalyzer (11)
ContractsCheckAnalyzer.cs (5)
229
if (!NameIsNameof(arg.
Expression
))
232
NameofDiagnostic.Rule, arg.GetLocation(), name, parameter.Name, arg.
Expression
));
236
if (isCheck && !IsGoodMessage(context, arg.
Expression
))
239
SimpleMessageDiagnostic.Rule, arg.GetLocation(), name, arg.
Expression
));
244
DecodeMessageWithLoadContextDiagnostic.Rule, arg.GetLocation(), name, arg.
Expression
));
ContractsCheckNameofFixProvider.cs (6)
45
string nameArgValue = (nameArg.
Expression
as LiteralExpressionSyntax)?.Token.ValueText;
60
argList.Arguments[0].
Expression
.GetText();
62
argList.Arguments[1] == nameArg && argList.Arguments[0].
Expression
.ToString() == nameArgValue)
172
var newRoot = root.ReplaceNode(nameArg.
Expression
, nameofExp);
179
var newNameofExp = nameofExp.ReplaceNode(nameofExp.ArgumentList.Arguments[0].
Expression
, exp.WithoutTrivia());
183
var newRoot = root.ReplaceNode(nameArg.
Expression
, newNameofExp);
Roslyn.Diagnostics.CSharp.Analyzers (16)
CSharpSymbolDeclaredEventMustBeGeneratedForSourceSymbols.cs (1)
58
return argument.
Expression
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
56
stylePreferences, argument.
Expression
, semanticModel, tupleElementType, cancellationToken))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
198
argument.
Expression
== expression;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (4)
88
if (nodeParent.GetRequiredParent().ChildNodes().OfType<ArgumentSyntax>().Any(a => a.
Expression
.IsKind(opposite)))
200
if (nodeParent is ArgumentSyntax argument && argument.
Expression
== node)
667
previousExpression = argumentList.Arguments[argumentIndex - 1].
Expression
;
702
nextExpression = argumentList.Arguments[argumentIndex + 1].
Expression
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
590
=> ((ArgumentSyntax)node).
Expression
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\CSharpInferredMemberNameSimplifier.cs (2)
29
var inferredName = node.
Expression
.TryGetInferredMemberName();
72
if (argument.NameColon is null && argument.
Expression
.TryGetInferredMemberName()?.Equals(name) == true)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
107
if (existingArgument.Expression is InvocationExpressionSyntax { ArgumentList.Arguments: [{
Expression
: var nameofArgument }] } invocation &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\InternalExtensions.cs (1)
18
return DetermineParameterType(argument.
Expression
, semanticModel, cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (1)
108
argument.
Expression
, capitalize: false, cancellationToken: cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1835
var argumentExpression = invocation.ArgumentList.Arguments[0].
Expression
;
2383
var expr = arg.
Expression
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
31
=> new(argument.GetRefKind(), argument.NameColon?.Name.Identifier.ValueText, argument.
Expression
);
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (1)
71
var argumentToValidate = arguments.First().
Expression
;