in server/src/blobStore.ts [315:340]
public references(uri: string, position: lsp.Position, context: lsp.ReferenceContext): lsp.Location[] | undefined {
const { range, blob } = this.findRangeFromPosition(this.toDatabase(uri), position);
if (range === undefined || blob === undefined || blob.referenceResults === undefined) {
return undefined;
}
let resultData = this.findResult(blob.resultSets, blob.referenceResults, range, 'referenceResult');
if (resultData === undefined) {
const moniker = this.findMoniker(blob.resultSets, blob.monikers, range);
if (moniker === undefined) {
return undefined;
}
return this.findReferencesInDB(moniker, context);
} else {
let result: lsp.Location[] = [];
if (context.includeDeclaration && resultData.declarations !== undefined) {
result.push(...BlobStore.asLocations(blob.ranges, uri, resultData.declarations));
}
if (context.includeDeclaration && resultData.definitions !== undefined) {
result.push(...BlobStore.asLocations(blob.ranges, uri, resultData.definitions));
}
if (resultData.references !== undefined) {
result.push(...BlobStore.asLocations(blob.ranges, uri, resultData.references));
}
return result;
}
}