79 references to Name
Microsoft.CodeAnalysis.CSharp (3)
Declarations\DeclarationTreeBuilder.cs (1)
295
if (directive.
Name
is not NameSyntax name)
Symbols\Source\QuickAttributeChecker.cs (2)
97
usingDirective.
Name
!= null &&
101
string target = usingDirective.
Name
.GetUnqualifiedName().Identifier.ValueText;
Microsoft.CodeAnalysis.CSharp.CodeStyle (12)
UsingsAndExternAliasesDirectiveComparer.cs (8)
119
if (aliasComparisonResult == 0 && using1.
Name
!= null && using2.
Name
!= null)
122
return _nameComparer.Compare(using1.
Name
, using2.
Name
);
128
Contract.ThrowIfNull(using1!.
Name
);
129
Contract.ThrowIfNull(using2!.
Name
);
130
return _nameComparer.Compare(using1!.
Name
, using2!.
Name
);
UsingsAndExternAliasesOrganizer.cs (4)
84
Contract.ThrowIfNull(using1.
Name
);
85
Contract.ThrowIfNull(using2.
Name
);
86
var name1 = using1.
Name
.GetFirstToken().ValueText;
87
var name2 = using2.
Name
.GetFirstToken().ValueText;
Microsoft.CodeAnalysis.CSharp.Features (3)
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.cs (1)
122
usingDirective.
Name
?.GetRightmostName() is IdentifierNameSyntax identifierName)
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
154
var hasUsingSystem = usings.Any(u => u.
Name
is IdentifierNameSyntax { Identifier.ValueText: nameof(System) });
GenerateType\CSharpGenerateTypeService.cs (1)
791
.Select(n => n.
Name
.ToString())
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\InteractiveUsingTests.cs (2)
93
Assert.Equal(typeSymbol, model.GetSymbolInfo(syntax.
Name
).Symbol);
123
Assert.Equal(typeSymbol, model.GetSymbolInfo(syntax.
Name
).Symbol);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (22)
Compilation\GetImportScopesTests.cs (17)
149
Assert.True(scopes.Single().Imports.Any(i => i.DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(System) } }));
150
Assert.True(scopes.Single().Imports.Any(i => i.DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } }));
176
Assert.True(scopes.Single().Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(System) } });
199
Assert.True(scopes[0].Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } });
201
Assert.True(scopes[1].Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(System) } });
227
Assert.True(scopes[0].Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } });
229
Assert.True(scopes[1].Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(System) } });
338
Assert.True(scopes.Single().Aliases.Any(a => a.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(System) } }));
339
Assert.True(scopes.Single().Aliases.Any(a => a.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } }));
365
Assert.True(scopes.Single().Aliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(System) } });
388
Assert.True(scopes[0].Aliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } });
390
Assert.True(scopes[1].Aliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(System) } });
626
Assert.True(scopes.Single().Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(System) } });
683
Assert.True(scopes.Single().Imports.Any(i => i.DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(System) } }));
685
Assert.True(scopes.Single().Imports.Any(i => i.DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax {
Name
: QualifiedNameSyntax { Right: IdentifierNameSyntax { Identifier.Text: nameof(System.IO) } } }));
689
Assert.True(scopes.Single().Aliases.Any(i => i.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax {
Name
: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } }));
691
Assert.True(scopes.Single().Aliases.Any(i => i.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax {
Name
: QualifiedNameSyntax { Right: IdentifierNameSyntax { Identifier.Text: nameof(System.Threading) } } }));
Compilation\SemanticModelAPITests.cs (2)
2801
TestGetSpeculativeSemanticModelForTypeSyntax_Common(model, usingStatement.
Name
.Position,
2816
TestGetSpeculativeSemanticModelForTypeSyntax_Common(model, usingStatement.
Name
.Position,
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
1033
var type = model.GetTypeInfo(usingDirective.
Name
);
2816
var info = model.GetSemanticInfoSummary(u1.
Name
);
Symbols\Source\ExternAliasTests.cs (1)
481
var usingTargetSyntax = (QualifiedNameSyntax)usingSyntax.
Name
;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (18)
Parsing\DeclarationParsingTests.cs (14)
68
Assert.NotNull(ud.
Name
);
69
Assert.Equal("a", ud.
Name
.ToString());
90
Assert.NotNull(ud.
Name
);
91
Assert.Equal("a", ud.
Name
.ToString());
157
Assert.NotNull(ud.
Name
);
158
Assert.Equal("a.b", ud.
Name
.ToString());
179
Assert.NotNull(ud.
Name
);
180
Assert.Equal("a.b", ud.
Name
.ToString());
201
Assert.NotNull(ud.
Name
);
202
Assert.Equal("a<int?>", ud.
Name
.ToString());
225
Assert.NotNull(ud.
Name
);
226
Assert.Equal("b", ud.
Name
.ToString());
249
Assert.NotNull(ud.
Name
);
250
Assert.Equal("b<c>", ud.
Name
.ToString());
Parsing\ParsingErrorRecoveryTests.cs (4)
6270
Assert.True(usings[0].
Name
.IsMissing);
6285
Assert.True(usings[0].
Name
.IsMissing);
6302
Assert.True(usings[0].
Name
.IsMissing);
6326
Assert.True(usings[0].
Name
.IsMissing);
Microsoft.CodeAnalysis.CSharp.Workspaces (14)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1896
UsingDirectiveSyntax usingDirective => usingDirective.
Name
?.ToString() ?? string.Empty,
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
116
var mappedName = GetTypeName(usingDecl.
Name
);
UsingsAndExternAliasesDirectiveComparer.cs (8)
119
if (aliasComparisonResult == 0 && using1.
Name
!= null && using2.
Name
!= null)
122
return _nameComparer.Compare(using1.
Name
, using2.
Name
);
128
Contract.ThrowIfNull(using1!.
Name
);
129
Contract.ThrowIfNull(using2!.
Name
);
130
return _nameComparer.Compare(using1!.
Name
, using2!.
Name
);
UsingsAndExternAliasesOrganizer.cs (4)
84
Contract.ThrowIfNull(using1.
Name
);
85
Contract.ThrowIfNull(using2.
Name
);
86
var name1 = using1.
Name
.GetFirstToken().ValueText;
87
var name2 = using2.
Name
.GetFirstToken().ValueText;
Microsoft.VisualStudio.LanguageServices.CSharp (5)
CodeModel\CSharpCodeModelService.cs (2)
248
((UsingDirectiveSyntax)node).
Name
!= null)
1556
if (usingDirective.
Name
?.ToString() == dottedName)
CodeModel\CSharpCodeModelService.NodeLocator.cs (2)
669
startPosition = node.
Name
.SpanStart;
1208
endPosition = node.
Name
.Span.End;
Snippets\SnippetExpansionClient.cs (1)
116
if (TryAddImportsToContainedDocument(document, newUsingDirectives.Where(u => u.Alias == null).Select(u => u.
Name
!.ToString())))