108 references to Name
Microsoft.CodeAnalysis.CSharp (79)
_generated\0\Syntax.xml.Main.Generated.cs (1)
1990
=> node.Update((NameSyntax?)Visit(node.
Name
) ?? throw new ArgumentNullException("name"), (AttributeArgumentListSyntax?)Visit(node.ArgumentList));
_generated\2\Syntax.xml.Syntax.Generated.cs (2)
9966
if (name != this.
Name
|| argumentList != this.ArgumentList)
9977
public AttributeSyntax WithArgumentList(AttributeArgumentListSyntax? argumentList) => Update(this.
Name
, argumentList);
Binder\Binder_Attributes.cs (3)
54
var boundType = binder.BindType(attributeToBind.
Name
, diagnostics);
60
binder.CheckDisallowedAttributeDependentType(boundType, attributeToBind.
Name
, diagnostics);
302
ValidateTypeForAttributeParameters(attributeConstructor.Parameters, ((AttributeSyntax)boundAttribute.Syntax).
Name
, diagnostics, ref hasErrors);
Binder\Binder_Expressions.cs (1)
6370
AttributeSyntax {
Name
: { } name } => name.Location,
Binder\Binder_Symbols.cs (1)
1014
case AttributeSyntax parent when parent.
Name
== node: // [nint]
Compilation\CSharpSemanticModel.cs (3)
417
NamedTypeSymbol attributeType = (NamedTypeSymbol)binder.BindType(attribute.
Name
, BindingDiagnosticBag.Discarded, out aliasOpt).Type;
2783
var attributeType = (NamedTypeSymbol)binder.BindType(attribute.
Name
, BindingDiagnosticBag.Discarded, out aliasOpt).Type;
4007
parentSyntax.Kind() == SyntaxKind.Attribute && ((AttributeSyntax)parentSyntax).
Name
== boundNode.Syntax)
Compilation\PublicSemanticModel.cs (1)
20
var attributeType = (NamedTypeSymbol)enclosingBinder.BindType(attribute.
Name
, BindingDiagnosticBag.Discarded, out aliasOpt).Type;
Declarations\DeclarationTreeBuilder.cs (1)
904
result |= QuickAttributeHelpers.GetQuickAttributes(attribute.
Name
.GetUnqualifiedName().Identifier.ValueText, inAttribute: true);
Errors\MessageProvider.cs (2)
293
diagnostics.Add(ErrorCode.ERR_AttributeParameterRequired1, node.
Name
.Location, parameterName);
299
diagnostics.Add(ErrorCode.ERR_AttributeParameterRequired2, node.
Name
.Location, parameterName1, parameterName2);
SourceGeneration\CSharpSyntaxHelper.cs (1)
33
=> ((AttributeSyntax)node).
Name
;
Symbols\Attributes\AttributeData.cs (1)
375
diagnostics.Add(ErrorCode.ERR_SecurityAttributeMissingAction, nodeOpt != null ? nodeOpt.
Name
.Location : NoLocation.Singleton);
Symbols\Attributes\SourceAttributeData.cs (1)
154
return attributeSyntax.
Name
;
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (2)
185
diagnostics.Add(ErrorCode.ERR_StructOffsetOnBadField, arguments.AttributeSyntaxOpt.
Name
.Location);
334
diagnostics.Add(ErrorCode.ERR_StructOffsetOnBadStruct, allAttributeSyntaxNodes[i].
Name
.Location);
Symbols\Source\QuickAttributeChecker.cs (1)
128
string name = attr.
Name
.GetUnqualifiedName().Identifier.ValueText;
Symbols\Source\SourceComplexParameterSymbol.cs (33)
792
diagnostics.Add(ErrorCode.ERR_DefaultValueUsedWithAttributes, arguments.AttributeSyntaxOpt.
Name
.Location);
798
diagnostics.Add(ErrorCode.ERR_ExplicitParamArrayOrCollection, arguments.AttributeSyntaxOpt.
Name
.Location);
991
diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueUsedWithAttributes, node.
Name
.Location);
1029
diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueTypeMustMatch, node.
Name
.Location);
1039
diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueBadValueType, node.
Name
.Location, arg.TypeInternal);
1049
diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueTypeMustMatch, node.
Name
.Location);
1050
diagnosticsOpt.Add(node.
Name
, useSiteInfo);
1057
diagnosticsOpt.Add(node.
Name
, useSiteInfo);
1097
diagnostics.Add(ErrorCode.WRN_CallerLineNumberParamForUnconsumedLocation, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1103
diagnostics.Add(ErrorCode.ERR_NoConversionForCallerLineNumberParam, node.
Name
.Location, intType, TypeWithAnnotations.Type);
1110
diagnostics.Add(ErrorCode.ERR_BadCallerLineNumberParamWithoutDefaultValue, node.
Name
.Location);
1113
diagnostics.Add(node.
Name
, useSiteInfo);
1125
diagnostics.Add(ErrorCode.WRN_CallerFilePathParamForUnconsumedLocation, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1131
diagnostics.Add(ErrorCode.ERR_NoConversionForCallerFilePathParam, node.
Name
.Location, stringType, TypeWithAnnotations.Type);
1138
diagnostics.Add(ErrorCode.ERR_BadCallerFilePathParamWithoutDefaultValue, node.
Name
.Location);
1143
diagnostics.Add(ErrorCode.WRN_CallerLineNumberPreferredOverCallerFilePath, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1146
diagnostics.Add(node.
Name
, useSiteInfo);
1158
diagnostics.Add(ErrorCode.WRN_CallerMemberNameParamForUnconsumedLocation, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1164
diagnostics.Add(ErrorCode.ERR_NoConversionForCallerMemberNameParam, node.
Name
.Location, stringType, TypeWithAnnotations.Type);
1171
diagnostics.Add(ErrorCode.ERR_BadCallerMemberNameParamWithoutDefaultValue, node.
Name
.Location);
1176
diagnostics.Add(ErrorCode.WRN_CallerLineNumberPreferredOverCallerMemberName, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1181
diagnostics.Add(ErrorCode.WRN_CallerFilePathPreferredOverCallerMemberName, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1184
diagnostics.Add(node.
Name
, useSiteInfo);
1199
diagnostics.Add(ErrorCode.WRN_CallerArgumentExpressionParamForUnconsumedLocation, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1205
diagnostics.Add(ErrorCode.ERR_NoConversionForCallerArgumentExpressionParam, node.
Name
.Location, stringType, TypeWithAnnotations.Type);
1212
diagnostics.Add(ErrorCode.ERR_BadCallerArgumentExpressionParamWithoutDefaultValue, node.
Name
.Location);
1217
diagnostics.Add(ErrorCode.WRN_CallerLineNumberPreferredOverCallerArgumentExpression, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1222
diagnostics.Add(ErrorCode.WRN_CallerFilePathPreferredOverCallerArgumentExpression, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1227
diagnostics.Add(ErrorCode.WRN_CallerMemberNamePreferredOverCallerArgumentExpression, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1233
diagnostics.Add(ErrorCode.WRN_CallerArgumentExpressionAttributeHasInvalidParameterName, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1238
diagnostics.Add(ErrorCode.WRN_CallerArgumentExpressionAttributeSelfReferential, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1241
diagnostics.Add(node.
Name
, useSiteInfo);
1264
diagnostics.Add(ErrorCode.WRN_UnconsumedEnumeratorCancellationAttributeUsage, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
Symbols\Source\SourceFieldSymbol.cs (1)
126
((BindingDiagnosticBag)arguments.Diagnostics).Add(ErrorCode.ERR_DoNotUseFixedBufferAttr, arguments.AttributeSyntaxOpt.
Name
.Location);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (6)
714
diagnostics.Add(ErrorCode.ERR_AttributeNotOnEventAccessor, arguments.AttributeSyntaxOpt.
Name
.Location, description.FullName, attributeUsage.GetValidTargetsErrorArgument());
736
diagnostics.Add(ErrorCode.ERR_AttributeNotOnAccessor, node.
Name
.Location, node.GetErrorDisplayName(), attributeUsage.GetValidTargetsErrorArgument());
844
diagnostics.Add(ErrorCode.ERR_DllImportOnInvalidMethod, arguments.AttributeSyntaxOpt.
Name
.Location);
860
diagnostics.Add(ErrorCode.ERR_DllImportOnGenericMethod, arguments.AttributeSyntaxOpt.
Name
.Location);
1028
var attributeNameSyntax = arguments.AttributeSyntaxOpt.
Name
; // used for reporting diagnostics
1397
bool reportedError = CheckAndReportValidUnmanagedCallersOnlyTarget(arguments.AttributeSyntaxOpt.
Name
, diagnostics);
Symbols\Source\SourceNamedTypeSymbol.cs (8)
1180
diagnostics.Add(ErrorCode.ERR_CantUseRequiredAttribute, arguments.AttributeSyntaxOpt.
Name
.Location);
1211
diagnostics.Add(ErrorCode.ERR_CollectionBuilderAttributeInvalidType, arguments.AttributeSyntaxOpt.
Name
.Location);
1221
diagnostics.Add(ErrorCode.ERR_CollectionBuilderAttributeInvalidMethodName, arguments.AttributeSyntaxOpt.
Name
.Location);
1239
diagnostics.Add(ErrorCode.ERR_AttributeOnBadSymbolType, arguments.AttributeSyntaxOpt.
Name
.Location, arguments.AttributeSyntaxOpt.GetErrorDisplayName(), "struct");
1243
diagnostics.Add(ErrorCode.ERR_InlineArrayAttributeOnRecord, arguments.AttributeSyntaxOpt.
Name
.Location);
1337
diagnosticsOpt.Add(ErrorCode.ERR_AttributeUsageOnNonAttributeClass, node.
Name
.Location, node.GetErrorDisplayName());
1664
diagnostics.Add(ErrorCode.ERR_ComImportWithoutUuidAttribute, allAttributeSyntaxNodes[index].
Name
.Location);
1721
diagnostics.Add(ErrorCode.ERR_DefaultMemberOnIndexedType, allAttributeSyntaxNodes[index].
Name
.Location);
Symbols\Source\SourcePropertySymbolBase.cs (1)
1748
diagnostics.Add(ErrorCode.ERR_BadIndexerNameAttr, node.
Name
.Location, node.GetErrorDisplayName());
Symbols\Symbol_Attributes.cs (5)
555
var boundType = binder.BindType(attributeSyntax.
Name
, BindingDiagnosticBag.Discarded);
913
diagnostics.Add(ErrorCode.ERR_AttributesNotAllowed, node.
Name
.Location);
920
diagnostics.Add(ErrorCode.ERR_DuplicateAttribute, node.
Name
.Location, node.GetErrorDisplayName());
940
diagnostics.Add(ErrorCode.ERR_AttributeOnBadSymbolType, node.
Name
.Location, node.GetErrorDisplayName(), attributeUsageInfo.GetValidTargetsErrorArgument());
955
diagnostics.Add(ErrorCode.ERR_SecurityAttributeInvalidTarget, node.
Name
.Location, node.GetErrorDisplayName());
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
259
((BindingDiagnosticBag)arguments.Diagnostics).Add(ErrorCode.ERR_DoNotUseFixedBufferAttrOnProperty, arguments.AttributeSyntaxOpt.
Name
.Location);
Syntax\AttributeSyntax.cs (1)
20
return
Name
.ErrorDisplayName();
Syntax\SyntaxFacts.cs (2)
48
return p != null && p.
Name
== node;
91
return ((AttributeSyntax)parent).
Name
== node;
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
58
var attributeName = attribute.
Name
.GetRightmostName()?.Identifier.ValueText;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1516
name = attribute.
Name
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (1)
54
AttributeSyntax attributeNode => attributeNode.
Name
,
Microsoft.CodeAnalysis.CSharp.Features (5)
EditAndContinue\SyntaxComparer.cs (1)
1511
return ((AttributeSyntax)node).
Name
;
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (1)
98
Name
: var attributeName
src\roslyn\src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
58
var attributeName = attribute.
Name
.GetRightmostName()?.Identifier.ValueText;
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (1)
54
AttributeSyntax attributeNode => attributeNode.
Name
,
Testing\CSharpTestMethodFinder.cs (1)
46
var attributeName = attribute.
Name
.GetNameToken().Text;
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (2)
Microsoft.NetCore.Analyzers\Performance\CSharpConstantExpectedAnalyzer.cs (1)
30
var attributeName = attributeSyntax.
Name
;
Microsoft.NetCore.Analyzers\Resources\CSharpMarkAssembliesWithNeutralResourcesLanguage.cs (1)
45
return attribute?.
Name
?.GetLastToken().Text?.Equals(GeneratedCodeAttribute, StringComparison.Ordinal) == true &&
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
CodeGeneration\CSharpSyntaxGenerator.cs (4)
2062
AttributeListSyntax attributeList when attributeList.Attributes.Count == 1 => attributeList.Attributes[0].
Name
.ToString(),
2063
AttributeSyntax attribute => attribute.
Name
.ToString(),
2095
ReplaceWithTrivia(declaration, attributeList.Attributes[0].
Name
, this.DottedName(name)),
2097
AttributeSyntax attribute => ReplaceWithTrivia(declaration, attribute.
Name
, this.DottedName(name)),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1516
name = attribute.
Name
;
Microsoft.Gen.BuildMetadata (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
92
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Gen.ComplianceReports (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
92
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Gen.ContextualOptions (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
92
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Gen.Logging (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
92
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Gen.MetadataExtractor (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
92
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Gen.Metrics (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
92
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Gen.MetricsReports (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
92
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
439
dllImportSyntax.
Name
,
QuarantineTools.Tests (4)
ActiveIssueTests.cs (2)
376
string lastId = attr.
Name
switch
381
_ => attr.
Name
.ToString().Split('.').Last()
QuarantineScriptTests.cs (2)
320
string lastId = attr.
Name
switch
325
_ => attr.
Name
.ToString().Split('.').Last()
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1516
name = attribute.
Name
;
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (1)
70
.Any(a => a.
Name
.ToString() == DesignerSerializationVisibilityAttributeName))