code: private static Node getEnclosingDeclNameNode(Node n) {
      Node fn = NodeUtil.getEnclosingFunction(n);
      return fn == null ? null : NodeUtil.getNameNode(fn);
    }
docs: Returns the qualified name node of the function whose scope we're in,
  or null if it cannot be found.