function tracePathToUsages(targetPath) {
  if (!targetPath) {
    throw new Error('tracePathToUsages - targetPath is null')
  }
  // TODO: fold makeReferenceLinkagesFromBinding into here, create ReferenceLinkage here
  if (isDetectableNodePath(targetPath)) {
    const detector = /** @type {Detector<typeof targetPath.node>} */ (
      usageDetectors[targetPath.node.type]
    )

    return detector(targetPath)
  }
  throw new Error(
    `tracePathToUsages - Unable to parse usage of reference inside node type "${targetPath.node.type}"`
  )
}
@param {import('@babel/traverse').NodePath} targetPath
@returns {ReferenceLinkage[]}