230 references to UsingDirective
Microsoft.CodeAnalysis.CSharp (8)
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
1090if (node.IsKind(SyntaxKind.UsingDirective) && node.Parent == containingNode)
Compilation\CSharpSemanticModel.cs (2)
94if (!isSpeculative && node.Parent != null && node.Parent.Kind() == SyntaxKind.NameEquals && node.Parent.Parent.Kind() == SyntaxKind.UsingDirective) 5190case SyntaxKind.UsingDirective:
Parser\LanguageParser.cs (1)
960if (this.IsIncrementalAndFactoryContextMatches && this.CurrentNodeKind == SyntaxKind.UsingDirective)
Syntax\SyntaxFacts.cs (1)
250case UsingDirective:
Syntax\SyntaxNormalizer.cs (3)
441else if (currentToken.Parent.IsKind(SyntaxKind.UsingDirective)) 443return nextToken.Parent.IsKind(SyntaxKind.UsingDirective) ? 1 : 2; 702if (token.Parent.Parent?.Kind() is not SyntaxKind.TypeArgumentList and not SyntaxKind.UsingDirective)
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
src\Analyzers\CSharp\Analyzers\MisplacedUsingDirectives\MisplacedUsingDirectivesDiagnosticAnalyzer.cs (1)
103t => t.Kind() is not (SyntaxKind.UsingDirective or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (2)
73if (node.IsParentKind(SyntaxKind.UsingDirective)) 91if (node.IsParentKind(SyntaxKind.NameEquals) && node.Parent.IsParentKind(SyntaxKind.UsingDirective))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1145=> node?.Kind() is SyntaxKind.UsingDirective or SyntaxKind.ExternAliasDirective;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
457if (token.Parent is (kind: SyntaxKind.ExternAliasDirective or SyntaxKind.UsingDirective)) 2210token.Parent.IsParentKind(SyntaxKind.UsingDirective))
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Interactive\CSharpSendToInteractiveSubmissionProvider.cs (1)
115|| node.IsKind(SyntaxKind.UsingDirective);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2)
Diagnostics\DiagnosticAnalyzerTests.cs (2)
246context.RegisterSyntaxNodeAction(AnalyzeNode, SyntaxKind.Attribute, SyntaxKind.ClassDeclaration, SyntaxKind.UsingDirective); 264case SyntaxKind.UsingDirective:
Microsoft.CodeAnalysis.CSharp.Features (14)
CodeLens\CSharpCodeLensDisplayInfoService.cs (1)
159case SyntaxKind.UsingDirective:
Completion\KeywordRecommenders\NamespaceKeywordRecommender.cs (1)
112if (token.Parent is (kind: SyntaxKind.ExternAliasDirective or SyntaxKind.UsingDirective) &&
Completion\KeywordRecommenders\UsingKeywordRecommender.cs (2)
118if (token.Parent is (kind: SyntaxKind.ExternAliasDirective or SyntaxKind.UsingDirective)) 147previousToken.Parent is (kind: SyntaxKind.ExternAliasDirective or SyntaxKind.UsingDirective))
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
1382if (node.Kind() is SyntaxKind.UsingDirective or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration) 1629case SyntaxKind.UsingDirective: 2011case SyntaxKind.UsingDirective:
EditAndContinue\SyntaxComparer.cs (3)
582case SyntaxKind.UsingDirective: 831case SyntaxKind.UsingDirective: 1427case SyntaxKind.UsingDirective:
MetadataAsSource\FormattingRule.cs (1)
38if (previousToken.Kind() == SyntaxKind.SemicolonToken && previousToken.Parent.Kind() == SyntaxKind.UsingDirective)
src\Analyzers\CSharp\Analyzers\MisplacedUsingDirectives\MisplacedUsingDirectivesDiagnosticAnalyzer.cs (1)
103t => t.Kind() is not (SyntaxKind.UsingDirective or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (2)
73if (node.IsParentKind(SyntaxKind.UsingDirective)) 91if (node.IsParentKind(SyntaxKind.NameEquals) && node.Parent.IsParentKind(SyntaxKind.UsingDirective))
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
1031var usingDirective = (UsingDirectiveSyntax)tree.FindNodeOrTokenByKind(SyntaxKind.UsingDirective).AsNode();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (181)
Parsing\AnonymousFunctionParsingTests.cs (35)
39N(SyntaxKind.UsingDirective); 138N(SyntaxKind.UsingDirective); 235N(SyntaxKind.UsingDirective); 334N(SyntaxKind.UsingDirective); 433N(SyntaxKind.UsingDirective); 537N(SyntaxKind.UsingDirective); 643N(SyntaxKind.UsingDirective); 652N(SyntaxKind.UsingDirective); 783N(SyntaxKind.UsingDirective); 2505N(SyntaxKind.UsingDirective); 2514N(SyntaxKind.UsingDirective); 2651N(SyntaxKind.UsingDirective); 2660N(SyntaxKind.UsingDirective); 2797N(SyntaxKind.UsingDirective); 2806N(SyntaxKind.UsingDirective); 2946N(SyntaxKind.UsingDirective); 3057N(SyntaxKind.UsingDirective); 3066N(SyntaxKind.UsingDirective); 3202N(SyntaxKind.UsingDirective); 3317N(SyntaxKind.UsingDirective); 3326N(SyntaxKind.UsingDirective); 3468N(SyntaxKind.UsingDirective); 3477N(SyntaxKind.UsingDirective); 3619N(SyntaxKind.UsingDirective); 3628N(SyntaxKind.UsingDirective); 3774N(SyntaxKind.UsingDirective); 3894N(SyntaxKind.UsingDirective); 3903N(SyntaxKind.UsingDirective); 4048N(SyntaxKind.UsingDirective); 4172N(SyntaxKind.UsingDirective); 4181N(SyntaxKind.UsingDirective); 4332N(SyntaxKind.UsingDirective); 4341N(SyntaxKind.UsingDirective); 4492N(SyntaxKind.UsingDirective); 4501N(SyntaxKind.UsingDirective);
Parsing\CollectionExpressionParsingTests.cs (6)
7961N(SyntaxKind.UsingDirective); 8106N(SyntaxKind.UsingDirective); 8259N(SyntaxKind.UsingDirective); 8415N(SyntaxKind.UsingDirective); 8559N(SyntaxKind.UsingDirective); 8714N(SyntaxKind.UsingDirective);
Parsing\FunctionPointerTests.cs (1)
4133N(SyntaxKind.UsingDirective);
Parsing\ScriptParsingTests.cs (4)
1322N(SyntaxKind.UsingDirective); 1331N(SyntaxKind.UsingDirective); 1348N(SyntaxKind.UsingDirective); 10011N(SyntaxKind.UsingDirective);
Parsing\SingleLineDeclarationParsingTests.cs (2)
503N(SyntaxKind.UsingDirective); 543N(SyntaxKind.UsingDirective);
Parsing\StatementAttributeParsingTests.cs (1)
5623N(SyntaxKind.UsingDirective);
Parsing\TopLevelStatementsParsingTests.cs (20)
342N(SyntaxKind.UsingDirective); 572N(SyntaxKind.UsingDirective); 1628N(SyntaxKind.UsingDirective); 1807N(SyntaxKind.UsingDirective); 2097N(SyntaxKind.UsingDirective); 2121N(SyntaxKind.UsingDirective); 2144N(SyntaxKind.UsingDirective); 2175N(SyntaxKind.UsingDirective); 2206N(SyntaxKind.UsingDirective); 2677N(SyntaxKind.UsingDirective); 2923N(SyntaxKind.UsingDirective); 2965N(SyntaxKind.UsingDirective); 2974N(SyntaxKind.UsingDirective); 3020N(SyntaxKind.UsingDirective); 3292N(SyntaxKind.UsingDirective); 3302N(SyntaxKind.UsingDirective); 3334N(SyntaxKind.UsingDirective); 3343N(SyntaxKind.UsingDirective); 3377N(SyntaxKind.UsingDirective); 3445N(SyntaxKind.UsingDirective);
Parsing\UsingDirectiveParsingTests.cs (86)
35N(SyntaxKind.UsingDirective); 315N(SyntaxKind.UsingDirective); 366N(SyntaxKind.UsingDirective); 555N(SyntaxKind.UsingDirective); 629N(SyntaxKind.UsingDirective); 680N(SyntaxKind.UsingDirective); 744N(SyntaxKind.UsingDirective); 803N(SyntaxKind.UsingDirective); 863N(SyntaxKind.UsingDirective); 896N(SyntaxKind.UsingDirective); 933N(SyntaxKind.UsingDirective); 970N(SyntaxKind.UsingDirective); 1010N(SyntaxKind.UsingDirective); 1054N(SyntaxKind.UsingDirective); 1110N(SyntaxKind.UsingDirective); 1151N(SyntaxKind.UsingDirective); 1207N(SyntaxKind.UsingDirective); 1237N(SyntaxKind.UsingDirective); 1279N(SyntaxKind.UsingDirective); 1309N(SyntaxKind.UsingDirective); 1363N(SyntaxKind.UsingDirective); 1392N(SyntaxKind.UsingDirective); 1446N(SyntaxKind.UsingDirective); 1476N(SyntaxKind.UsingDirective); 1530N(SyntaxKind.UsingDirective); 1560N(SyntaxKind.UsingDirective); 1612N(SyntaxKind.UsingDirective); 1669N(SyntaxKind.UsingDirective); 1775N(SyntaxKind.UsingDirective); 1874N(SyntaxKind.UsingDirective); 1921N(SyntaxKind.UsingDirective); 1965N(SyntaxKind.UsingDirective); 2015N(SyntaxKind.UsingDirective); 2040N(SyntaxKind.UsingDirective); 2090N(SyntaxKind.UsingDirective); 2115N(SyntaxKind.UsingDirective); 2162N(SyntaxKind.UsingDirective); 2236N(SyntaxKind.UsingDirective); 2316N(SyntaxKind.UsingDirective); 2397N(SyntaxKind.UsingDirective); 2473N(SyntaxKind.UsingDirective); 2544N(SyntaxKind.UsingDirective); 2619N(SyntaxKind.UsingDirective); 2651N(SyntaxKind.UsingDirective); 2748N(SyntaxKind.UsingDirective); 2893N(SyntaxKind.UsingDirective); 3023N(SyntaxKind.UsingDirective); 3121N(SyntaxKind.UsingDirective); 3221N(SyntaxKind.UsingDirective); 3242N(SyntaxKind.UsingDirective); 3285N(SyntaxKind.UsingDirective); 3306N(SyntaxKind.UsingDirective); 3349N(SyntaxKind.UsingDirective); 3370N(SyntaxKind.UsingDirective); 3419N(SyntaxKind.UsingDirective); 3448N(SyntaxKind.UsingDirective); 3488N(SyntaxKind.UsingDirective); 3537N(SyntaxKind.UsingDirective); 3590N(SyntaxKind.UsingDirective); 3637N(SyntaxKind.UsingDirective); 3713N(SyntaxKind.UsingDirective); 3722N(SyntaxKind.UsingDirective); 3863N(SyntaxKind.UsingDirective); 3872N(SyntaxKind.UsingDirective); 4025N(SyntaxKind.UsingDirective); 4070N(SyntaxKind.UsingDirective); 4118N(SyntaxKind.UsingDirective); 4165N(SyntaxKind.UsingDirective); 4212N(SyntaxKind.UsingDirective); 4256N(SyntaxKind.UsingDirective); 4309N(SyntaxKind.UsingDirective); 4367N(SyntaxKind.UsingDirective); 4425N(SyntaxKind.UsingDirective); 4480N(SyntaxKind.UsingDirective); 4531N(SyntaxKind.UsingDirective); 4571N(SyntaxKind.UsingDirective); 4611N(SyntaxKind.UsingDirective); 4648N(SyntaxKind.UsingDirective); 4691N(SyntaxKind.UsingDirective); 4772N(SyntaxKind.UsingDirective); 4853N(SyntaxKind.UsingDirective); 4931N(SyntaxKind.UsingDirective); 5010N(SyntaxKind.UsingDirective); 5088N(SyntaxKind.UsingDirective); 5168N(SyntaxKind.UsingDirective); 5248N(SyntaxKind.UsingDirective);
Syntax\SyntaxTreeTests.cs (26)
344N(SyntaxKind.UsingDirective); 379N(SyntaxKind.UsingDirective); 411N(SyntaxKind.UsingDirective); 459N(SyntaxKind.UsingDirective); 485N(SyntaxKind.UsingDirective); 521N(SyntaxKind.UsingDirective); 554N(SyntaxKind.UsingDirective); 603N(SyntaxKind.UsingDirective); 630N(SyntaxKind.UsingDirective); 676N(SyntaxKind.UsingDirective); 716N(SyntaxKind.UsingDirective); 775N(SyntaxKind.UsingDirective); 847N(SyntaxKind.UsingDirective); 918N(SyntaxKind.UsingDirective); 956N(SyntaxKind.UsingDirective); 983N(SyntaxKind.UsingDirective); 1011N(SyntaxKind.UsingDirective); 1020N(SyntaxKind.UsingDirective); 1047N(SyntaxKind.UsingDirective); 1057N(SyntaxKind.UsingDirective); 1125N(SyntaxKind.UsingDirective); 1135N(SyntaxKind.UsingDirective); 1181N(SyntaxKind.UsingDirective); 1199N(SyntaxKind.UsingDirective); 1253N(SyntaxKind.UsingDirective); 1264N(SyntaxKind.UsingDirective);
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1922case SyntaxKind.UsingDirective:
Simplification\Simplifiers\NameSimplifier.cs (1)
653expression.IsParentKind(SyntaxKind.UsingDirective) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1145=> node?.Kind() is SyntaxKind.UsingDirective or SyntaxKind.ExternAliasDirective;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
457if (token.Parent is (kind: SyntaxKind.ExternAliasDirective or SyntaxKind.UsingDirective)) 2210token.Parent.IsParentKind(SyntaxKind.UsingDirective))
Microsoft.ML.InternalCodeAnalyzer (1)
BestFriendAnalyzer.cs (1)
66foreach (var node in model.SyntaxTree.GetRoot().DescendantNodes(n => !n.IsKind(SyntaxKind.UsingDirective)))
Microsoft.VisualStudio.LanguageServices.CSharp (8)
CodeModel\CSharpCodeModelService.cs (5)
248case SyntaxKind.UsingDirective: 532case SyntaxKind.UsingDirective: 850case SyntaxKind.UsingDirective: 957if (node.Kind() == SyntaxKind.UsingDirective) 3513case SyntaxKind.UsingDirective:
CodeModel\CSharpCodeModelService.NodeLocator.cs (2)
70case SyntaxKind.UsingDirective: 121case SyntaxKind.UsingDirective:
LanguageService\CSharpHelpContextService.cs (1)
276else if (token.Parent.Parent.IsKind(SyntaxKind.UsingDirective))
Roslyn.Diagnostics.CSharp.Analyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1145=> node?.Kind() is SyntaxKind.UsingDirective or SyntaxKind.ExternAliasDirective;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
457if (token.Parent is (kind: SyntaxKind.ExternAliasDirective or SyntaxKind.UsingDirective)) 2210token.Parent.IsParentKind(SyntaxKind.UsingDirective))