function makeReferenceLinkageForIdentifier(targetPath) {
  if (targetPath.node.type !== 'Identifier') {
    throw new Error(
      `makeReferenceLinkageForIdentifier - only supports type Identiter, got "${targetPath.node.type}"`
    )
  }
  switch (targetPath.parent.type) {
    case 'CallExpression': {
      if (targetPath.parentKey === 'arguments') {
        // value is being used directly, add to results
        return new ReferenceLinkage({ path: targetPath, label: 'args to fn' })
      }
      if (targetPath.parentKey === 'callee') {
        // value is being used directly, add to results
        return new ReferenceLinkage({ path: targetPath, label: 'called as fn' })
      }
      throw new Error(
        `makeReferenceLinkageForIdentifier/CallExpression - unknown parent key "${targetPath.parentKey}"`
      )
    }
    case 'ReturnStatement': {
      return new ReferenceLinkage({
        path: targetPath,
        label: 'return value of fn',
      })
    }
    default: {
      throw new Error(
        `makeReferenceLinkageForIdentifier - unknown parent type "${targetPath.parent.type}"`
      )
    }
  }
}
@param {import('@babel/traverse').NodePath<import('@babel/types').Node>} targetPath
@returns {ReferenceLinkage}