1 implementation of Aliases
Microsoft.CodeAnalysis (1)
Compilation\IImportScope.cs (1)
146
public ImmutableArray<IAliasSymbol>
Aliases
{ get; }
84 references to Aliases
Microsoft.CodeAnalysis.CSharp.Features (1)
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.cs (1)
99
foreach (var alias in scope.
Aliases
)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
InteractiveSessionTests.cs (1)
1185
Assert.Empty(scope.
Aliases
);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (48)
Compilation\GetImportScopesTests.cs (48)
57
Assert.Empty(scopes.Single().
Aliases
);
73
Assert.Empty(scopes.Single().
Aliases
);
104
Assert.Empty(scopes.Single().
Aliases
);
132
Assert.Empty(scopes.Single().
Aliases
);
151
Assert.Empty(scopes.Single().
Aliases
);
243
Assert.Single(scopes.Single().
Aliases
);
244
Assert.True(scopes.Single().
Aliases
.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } });
245
Assert.True(scopes.Single().
Aliases
.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax);
259
Assert.Single(scopes.Single().
Aliases
);
260
Assert.True(scopes.Single().
Aliases
.Single() is { Name: "S", Target: { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } });
261
Assert.True(scopes.Single().
Aliases
.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax);
290
Assert.Single(scopes.Single().
Aliases
);
291
Assert.True(scopes.Single().
Aliases
.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } });
292
Assert.True(scopes.Single().
Aliases
.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax);
318
Assert.Single(scopes.Single().
Aliases
);
319
Assert.True(scopes.Single().
Aliases
.Single() is { Name: "S", Target: { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } });
320
Assert.True(scopes.Single().
Aliases
.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax);
335
Assert.Equal(2, scopes.Single().
Aliases
.Length);
336
Assert.True(scopes.Single().
Aliases
.Any(a => a is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }));
337
Assert.True(scopes.Single().
Aliases
.Any(a => a is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } }));
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) } }));
363
Assert.Single(scopes.Single().
Aliases
);
364
Assert.True(scopes.Single().
Aliases
.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } });
365
Assert.True(scopes.Single().
Aliases
.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } });
385
Assert.Single(scopes[0].
Aliases
);
386
Assert.Single(scopes[1].
Aliases
);
387
Assert.True(scopes[0].
Aliases
.Single() is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } });
388
Assert.True(scopes[0].
Aliases
.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } });
389
Assert.True(scopes[1].
Aliases
.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } });
390
Assert.True(scopes[1].
Aliases
.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } });
421
Assert.Empty(scopes.Single().
Aliases
);
440
Assert.Empty(scopes.Single().
Aliases
);
462
Assert.Empty(scopes.Single().
Aliases
);
483
Assert.Empty(scopes.Single().
Aliases
);
519
Assert.Empty(scopes.Single().
Aliases
);
541
Assert.Empty(scopes.Single().
Aliases
);
617
Assert.Single(scopes.Single().
Aliases
);
622
Assert.True(scopes.Single().
Aliases
.Single() is { Name: "M", Target: INamespaceSymbol { Name: nameof(Microsoft) } });
623
Assert.True(scopes.Single().
Aliases
.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Alias.Name.Identifier.Text: "M" });
651
Assert.Single(scopes.Single().
Aliases
);
652
Assert.True(scopes.Single().
Aliases
.Single() is { Name: "M", Target: INamespaceSymbol { Name: nameof(Microsoft) } });
653
Assert.True(scopes.Single().
Aliases
.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Alias.Name.Identifier.Text: "M" });
687
Assert.Equal(2, scopes.Single().
Aliases
.Length);
688
Assert.True(scopes.Single().
Aliases
.Any(i => i is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } }));
689
Assert.True(scopes.Single().
Aliases
.Any(i => i.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } }));
690
Assert.True(scopes.Single().
Aliases
.Any(i => i is { Name: "T", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: false, Name: nameof(System.Threading) } }));
691
Assert.True(scopes.Single().
Aliases
.Any(i => i.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: QualifiedNameSyntax { Right: IdentifierNameSyntax { Identifier.Text: nameof(System.Threading) } } }));
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
227
return scopes.Any(static s => s.
Aliases
.Length > 0);
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (33)
Compilation\GetImportScopesTests.vb (33)
76
Assert.Empty(scopes.Single().
Aliases
)
93
Assert.Empty(scopes.Single().
Aliases
)
129
Assert.Empty(scopes.Single().
Aliases
)
155
Assert.Empty(scopes.Single().
Aliases
)
178
Assert.Empty(scopes.Single().
Aliases
)
203
Assert.Empty(scopes.Single().
Aliases
)
219
Assert.Single(scopes.Single().
Aliases
)
220
Assert.True(IsAliasWithName(scopes.Single.
Aliases
().Single(), "S", NameOf(System), inGlobalNamespace:=True))
221
Assert.True(IsAliasImportsClauseWithName(scopes.Single.
Aliases
().Single(), "S"))
236
Assert.Single(scopes.Single().
Aliases
)
237
Assert.True(IsAliasWithName(scopes.Single.
Aliases
().Single(), "S", NameOf(System), inGlobalNamespace:=True))
238
Assert.True(IsAliasImportsClauseWithName(scopes.Single.
Aliases
().Single(), "S"))
256
Assert.Single(scopes.Single().
Aliases
)
257
Assert.True(IsAliasWithName(scopes.Single.
Aliases
().Single(), "S", NameOf(System), inGlobalNamespace:=True))
258
Assert.True(IsAliasImportsClauseWithName(scopes.Single.
Aliases
().Single(), "S"))
274
Assert.Equal(2, scopes.Single().
Aliases
.Length)
276
Assert.True(scopes.Single().
Aliases
.Any(Function(a) IsAliasWithName(a, "S", NameOf(System), inGlobalNamespace:=True)))
277
Assert.True(scopes.Single().
Aliases
.Any(Function(a) IsAliasImportsClauseWithName(a, "S")))
278
Assert.True(scopes.Single().
Aliases
.Any(Function(a) IsAliasWithName(a, "M", NameOf(Microsoft), inGlobalNamespace:=True)))
279
Assert.True(scopes.Single().
Aliases
.Any(Function(a) IsAliasImportsClauseWithName(a, "M")))
301
Assert.Single(scopes.Single().
Aliases
)
302
Assert.True(IsAliasWithName(scopes.Single.
Aliases
().Single(), "S", NameOf(System), inGlobalNamespace:=True))
303
Assert.True(IsAliasImportsClauseWithName(scopes.Single.
Aliases
().Single(), "S"))
325
Assert.Single(scopes.Single().
Aliases
)
326
Assert.True(IsAliasWithName(scopes.Single.
Aliases
().Single(), "S", NameOf(System), inGlobalNamespace:=True))
327
Assert.True(IsAliasImportsClauseWithName(scopes.Single.
Aliases
().Single(), "S"))
353
Assert.Empty(scopes.Single().
Aliases
)
371
Assert.Empty(scopes.Single().
Aliases
)
393
Assert.Empty(scopes.Single().
Aliases
)
417
Assert.Empty(scopes.Single().
Aliases
)
444
Assert.Empty(scopes.Single().
Aliases
)
468
Assert.Empty(scopes.Single().
Aliases
)
494
Assert.Empty(scopes.Single().
Aliases
)