PR feedback

This commit is contained in:
Sheetal Nandi
2019-01-23 10:45:20 -08:00
parent 66ba166002
commit f118f358e5
2 changed files with 4 additions and 0 deletions

View File

@@ -422,6 +422,9 @@ namespace ts.FindAllReferences.Core {
return mergeReferences(program, moduleReferences, getReferencedSymbolsForSymbol(symbol, /*node*/ undefined, sourceFiles, sourceFilesSet, checker, cancellationToken, options));
}
/**
* Merges the references by sorting them (by file index in sourceFiles and their location in it) that point to same definition symbol
*/
function mergeReferences(program: Program, ...referencesToMerge: (SymbolAndEntries[] | undefined)[]): SymbolAndEntries[] | undefined {
let result: SymbolAndEntries[] | undefined;
for (const references of referencesToMerge) {