8 internal static class SyntaxNodeExtensions
10 internal static bool HasUsing(
this SyntaxNode @
this,
string qualifiedName)
17 if (@this.IsKind(SyntaxKind.UsingDirective))
19 var usingNode = @
this as UsingDirectiveSyntax;
21 if (usingNode.Name.ToFullString() == qualifiedName)
27 return @this.ChildNodes().Where(_ => _.HasUsing(qualifiedName)).Any();
30 internal static T FindParent<T>(
this SyntaxNode @
this)
33 var parentNode = @this.Parent;
35 while (parentNode !=
null)
37 if (parentNode is T parentAsTypeNode)
39 return parentAsTypeNode;
42 parentNode = parentNode.Parent;