CodeQL library for Swift
codeql/swift-all 3.0.1-dev (changelog, source)
Search

Member predicate Impl::AstNode::getEnclosingDecl

Gets the nearest declaration that contains this AST node, if any.

Note that the nearest declaration may be an extension of a type declaration. If you always want the type declaration and not the extension, use getEnclosingDecl().asNominalTypeDecl().

Decl getEnclosingDecl()