136 references to ArgumentList
Microsoft.AspNetCore.App.Analyzers (3)
Mvc\MvcAnalyzer.cs (1)
178attributeSyntax.ArgumentList is { } argumentList)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (2)
299if (attribute.ArgumentList != null) 301foreach (var attributeArgument in attribute.ArgumentList.Arguments)
Microsoft.CodeAnalysis.CSharp (25)
Binder\Binder_Attributes.cs (1)
181var argumentListOpt = node.ArgumentList;
Binder\ExpressionVariableFinder.cs (2)
169if (node.ArgumentList != null) 171foreach (AttributeArgumentSyntax argument in node.ArgumentList.Arguments)
Binder\LocalBinderFactory.cs (2)
484if (node.ArgumentList?.Arguments.Count > 0) 486foreach (AttributeArgumentSyntax argument in node.ArgumentList.Arguments)
Errors\MessageProvider.cs (2)
270diagnostics.Add(ErrorCode.ERR_InvalidNamedArgument, node.ArgumentList.Arguments[namedArgumentIndex].Location, parameterName); 276diagnostics.Add(ErrorCode.ERR_ParameterNotValidForType, node.ArgumentList.Arguments[namedArgumentIndex].Location);
Symbols\Attributes\AttributeData.cs (3)
90int argumentCount = (attributeSyntax.ArgumentList != null) ? 91attributeSyntax.ArgumentList.Arguments.Count(static (arg) => arg.NameEquals == null) : 476var argList = nodeOpt.ArgumentList;
Symbols\Attributes\SourceAttributeData.cs (5)
139Debug.Assert(attributeSyntax.ArgumentList != null); 140Debug.Assert(this.AttributeConstructor.ParameterCount <= attributeSyntax.ArgumentList.Arguments.Count); 142return attributeSyntax.ArgumentList.Arguments[parameterIndex]; 159Debug.Assert(sourceArgIndex < attributeSyntax.ArgumentList!.Arguments.Count); 160return attributeSyntax.ArgumentList.Arguments[sourceArgIndex];
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
830RoslynDebug.Assert(arguments.AttributeSyntaxOpt?.ArgumentList is object); 893diagnostics.Add(ErrorCode.ERR_InvalidNamedArgument, arguments.AttributeSyntaxOpt.ArgumentList.Arguments[position].Location, namedArg.Key);
Symbols\Source\SourcePropertySymbolBase.cs (3)
506if (node.ArgumentList?.Arguments is not [{ NameColon: null, NameEquals: null, Expression: LiteralExpressionSyntax { RawKind: (int)SyntaxKind.StringLiteralExpression } }]) 1737diagnostics.Add(ErrorCode.ERR_BadArgumentToAttribute, node.ArgumentList.Arguments[0].Location, node.GetErrorDisplayName()); 1743diagnostics.Add(ErrorCode.ERR_InsufficientStack, node.ArgumentList.Arguments[0].Location);
Symbols\Symbol_Attributes.cs (1)
478attributesToBind[i].ArgumentList?.Arguments[0].Expression.Location is { } location)
Syntax.xml.Main.Generated.cs (1)
1978=> node.Update((NameSyntax?)Visit(node.Name) ?? throw new ArgumentNullException("name"), (AttributeArgumentListSyntax?)Visit(node.ArgumentList));
Syntax.xml.Syntax.Generated.cs (3)
9920if (name != this.Name || argumentList != this.ArgumentList) 9930public AttributeSyntax WithName(NameSyntax name) => Update(name, this.ArgumentList); 9935var argumentList = this.ArgumentList ?? SyntaxFactory.AttributeArgumentList();
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (2)
55if (attribute.ArgumentList is null) 76foreach (var argument in attribute.ArgumentList.Arguments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1540argumentList = attribute.ArgumentList;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (3)
125if (attribute.ArgumentList != null && 126!attribute.ArgumentList.CloseParenToken.IsMissing) 132arguments = GetArguments(attribute.ArgumentList.Arguments);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (2)
104if (existingSyntax?.ArgumentList != null && constant.Kind is not TypedConstantKind.Array && constant.Value is string stringValue) 106foreach (var existingArgument in existingSyntax.ArgumentList.Arguments)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
381var index = attribute.ArgumentList.Arguments.IndexOf(argument);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (7)
Attributes\AttributeTests.cs (5)
754Assert.True(semanticModel.TryGetSpeculativeSemanticModel(attrSyntax.ArgumentList.Position, newAttrSyntax, out var speculativeModel)); 860Assert.True(semanticModel.TryGetSpeculativeSemanticModel(attrSyntax.ArgumentList.Position, newAttrSyntax, out var speculativeModel)); 901Assert.True(semanticModel.TryGetSpeculativeSemanticModel(attrSyntax.ArgumentList.Position, newAttrSyntax, out var speculativeModel)); 3125Assert.Equal(2, syntax.ArgumentList.Arguments.Count()); 3127Assert.Equal(0, syntax.ArgumentList.Arguments.Count());
Semantics\PrimaryConstructorTests.cs (1)
6864Assert.DoesNotContain("System.Int32 y", model.LookupSymbols(attrApplication.ArgumentList!.OpenParenToken.SpanStart + 1).Select(s => s.ToTestDisplayString()));
Semantics\RecordTests.cs (1)
30505Assert.DoesNotContain("System.Int32 y", model.LookupSymbols(attrApplication.ArgumentList!.OpenParenToken.SpanStart + 1).Select(s => s.ToTestDisplayString()));
Microsoft.CodeAnalysis.CSharp.Features (20)
ChangeSignature\CSharpChangeSignatureService.cs (7)
494if (attribute.ArgumentList == null) 504attribute.ArgumentList, 613if (attribute.ArgumentList == null) 618argumentCount = attribute.ArgumentList.Arguments.Count; 619lastArgumentIsNamed = attribute.ArgumentList.Arguments.LastOrDefault()?.NameColon != null || 620attribute.ArgumentList.Arguments.LastOrDefault()?.NameEquals != null; 622var lastArgument = attribute.ArgumentList.Arguments.LastOrDefault();
Completion\CompletionProviders\InternalsVisibleToCompletionProvider.cs (1)
50var arguments = ((AttributeSyntax)internalsVisibleToAttribute).ArgumentList!.Arguments;
SignatureHelp\AttributeSignatureHelpProvider.cs (7)
53return attribute.ArgumentList != null; 67return expression.ArgumentList != null && 68expression.ArgumentList.Span.Contains(token.SpanStart) && 69token != expression.ArgumentList.CloseParenToken; 104var textSpan = SignatureHelpUtilities.GetSignatureHelpSpan(attribute.ArgumentList!); 118currentSpan.Start == SignatureHelpUtilities.GetSignatureHelpSpan(expression.ArgumentList!).Start) 120return SignatureHelpUtilities.GetSignatureHelpState(expression.ArgumentList!, position);
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (2)
55if (attribute.ArgumentList is null) 76foreach (var argument in attribute.ArgumentList.Arguments)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (3)
125if (attribute.ArgumentList != null && 126!attribute.ArgumentList.CloseParenToken.IsMissing) 132arguments = GetArguments(attribute.ArgumentList.Arguments);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\LocalFunctionTests.cs (1)
452var attrArgs = attributeSyntax.ArgumentList.Arguments;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (6)
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (5)
4275var constantInfo = speculativeModel.GetConstantValue(attr2.ArgumentList.Arguments.First().Expression); 4290constantInfo = speculativeModel.GetConstantValue(attr3.ArgumentList.Arguments.First().Expression); 4336constantInfo = speculativeModel.GetConstantValue(attr6.ArgumentList.Arguments.First().Expression); 4359constantInfo = speculativeModel.GetConstantValue(attr7.ArgumentList.Arguments.First().Expression); 4381constantInfo = speculativeModel.GetConstantValue(attr8.ArgumentList.Arguments.First().Expression);
Symbols\Source\NullablePublicAPITests.cs (1)
4214var symbolInfo = specModel.GetSymbolInfo(newAttributeUsage.ArgumentList.Arguments[0].Expression);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (32)
Generated\Syntax.Test.xml.Generated.cs (2)
13055Assert.Null(node.ArgumentList); 13056var newNode = node.WithName(node.Name).WithArgumentList(node.ArgumentList);
Parsing\DeclarationParsingTests.cs (30)
276Assert.Null(ad.Attributes[0].ArgumentList); 305Assert.Null(ad.Attributes[0].ArgumentList); 334Assert.Null(ad.Attributes[0].ArgumentList); 361Assert.Null(ad.Attributes[0].ArgumentList); 389Assert.Null(ad.Attributes[0].ArgumentList); 416Assert.NotNull(ad.Attributes[0].ArgumentList); 417Assert.NotEqual(default, ad.Attributes[0].ArgumentList.OpenParenToken); 418Assert.Equal(0, ad.Attributes[0].ArgumentList.Arguments.Count); 419Assert.NotEqual(default, ad.Attributes[0].ArgumentList.CloseParenToken); 445Assert.NotNull(ad.Attributes[0].ArgumentList); 446Assert.NotEqual(default, ad.Attributes[0].ArgumentList.OpenParenToken); 447Assert.Equal(2, ad.Attributes[0].ArgumentList.Arguments.Count); 448Assert.Equal("b", ad.Attributes[0].ArgumentList.Arguments[0].ToString()); 449Assert.Equal("c", ad.Attributes[0].ArgumentList.Arguments[1].ToString()); 450Assert.NotEqual(default, ad.Attributes[0].ArgumentList.CloseParenToken); 476Assert.NotNull(ad.Attributes[0].ArgumentList); 477Assert.NotEqual(default, ad.Attributes[0].ArgumentList.OpenParenToken); 478Assert.Equal(1, ad.Attributes[0].ArgumentList.Arguments.Count); 479Assert.Equal("b = c", ad.Attributes[0].ArgumentList.Arguments[0].ToString()); 480Assert.NotNull(ad.Attributes[0].ArgumentList.Arguments[0].NameEquals); 481Assert.NotNull(ad.Attributes[0].ArgumentList.Arguments[0].NameEquals.Name); 482Assert.Equal("b", ad.Attributes[0].ArgumentList.Arguments[0].NameEquals.Name.ToString()); 483Assert.NotEqual(default, ad.Attributes[0].ArgumentList.Arguments[0].NameEquals.EqualsToken); 484Assert.NotNull(ad.Attributes[0].ArgumentList.Arguments[0].Expression); 485Assert.Equal("c", ad.Attributes[0].ArgumentList.Arguments[0].Expression.ToString()); 486Assert.NotEqual(default, ad.Attributes[0].ArgumentList.CloseParenToken); 513Assert.Null(ad.Attributes[0].ArgumentList); 517Assert.Null(ad.Attributes[1].ArgumentList); 543Assert.Null(ad.Attributes[0].ArgumentList); 555Assert.Null(ad.Attributes[0].ArgumentList);
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
CodeGeneration\CSharpSyntaxGenerator.cs (4)
1128if (attr.ArgumentList != null) 1130return attr.ArgumentList.Arguments; 1170return list.Attributes[0].ArgumentList; 1176return attr.ArgumentList;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1540argumentList = attribute.ArgumentList;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (2)
104if (existingSyntax?.ArgumentList != null && constant.Kind is not TypedConstantKind.Array && constant.Value is string stringValue) 106foreach (var existingArgument in existingSyntax.ArgumentList.Arguments)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
381var index = attribute.ArgumentList.Arguments.IndexOf(argument);
Microsoft.DotNet.GenFacades (1)
TypeParser.cs (1)
48var typeNameExpression = (TypeOfExpressionSyntax)item.ArgumentList.Arguments[0].Expression;
Microsoft.Gen.MetadataExtractor (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
325syntax.ArgumentList != null) 327foreach (var arg in syntax.ArgumentList.Arguments)
Microsoft.Gen.Metrics (2)
Parser.cs (2)
325syntax.ArgumentList != null) 327foreach (var arg in syntax.ArgumentList.Arguments)
Microsoft.Gen.MetricsReports (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
325syntax.ArgumentList != null) 327foreach (var arg in syntax.ArgumentList.Arguments)
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\ConvertToLibraryImportFixer.cs (3)
554AttributeArgumentListSyntax updatedArgList = attribute.ArgumentList.WithArguments( 556attribute.ArgumentList.Arguments.OrderBy(arg => 567return generator.ReplaceNode(attribute, attribute.ArgumentList, updatedArgList);
Microsoft.VisualStudio.LanguageServices.CSharp (11)
CodeModel\CSharpCodeModelService.CodeModelEventCollector.cs (2)
90if (!CompareAttributeArguments(oldAttribute.ArgumentList, newAttribute.ArgumentList))
CodeModel\CSharpCodeModelService.cs (9)
352if (attribute.ArgumentList == null) 355return attribute.ArgumentList.Arguments; 1607if (attribute.ArgumentList != null && 1608attribute.ArgumentList.Arguments.Count > index) 1610attributeArgumentNode = attribute.ArgumentList.Arguments[index]; 1665index = attribute.ArgumentList!.Arguments.IndexOf((AttributeArgumentSyntax)attributeArgumentNode); 1712var argumentList = attribute.ArgumentList; 1726var argumentList = attribute.ArgumentList; 3323var argumentList = attribute.ArgumentList;
Roslyn.Diagnostics.CSharp.Analyzers (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1540argumentList = attribute.ArgumentList;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (2)
104if (existingSyntax?.ArgumentList != null && constant.Kind is not TypedConstantKind.Array && constant.Value is string stringValue) 106foreach (var existingArgument in existingSyntax.ArgumentList.Arguments)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
381var index = attribute.ArgumentList.Arguments.IndexOf(argument);