CodeQL library for C#
codeql/csharp-all 3.0.1-dev (changelog, source)
Search

Member predicate UsingDirective::getParentNamespaceDeclaration

Gets the namespace in which this using directive appears, if any.

Example:

using System;

namespace N {
  using System.Web;
  using static System.Console;
}

The first using directive on line 1 does not appear in a namespace, the second and third using directives on lines 4 and 5 appear in the namespace N.

NamespaceDeclaration getParentNamespaceDeclaration()