56 references to NamespaceOrType
Microsoft.CodeAnalysis.CSharp (36)
Binder\Binder_Symbols.cs (1)
1017
if (usingDirective.Alias != null && usingDirective.
NamespaceOrType
== node)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Syntax.xml.Main.Generated.cs (1)
1991
=> node.Update(VisitToken(node.GlobalKeyword), VisitToken(node.UsingKeyword), VisitToken(node.StaticKeyword), VisitToken(node.UnsafeKeyword), (NameEqualsSyntax?)Visit(node.Alias), (TypeSyntax?)Visit(node.
NamespaceOrType
) ?? throw new ArgumentNullException("namespaceOrType"), VisitToken(node.SemicolonToken));
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Syntax.xml.Syntax.Generated.cs (7)
9574
if (globalKeyword != this.GlobalKeyword || usingKeyword != this.UsingKeyword || staticKeyword != this.StaticKeyword || unsafeKeyword != this.UnsafeKeyword || alias != this.Alias || namespaceOrType != this.
NamespaceOrType
|| semicolonToken != this.SemicolonToken)
9584
public UsingDirectiveSyntax WithGlobalKeyword(SyntaxToken globalKeyword) => Update(globalKeyword, this.UsingKeyword, this.StaticKeyword, this.UnsafeKeyword, this.Alias, this.
NamespaceOrType
, this.SemicolonToken);
9585
public UsingDirectiveSyntax WithUsingKeyword(SyntaxToken usingKeyword) => Update(this.GlobalKeyword, usingKeyword, this.StaticKeyword, this.UnsafeKeyword, this.Alias, this.
NamespaceOrType
, this.SemicolonToken);
9586
public UsingDirectiveSyntax WithStaticKeyword(SyntaxToken staticKeyword) => Update(this.GlobalKeyword, this.UsingKeyword, staticKeyword, this.UnsafeKeyword, this.Alias, this.
NamespaceOrType
, this.SemicolonToken);
9587
public UsingDirectiveSyntax WithUnsafeKeyword(SyntaxToken unsafeKeyword) => Update(this.GlobalKeyword, this.UsingKeyword, this.StaticKeyword, unsafeKeyword, this.Alias, this.
NamespaceOrType
, this.SemicolonToken);
9588
public UsingDirectiveSyntax WithAlias(NameEqualsSyntax? alias) => Update(this.GlobalKeyword, this.UsingKeyword, this.StaticKeyword, this.UnsafeKeyword, alias, this.
NamespaceOrType
, this.SemicolonToken);
9590
public UsingDirectiveSyntax WithSemicolonToken(SyntaxToken semicolonToken) => Update(this.GlobalKeyword, this.UsingKeyword, this.StaticKeyword, this.UnsafeKeyword, this.Alias, this.
NamespaceOrType
, semicolonToken);
Symbols\AliasSymbol.cs (7)
379
else if (usingDirective.
NamespaceOrType
is not NameSyntax)
381
MessageID.IDS_FeatureUsingTypeAlias.CheckFeatureAvailability(diagnostics, usingDirective.
NamespaceOrType
);
384
var syntax = usingDirective.
NamespaceOrType
;
412
if (usingDirective.
NamespaceOrType
is NullableTypeSyntax nullableType &&
421
(usingDirective.
NamespaceOrType
.IsNint || usingDirective.
NamespaceOrType
.IsNuint))
424
MessageID.IDS_FeatureUsingTypeAlias.CheckFeatureAvailability(diagnostics, usingDirective.
NamespaceOrType
);
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (18)
339
diagnostics.Add(ErrorCode.HDN_DuplicateWithGlobalUsing, namespaceOrType.UsingDirective!.
NamespaceOrType
.Location, namespaceOrType.NamespaceOrType);
691
if (!usingDirective.
NamespaceOrType
.IsMissing)
735
if (usingDirective.
NamespaceOrType
.IsMissing)
774
declarationBinderSafe ??= compilation.GetBinderFactory(declarationSyntax.SyntaxTree).GetBinder(usingDirective.
NamespaceOrType
).WithAdditionalFlags(BinderFlags.SuppressConstraintChecks);
787
var imported = declarationBinder.BindNamespaceOrTypeSymbol(usingDirective.
NamespaceOrType
, directiveDiagnostics, basesBeingResolved).NamespaceOrTypeSymbol;
796
diagnostics.Add(ErrorCode.ERR_BadUsingType, usingDirective.
NamespaceOrType
.Location, imported);
803
usingDirective.
NamespaceOrType
.Location, imported);
814
diagnostics.Add(ErrorCode.ERR_BadUsingNamespace, usingDirective.
NamespaceOrType
.Location, imported);
821
diagnostics.Add(ErrorCode.ERR_GlobalUsingStaticFileType, usingDirective.
NamespaceOrType
.Location, imported);
829
usingDirective.
NamespaceOrType
.Location, importedType);
833
declarationBinder.ReportDiagnosticsIfObsolete(diagnostics, importedType, usingDirective.
NamespaceOrType
, hasBaseReceiver: false);
842
diagnostics.Add(ErrorCode.ERR_BadUsingStaticType, usingDirective.
NamespaceOrType
.Location, imported.GetKindText());
854
diagnostics.Add(ErrorCode.ERR_BadSKknown, usingDirective.
NamespaceOrType
.Location,
855
usingDirective.
NamespaceOrType
,
1020
compilation.GetBinder(alias.UsingDirective.
NamespaceOrType
).ReportDiagnosticsIfUnsafeMemberAccess(diagnostics.DiagnosticBag, alias.Alias.Target, alias.Alias.GetFirstLocation());
1049
var location = usingDirective.
NamespaceOrType
.Location;
1054
compilation.GetBinder(usingDirective.
NamespaceOrType
).ReportDiagnosticsIfUnsafeMemberAccess(diagnostics, typeSymbol, usingDirective.
NamespaceOrType
);
Syntax\SyntaxFacts.cs (1)
251
return ((UsingDirectiveSyntax)parent).
NamespaceOrType
== node;
Syntax\UsingDirectiveSyntax.cs (1)
19
public NameSyntax? Name => this.
NamespaceOrType
as NameSyntax;
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
170
Contract.ThrowIfNull(@using.
NamespaceOrType
);
171
var symbolInfo = semanticModel.GetSymbolInfo(@using.
NamespaceOrType
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
205
usingDirective.
NamespaceOrType
== node;
215
name = usingDirective.
NamespaceOrType
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
189
var newType = await Simplifier.ExpandAsync(usingDirective.
NamespaceOrType
, document, cancellationToken: cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.Features (4)
EditAndContinue\SyntaxComparer.cs (3)
842
ComputeDistance(leftUsing.
NamespaceOrType
, rightUsing.
NamespaceOrType
);
1428
return ((UsingDirectiveSyntax)node).
NamespaceOrType
;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
189
var newType = await Simplifier.ExpandAsync(usingDirective.
NamespaceOrType
, document, cancellationToken: cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Classification\SyntaxClassification\UsingDirectiveSyntaxClassifier.cs (1)
46
var symbolInfo = semanticModel.GetSymbolInfo(usingDirective.
NamespaceOrType
, cancellationToken);
CodeGeneration\CSharpSyntaxGenerator.cs (1)
2094
UsingDirectiveSyntax usingDeclaration => ReplaceWithTrivia(declaration, usingDeclaration.
NamespaceOrType
, this.DottedName(name)),
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
623
TryGetSimpleTypeName(usingDirectiveNode.
NamespaceOrType
, typeParameterNames: null, out var name, out _))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
170
Contract.ThrowIfNull(@using.
NamespaceOrType
);
171
var symbolInfo = semanticModel.GetSymbolInfo(@using.
NamespaceOrType
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
205
usingDirective.
NamespaceOrType
== node;
215
name = usingDirective.
NamespaceOrType
;
Roslyn.Diagnostics.CSharp.Analyzers (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
170
Contract.ThrowIfNull(@using.
NamespaceOrType
);
171
var symbolInfo = semanticModel.GetSymbolInfo(@using.
NamespaceOrType
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
205
usingDirective.
NamespaceOrType
== node;
215
name = usingDirective.
NamespaceOrType
;