docs: function getTokenAtPositionWorker(sourceFile, position, allowPositionInLeadingTrivia, includeItemAtEndPosition, includeJsDocComment) {
          if (includeJsDocComment === void 0) { includeJsDocComment = false; }
          var current = sourceFile;
          outer: while (true) {
              if (isToken(current)) {
                  // exit early
                  return current;
              }
              if (includeJsDocComment) {
                  var jsDocChildren = ts.filter(current.getChildren(), ts.isJSDocNode);
                  for (var _i = 0, jsDocChildren_1 = jsDocChildren; _i < jsDocChildren_1.length; _i++) {
                      var jsDocChild = jsDocChildren_1[_i];
                      var start = allowPositionInLeadingTrivia ? jsDocChild.getFullStart() : jsDocChild.getStart(sourceFile, includeJsDocComment);
                      if (start <= position) {
                          var end = jsDocChild.getEnd();
                          if (position < end || (position === end && jsDocChild.kind === 1 /* EndOfFileToken */)) {
                              current = jsDocChild;
                              continue outer;
                          }
                          else if (includeItemAtEndPosition && end === position) {
                              var previousToken = findPrecedingToken(position, sourceFile, jsDocChild);
                              if (previousToken && includeItemAtEndPosition(previousToken)) {
                                  return previousToken;
                              }
                          }
                      }
                  }
              }
              // find the child that contains 'position'
              for (var i = 0, n = current.getChildCount(sourceFile); i < n; i++) {
                  var child = current.getChildAt(i);
                  // all jsDocComment nodes were already visited
                  if (ts.isJSDocNode(child)) {
                      continue;
                  }
                  var start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile, includeJsDocComment);
                  if (start <= position) {
                      var end = child.getEnd();
                      if (position < end || (position === end && child.kind === 1 /* EndOfFileToken */)) {
                          current = child;
                          continue outer;
                      }
                      else if (includeItemAtEndPosition && end === position) {
                          var previousToken = findPrecedingToken(position, sourceFile, child);
                          if (previousToken && includeItemAtEndPosition(previousToken)) {
                              return previousToken;
                          }
                      }
                  }
              }
              return current;
          }
      }