docs: function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) {
                  var sourceFile = container.getSourceFile();
                  var start = findInComments ? container.getFullStart() : container.getStart();
                  var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, start, container.getEnd());
                  if (possiblePositions.length) {
                      // Build the set of symbols to search for, initially it has only the current symbol
                      var searchSymbols_1 = populateSearchSymbolSet(searchSymbol, searchLocation);
                      ts.forEach(possiblePositions, function (position) {
                          cancellationToken.throwIfCancellationRequested();
                          var referenceLocation = ts.getTouchingPropertyName(sourceFile, position);
                          if (!isValidReferencePosition(referenceLocation, searchText)) {
                              // This wasn't the start of a token.  Check to see if it might be a
                              // match in a comment or string if that's what the caller is asking
                              // for.
                              if ((findInStrings && ts.isInString(sourceFile, position)) ||
                                  (findInComments && ts.isInNonReferenceComment(sourceFile, position))) {
                                  // In the case where we're looking inside comments/strings, we don't have
                                  // an actual definition.  So just use 'undefined' here.  Features like
                                  // 'Rename' won't care (as they ignore the definitions), and features like
                                  // 'FindReferences' will just filter out these results.
                                  result.push({
                                      definition: undefined,
                                      references: [{
                                              fileName: sourceFile.fileName,
                                              textSpan: ts.createTextSpan(position, searchText.length),
                                              isWriteAccess: false,
                                              isDefinition: false
                                          }]
                                  });
                              }
                              return;
                          }
                          if (!(getMeaningFromLocation(referenceLocation) & searchMeaning)) {
                              return;
                          }
                          var referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation);
                          if (referenceSymbol) {
                              var referenceSymbolDeclaration = referenceSymbol.valueDeclaration;
                              var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
                              var relatedSymbol = getRelatedSymbol(searchSymbols_1, referenceSymbol, referenceLocation);
                              if (relatedSymbol) {
                                  var referencedSymbol = getReferencedSymbol(relatedSymbol);
                                  referencedSymbol.references.push(getReferenceEntryFromNode(referenceLocation));
                              }
                              else if (!(referenceSymbol.flags & 67108864 /* Transient */) && searchSymbols_1.indexOf(shorthandValueSymbol) >= 0) {
                                  var referencedSymbol = getReferencedSymbol(shorthandValueSymbol);
                                  referencedSymbol.references.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name));
                              }
                          }
                      });
                  }
                  return;
                  function getReferencedSymbol(symbol) {
                      var symbolId = ts.getSymbolId(symbol);
                      var index = symbolToIndex[symbolId];
                      if (index === undefined) {
                          index = result.length;
                          symbolToIndex[symbolId] = index;
                          result.push({
                              definition: getDefinition(symbol),
                              references: []
                          });
                      }
                      return result[index];
                  }
              }