CodeQL library for C#
codeql/csharp-all 0.4.4 (changelog, source)

Member predicate UsingDirective::getParentNamespaceDeclaration

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


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()