makeUsageFacts :: TickReference -> Conversion [Raw.Entry]
makeUsageFacts TickReference{..} = do
    -- TODO(robinpalotai): add more data from backend to translate layer about
    --   spans of ref vs call. In Kythe a call needs both a ref (with name
    --   anchor) and ref/call (with anchor spanning also the args).
    targetVname <- tickVName refTargetTick
    mbCallContext <- traverse tickVName refHighLevelContext
    let edgeType = case refKind of
            Ref -> RefE
            Call -> RefE
            TypeDecl -> RefDocE
            Import -> RefImportsE
    makeAnchor (Just refSourceSpan) edgeType targetVname Nothing mbCallContext

-- | Makes all entries for a declaration.
makeUsageFacts :: TickReference -> Conversion [Raw.Entry]
makeUsageFacts TickReference{..} = do
    -- TODO(robinpalotai): add more data from backend to translate layer about
    --   spans of ref vs call. In Kythe a call needs both a ref (with name
    --   anchor) and ref/call (with anchor spanning also the args).
    targetVname <- tickVName refTargetTick
    mbCallContext <- traverse tickVName refHighLevelContext
    let edgeType = case refKind of
            Ref -> RefE
            Call -> RefE
            TypeDecl -> RefDocE
            Import -> RefImportsE
    makeAnchor (Just refSourceSpan) edgeType targetVname Nothing mbCallContext

-- | Makes all entries for a declaration.
makeUsageFacts TickReference{..} = do
    -- TODO(robinpalotai): add more data from backend to translate layer about
    --   spans of ref vs call. In Kythe a call needs both a ref (with name
    --   anchor) and ref/call (with anchor spanning also the args).
    targetVname <- tickVName refTargetTick
    mbCallContext <- traverse tickVName refHighLevelContext
    let edgeType = case refKind of
            Ref -> RefE
            Call -> RefE
            TypeDecl -> RefDocE
            Import -> RefImportsE
    makeAnchor (Just refSourceSpan) edgeType targetVname Nothing mbCallContext

-- | Makes all entries for a declaration.