61 references to NamespaceOrType
Microsoft.CodeAnalysis.CSharp (33)
Binder\Binder_Symbols.cs (1)
1013if (usingDirective.Alias != null && usingDirective.NamespaceOrType == node)
Symbols\AliasSymbol.cs (7)
379else if (usingDirective.NamespaceOrType is not NameSyntax) 381MessageID.IDS_FeatureUsingTypeAlias.CheckFeatureAvailability(diagnostics, usingDirective.NamespaceOrType); 384var syntax = usingDirective.NamespaceOrType; 408if (usingDirective.NamespaceOrType is NullableTypeSyntax nullableType && 417(usingDirective.NamespaceOrType.IsNint || usingDirective.NamespaceOrType.IsNuint)) 420MessageID.IDS_FeatureUsingTypeAlias.CheckFeatureAvailability(diagnostics, usingDirective.NamespaceOrType);
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (15)
334diagnostics.Add(ErrorCode.HDN_DuplicateWithGlobalUsing, namespaceOrType.UsingDirective!.NamespaceOrType.Location, namespaceOrType.NamespaceOrType); 685if (!usingDirective.NamespaceOrType.IsMissing) 729if (usingDirective.NamespaceOrType.IsMissing) 765declarationBinder ??= compilation.GetBinderFactory(declarationSyntax.SyntaxTree).GetBinder(usingDirective.NamespaceOrType).WithAdditionalFlags(flags); 766var imported = declarationBinder.BindNamespaceOrTypeSymbol(usingDirective.NamespaceOrType, directiveDiagnostics, basesBeingResolved).NamespaceOrTypeSymbol; 775diagnostics.Add(ErrorCode.ERR_BadUsingType, usingDirective.NamespaceOrType.Location, imported); 782usingDirective.NamespaceOrType.Location, imported); 793diagnostics.Add(ErrorCode.ERR_BadUsingNamespace, usingDirective.NamespaceOrType.Location, imported); 800diagnostics.Add(ErrorCode.ERR_GlobalUsingStaticFileType, usingDirective.NamespaceOrType.Location, imported); 808usingDirective.NamespaceOrType.Location, importedType); 812declarationBinder.ReportDiagnosticsIfObsolete(diagnostics, importedType, usingDirective.NamespaceOrType, hasBaseReceiver: false); 820diagnostics.Add(ErrorCode.ERR_BadUsingStaticType, usingDirective.NamespaceOrType.Location, imported.GetKindText()); 832diagnostics.Add(ErrorCode.ERR_BadSKknown, usingDirective.NamespaceOrType.Location, 833usingDirective.NamespaceOrType, 1020var location = usingDirective.NamespaceOrType.Location;
Syntax.xml.Main.Generated.cs (1)
1963=> 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));
Syntax.xml.Syntax.Generated.cs (7)
9442if (globalKeyword != this.GlobalKeyword || usingKeyword != this.UsingKeyword || staticKeyword != this.StaticKeyword || unsafeKeyword != this.UnsafeKeyword || alias != this.Alias || namespaceOrType != this.NamespaceOrType || semicolonToken != this.SemicolonToken) 9452public UsingDirectiveSyntax WithGlobalKeyword(SyntaxToken globalKeyword) => Update(globalKeyword, this.UsingKeyword, this.StaticKeyword, this.UnsafeKeyword, this.Alias, this.NamespaceOrType, this.SemicolonToken); 9453public UsingDirectiveSyntax WithUsingKeyword(SyntaxToken usingKeyword) => Update(this.GlobalKeyword, usingKeyword, this.StaticKeyword, this.UnsafeKeyword, this.Alias, this.NamespaceOrType, this.SemicolonToken); 9454public UsingDirectiveSyntax WithStaticKeyword(SyntaxToken staticKeyword) => Update(this.GlobalKeyword, this.UsingKeyword, staticKeyword, this.UnsafeKeyword, this.Alias, this.NamespaceOrType, this.SemicolonToken); 9455public UsingDirectiveSyntax WithUnsafeKeyword(SyntaxToken unsafeKeyword) => Update(this.GlobalKeyword, this.UsingKeyword, this.StaticKeyword, unsafeKeyword, this.Alias, this.NamespaceOrType, this.SemicolonToken); 9456public UsingDirectiveSyntax WithAlias(NameEqualsSyntax? alias) => Update(this.GlobalKeyword, this.UsingKeyword, this.StaticKeyword, this.UnsafeKeyword, alias, this.NamespaceOrType, this.SemicolonToken); 9458public UsingDirectiveSyntax WithSemicolonToken(SyntaxToken semicolonToken) => Update(this.GlobalKeyword, this.UsingKeyword, this.StaticKeyword, this.UnsafeKeyword, this.Alias, this.NamespaceOrType, semicolonToken);
Syntax\SyntaxFacts.cs (1)
251return ((UsingDirectiveSyntax)parent).NamespaceOrType == node;
Syntax\UsingDirectiveSyntax.cs (1)
19public NameSyntax? Name => this.NamespaceOrType as NameSyntax;
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
170Contract.ThrowIfNull(@using.NamespaceOrType); 171var symbolInfo = semanticModel.GetSymbolInfo(@using.NamespaceOrType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
201usingDirective.NamespaceOrType == node; 211name = usingDirective.NamespaceOrType;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
189var newType = await Simplifier.ExpandAsync(usingDirective.NamespaceOrType, document, cancellationToken: cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (1)
217if (owningNode is UsingDirectiveSyntax u && u.NamespaceOrType.IsMissing)
Microsoft.CodeAnalysis.CSharp.Features (4)
EditAndContinue\SyntaxComparer.cs (3)
842ComputeDistance(leftUsing.NamespaceOrType, rightUsing.NamespaceOrType); 1428return ((UsingDirectiveSyntax)node).NamespaceOrType;
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
189var newType = await Simplifier.ExpandAsync(usingDirective.NamespaceOrType, document, cancellationToken: cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Symbols\Source\UsingAliasTests.cs (3)
105var usingAliasType = model.GetTypeInfo(usingAlias.NamespaceOrType).Type; 220var usingAliasType = model.GetTypeInfo(usingAlias.NamespaceOrType).Type; 275var usingAliasType = model.GetTypeInfo(usingAlias.NamespaceOrType).Type;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Generated\Syntax.Test.xml.Generated.cs (2)
12983Assert.NotNull(node.NamespaceOrType); 12985var newNode = node.WithGlobalKeyword(node.GlobalKeyword).WithUsingKeyword(node.UsingKeyword).WithStaticKeyword(node.StaticKeyword).WithUnsafeKeyword(node.UnsafeKeyword).WithAlias(node.Alias).WithNamespaceOrType(node.NamespaceOrType).WithSemicolonToken(node.SemicolonToken);
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Classification\SyntaxClassification\UsingDirectiveSyntaxClassifier.cs (1)
46var symbolInfo = semanticModel.GetSymbolInfo(usingDirective.NamespaceOrType, cancellationToken);
CodeGeneration\CSharpSyntaxGenerator.cs (1)
2096UsingDirectiveSyntax usingDeclaration => ReplaceWithTrivia(declaration, usingDeclaration.NamespaceOrType, this.DottedName(name)),
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
631TryGetSimpleTypeName(usingDirectiveNode.NamespaceOrType, typeParameterNames: null, out var name, out _))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
170Contract.ThrowIfNull(@using.NamespaceOrType); 171var symbolInfo = semanticModel.GetSymbolInfo(@using.NamespaceOrType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
201usingDirective.NamespaceOrType == node; 211name = usingDirective.NamespaceOrType;
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\CSharpCodeModelService.cs (2)
1833return usingDirective.NamespaceOrType.ToString(); 1847name = usingDirective.NamespaceOrType.ToString();
Roslyn.Diagnostics.CSharp.Analyzers (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
170Contract.ThrowIfNull(@using.NamespaceOrType); 171var symbolInfo = semanticModel.GetSymbolInfo(@using.NamespaceOrType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
201usingDirective.NamespaceOrType == node; 211name = usingDirective.NamespaceOrType;