150 references to Name
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
HubClientProxyGenerator.Parser.cs (1)
20
Name
: IdentifierNameSyntax
HubServerProxyGenerator.Parser.cs (1)
20
Name
: IdentifierNameSyntax
Microsoft.CodeAnalysis.CSharp (78)
Binder\Binder_Attributes.cs (3)
54
var boundType = binder.BindType(attributeToBind.
Name
, diagnostics);
60
binder.CheckDisallowedAttributeDependentType(boundType, attributeToBind.
Name
, diagnostics);
300
ValidateTypeForAttributeParameters(attributeConstructor.Parameters, ((AttributeSyntax)boundAttribute.Syntax).
Name
, diagnostics, ref hasErrors);
Binder\Binder_Expressions.cs (1)
6231
AttributeSyntax {
Name
: { } name } => name.Location,
Binder\Binder_Symbols.cs (1)
1010
case AttributeSyntax parent when parent.
Name
== node: // [nint]
Compilation\CSharpSemanticModel.cs (3)
416
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;
3988
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)
883
result |= QuickAttributeHelpers.GetQuickAttributes(attribute.
Name
.GetUnqualifiedName().Identifier.ValueText, inAttribute: true);
Errors\MessageProvider.cs (2)
292
diagnostics.Add(ErrorCode.ERR_AttributeParameterRequired1, node.
Name
.Location, parameterName);
298
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)
767
diagnostics.Add(ErrorCode.ERR_DefaultValueUsedWithAttributes, arguments.AttributeSyntaxOpt.
Name
.Location);
773
diagnostics.Add(ErrorCode.ERR_ExplicitParamArrayOrCollection, arguments.AttributeSyntaxOpt.
Name
.Location);
966
diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueUsedWithAttributes, node.
Name
.Location);
1004
diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueTypeMustMatch, node.
Name
.Location);
1014
diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueBadValueType, node.
Name
.Location, arg.TypeInternal);
1024
diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueTypeMustMatch, node.
Name
.Location);
1025
diagnosticsOpt.Add(node.
Name
, useSiteInfo);
1032
diagnosticsOpt.Add(node.
Name
, useSiteInfo);
1072
diagnostics.Add(ErrorCode.WRN_CallerLineNumberParamForUnconsumedLocation, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1078
diagnostics.Add(ErrorCode.ERR_NoConversionForCallerLineNumberParam, node.
Name
.Location, intType, TypeWithAnnotations.Type);
1085
diagnostics.Add(ErrorCode.ERR_BadCallerLineNumberParamWithoutDefaultValue, node.
Name
.Location);
1088
diagnostics.Add(node.
Name
, useSiteInfo);
1100
diagnostics.Add(ErrorCode.WRN_CallerFilePathParamForUnconsumedLocation, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1106
diagnostics.Add(ErrorCode.ERR_NoConversionForCallerFilePathParam, node.
Name
.Location, stringType, TypeWithAnnotations.Type);
1113
diagnostics.Add(ErrorCode.ERR_BadCallerFilePathParamWithoutDefaultValue, node.
Name
.Location);
1118
diagnostics.Add(ErrorCode.WRN_CallerLineNumberPreferredOverCallerFilePath, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1121
diagnostics.Add(node.
Name
, useSiteInfo);
1133
diagnostics.Add(ErrorCode.WRN_CallerMemberNameParamForUnconsumedLocation, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1139
diagnostics.Add(ErrorCode.ERR_NoConversionForCallerMemberNameParam, node.
Name
.Location, stringType, TypeWithAnnotations.Type);
1146
diagnostics.Add(ErrorCode.ERR_BadCallerMemberNameParamWithoutDefaultValue, node.
Name
.Location);
1151
diagnostics.Add(ErrorCode.WRN_CallerLineNumberPreferredOverCallerMemberName, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1156
diagnostics.Add(ErrorCode.WRN_CallerFilePathPreferredOverCallerMemberName, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1159
diagnostics.Add(node.
Name
, useSiteInfo);
1174
diagnostics.Add(ErrorCode.WRN_CallerArgumentExpressionParamForUnconsumedLocation, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1180
diagnostics.Add(ErrorCode.ERR_NoConversionForCallerArgumentExpressionParam, node.
Name
.Location, stringType, TypeWithAnnotations.Type);
1187
diagnostics.Add(ErrorCode.ERR_BadCallerArgumentExpressionParamWithoutDefaultValue, node.
Name
.Location);
1192
diagnostics.Add(ErrorCode.WRN_CallerLineNumberPreferredOverCallerArgumentExpression, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1197
diagnostics.Add(ErrorCode.WRN_CallerFilePathPreferredOverCallerArgumentExpression, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1202
diagnostics.Add(ErrorCode.WRN_CallerMemberNamePreferredOverCallerArgumentExpression, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1208
diagnostics.Add(ErrorCode.WRN_CallerArgumentExpressionAttributeHasInvalidParameterName, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1213
diagnostics.Add(ErrorCode.WRN_CallerArgumentExpressionAttributeSelfReferential, node.
Name
.Location, ParameterSyntax.Identifier.ValueText);
1216
diagnostics.Add(node.
Name
, useSiteInfo);
1223
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)
710
diagnostics.Add(ErrorCode.ERR_AttributeNotOnEventAccessor, arguments.AttributeSyntaxOpt.
Name
.Location, description.FullName, attributeUsage.GetValidTargetsErrorArgument());
732
diagnostics.Add(ErrorCode.ERR_AttributeNotOnAccessor, node.
Name
.Location, node.GetErrorDisplayName(), attributeUsage.GetValidTargetsErrorArgument());
840
diagnostics.Add(ErrorCode.ERR_DllImportOnInvalidMethod, arguments.AttributeSyntaxOpt.
Name
.Location);
856
diagnostics.Add(ErrorCode.ERR_DllImportOnGenericMethod, arguments.AttributeSyntaxOpt.
Name
.Location);
1024
var attributeNameSyntax = arguments.AttributeSyntaxOpt.
Name
; // used for reporting diagnostics
1393
bool reportedError = CheckAndReportValidUnmanagedCallersOnlyTarget(arguments.AttributeSyntaxOpt.
Name
, diagnostics);
Symbols\Source\SourceNamedTypeSymbol.cs (8)
1160
diagnostics.Add(ErrorCode.ERR_CantUseRequiredAttribute, arguments.AttributeSyntaxOpt.
Name
.Location);
1191
diagnostics.Add(ErrorCode.ERR_CollectionBuilderAttributeInvalidType, arguments.AttributeSyntaxOpt.
Name
.Location);
1201
diagnostics.Add(ErrorCode.ERR_CollectionBuilderAttributeInvalidMethodName, arguments.AttributeSyntaxOpt.
Name
.Location);
1219
diagnostics.Add(ErrorCode.ERR_AttributeOnBadSymbolType, arguments.AttributeSyntaxOpt.
Name
.Location, arguments.AttributeSyntaxOpt.GetErrorDisplayName(), "struct");
1223
diagnostics.Add(ErrorCode.ERR_InlineArrayAttributeOnRecord, arguments.AttributeSyntaxOpt.
Name
.Location);
1313
diagnosticsOpt.Add(ErrorCode.ERR_AttributeUsageOnNonAttributeClass, node.
Name
.Location, node.GetErrorDisplayName());
1608
diagnostics.Add(ErrorCode.ERR_ComImportWithoutUuidAttribute, allAttributeSyntaxNodes[index].
Name
.Location);
1665
diagnostics.Add(ErrorCode.ERR_DefaultMemberOnIndexedType, allAttributeSyntaxNodes[index].
Name
.Location);
Symbols\Source\SourcePropertySymbolBase.cs (1)
1730
diagnostics.Add(ErrorCode.ERR_BadIndexerNameAttr, node.
Name
.Location, node.GetErrorDisplayName());
Symbols\Symbol_Attributes.cs (4)
550
var boundType = binder.BindType(attributeSyntax.
Name
, BindingDiagnosticBag.Discarded);
902
diagnostics.Add(ErrorCode.ERR_DuplicateAttribute, node.
Name
.Location, node.GetErrorDisplayName());
922
diagnostics.Add(ErrorCode.ERR_AttributeOnBadSymbolType, node.
Name
.Location, node.GetErrorDisplayName(), attributeUsageInfo.GetValidTargetsErrorArgument());
937
diagnostics.Add(ErrorCode.ERR_SecurityAttributeInvalidTarget, node.
Name
.Location, node.GetErrorDisplayName());
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
256
((BindingDiagnosticBag)arguments.Diagnostics).Add(ErrorCode.ERR_DoNotUseFixedBufferAttrOnProperty, arguments.AttributeSyntaxOpt.
Name
.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 (2)
9920
if (name != this.
Name
|| argumentList != this.ArgumentList)
9931
public AttributeSyntax WithArgumentList(AttributeArgumentListSyntax? argumentList) => Update(this.
Name
, argumentList);
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\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
58
var attributeName = attribute.
Name
.GetRightmostName()?.Identifier.ValueText;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1539
name = attribute.
Name
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
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)
107
Name
: var attributeName
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
58
var attributeName = attribute.
Name
.GetRightmostName()?.Identifier.ValueText;
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.Semantic.UnitTests (5)
Semantics\LambdaTests.cs (2)
3976
var a = (IdentifierNameSyntax)tree.GetRoot().DescendantNodes().OfType<AttributeSyntax>().Single().
Name
;
3989
a = (IdentifierNameSyntax)newTree.GetRoot().DescendantNodes().OfType<AttributeSyntax>().Single().
Name
;
Semantics\LocalFunctionTests.cs (3)
501
Assert.Equal("A", ((SimpleNameSyntax)attribute.
Name
).Identifier.ValueText);
549
Assert.Equal("A", ((SimpleNameSyntax)attribute.
Name
).Identifier.ValueText);
813
Assert.Equal("A", ((SimpleNameSyntax)attribute.
Name
).Identifier.ValueText);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (5)
Compilation\SemanticModelAPITests.cs (1)
3623
var info = speculativeModel.GetSymbolInfo(attributeSyntax.
Name
);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (4)
4294
var aliasSymbol = speculativeModel.GetAliasInfo(attr3.
Name
as IdentifierNameSyntax);
4340
aliasSymbol = speculativeModel.GetAliasInfo(attr6.
Name
as IdentifierNameSyntax);
4363
aliasSymbol = speculativeModel.GetAliasInfo(attr7.
Name
as IdentifierNameSyntax);
4385
aliasSymbol = speculativeModel.GetAliasInfo(attr8.
Name
as IdentifierNameSyntax);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (27)
Generated\Syntax.Test.xml.Generated.cs (2)
13054
Assert.NotNull(node.
Name
);
13056
var newNode = node.WithName(node.
Name
).WithArgumentList(node.ArgumentList);
Parsing\DeclarationParsingTests.cs (25)
274
Assert.NotNull(ad.Attributes[0].
Name
);
275
Assert.Equal("a", ad.Attributes[0].
Name
.ToString());
303
Assert.NotNull(ad.Attributes[0].
Name
);
304
Assert.Equal("a", ad.Attributes[0].
Name
.ToString());
332
Assert.NotNull(ad.Attributes[0].
Name
);
333
Assert.Equal("a", ad.Attributes[0].
Name
.ToString());
359
Assert.NotNull(ad.Attributes[0].
Name
);
360
Assert.Equal("a", ad.Attributes[0].
Name
.ToString());
387
Assert.NotNull(ad.Attributes[0].
Name
);
388
Assert.Equal("a", ad.Attributes[0].
Name
.ToString());
414
Assert.NotNull(ad.Attributes[0].
Name
);
415
Assert.Equal("a", ad.Attributes[0].
Name
.ToString());
443
Assert.NotNull(ad.Attributes[0].
Name
);
444
Assert.Equal("a", ad.Attributes[0].
Name
.ToString());
474
Assert.NotNull(ad.Attributes[0].
Name
);
475
Assert.Equal("a", ad.Attributes[0].
Name
.ToString());
511
Assert.NotNull(ad.Attributes[0].
Name
);
512
Assert.Equal("a", ad.Attributes[0].
Name
.ToString());
515
Assert.NotNull(ad.Attributes[1].
Name
);
516
Assert.Equal("b", ad.Attributes[1].
Name
.ToString());
541
Assert.NotNull(ad.Attributes[0].
Name
);
542
Assert.Equal("a", ad.Attributes[0].
Name
.ToString());
553
Assert.NotNull(ad.Attributes[0].
Name
);
554
Assert.Equal("b", ad.Attributes[0].
Name
.ToString());
1670
Assert.Equal("B", gn.Parameters[0].AttributeLists[0].Attributes[0].
Name
.ToString());
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
CodeGeneration\CSharpSyntaxGenerator.cs (4)
2072
AttributeListSyntax attributeList when attributeList.Attributes.Count == 1 => attributeList.Attributes[0].
Name
.ToString(),
2073
AttributeSyntax attribute => attribute.
Name
.ToString(),
2105
ReplaceWithTrivia(declaration, attributeList.Attributes[0].
Name
, this.DottedName(name)),
2107
AttributeSyntax attribute => ReplaceWithTrivia(declaration, attribute.
Name
, this.DottedName(name)),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1539
name = attribute.
Name
;
Microsoft.Extensions.Logging.Generators (1)
src\libraries\Common\src\Roslyn\CSharpSyntaxHelper.cs (1)
33
=> ((AttributeSyntax)node).
Name
;
Microsoft.Gen.ComplianceReports (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
93
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Gen.ContextualOptions (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
93
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Gen.Logging (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
93
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Gen.MetadataExtractor (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
93
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Gen.Metrics (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
93
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Gen.MetricsReports (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
93
if (attr.
Name
is IdentifierNameSyntax id)
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
427
dllImportSyntax.
Name
,
Microsoft.VisualStudio.LanguageServices.CSharp (8)
CodeModel\CSharpCodeModelService.CodeModelEventCollector.cs (2)
83
if (!CompareNames(oldAttribute.
Name
, newAttribute.
Name
))
CodeModel\CSharpCodeModelService.cs (4)
843
return ((AttributeSyntax)node).
Name
.ToString();
1587
if (attribute.
Name
.ToString() == name)
1640
name = ((AttributeSyntax)attributeNode).
Name
.ToString();
1645
if (attribute.
Name
.ToString() == name)
CodeModel\CSharpCodeModelService.NodeLocator.cs (2)
265
startPosition = node.
Name
.SpanStart;
840
endPosition = node.
Name
.Span.End;
QuarantineTools.Tests (2)
QuarantineScriptTests.cs (2)
320
string lastId = attr.
Name
switch
325
_ => attr.
Name
.ToString().Split('.').Last()
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1539
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))