code: function findNodes(node, kind, max = Infinity) {
      if (!node || max == 0) {
          return [];
      }
      const arr = [];
      if (node.kind === kind) {
          arr.push(node);
          max--;
      }
      if (max > 0) {
          for (const child of node.getChildren()) {
              findNodes(child, kind, max).forEach(node => {
                  if (max > 0) {
                      arr.push(node);
                  }
                  max--;
              });
              if (max <= 0) {
                  break;
              }
          }
      }
      return arr;
  }
docs: Find all nodes from the AST in the subtree of node of SyntaxKind kind.
  @param node
  @param kind
  @param max The maximum number of items to return.
  @return all nodes of kind, or [] if none is found