{% macro type_name(message_field) -%}
  {% if message_field.package and message_field.type_kind != "UNKNOWN" %}
    {% if message_field.type_kind == "MESSAGE" %}
      <a href="{{ message_field.package.name }}.html#message-{{ message_field.full_type }}">
    {% else %}
      <a href="{{ message_field.package.name }}.html#enum-{{ message_field.full_type }}">
    {% endif %}
      <span title="{{ message_field.full_type }}">{{ message_field.full_type }}</span>
    </a>
  {% else %}
  <span>{{ message_field.full_type }}</span>
  {% endif %}
{%- endmacro %}
