.. _Hyperlinks:

Hyperlinks
==========


Place the mouse cursor over an identifier in the editor while holding down the :kbd:`Ctrl` key. The identifier becomes a **hyperlink**, and a list of navigation options is displayed.

The first option is **Open Declaration**. This is the default action when you click directly on the identifier.

**Hyperlinks** are available for all the types, methods, fields, macros, etc. from the source code files that DVT analyzes in your project.

.. list-table::

  * - Open Declaration
    - Tip: Keyboard alternative: place editor cursor on an identifier and press :kbd:`F3`. 
      
      .. figure:: ../../images/common/edt-open-declaration.png  
      
      .. figure:: ../../images/common/edt-open-declaration-target.png
  * - Open First Implementation
    - Opens the first is layer of a method declared using is undefined / is empty. Similarly for events, opens the first layer if definition does not include implementation. 
      
      .. figure:: ../../images/common/edt-open-first-implementation.png  
      
      .. figure:: ../../images/common/edt-open-first-implementation-target.png
  * - Open ... Type
    - .. figure:: ../../images/common/edt-open-field-type.png  
      
      .. figure:: ../../images/common/edt-open-field-type-target.png
  * - Open When Subtype
    - Opens the first explicit implementation of the layer under cursor: 
      
      .. figure:: ../../images/common/edt-open-when-subtype.png   
      
      .. figure:: ../../images/common/edt-open-when-subtype-target.png
  * - Open Determinant
    - .. figure:: ../../images/common/edt-open-determinant.png  
    
      Opens the determinant field declaration:
     
      .. figure:: ../../images/common/edt-open-determinant-target.png
  * - Jump to Binding
    - Opens bound method port:  
      
      .. figure:: ../../images/common/edt-hyperlink-to-binding.png  
      
      .. figure:: ../../images/common/edt-hyperlink-to-binding-target.png
  * - Jump to an Imported File
    - .. figure:: ../../images/common/edt-hyperlink-to-imported-file.png
      
      .. figure:: ../../images/common/edt-hyperlink-to-imported-file-target.png
  * - Jump to a Macro Definition
    - .. figure:: ../../images/edt-tips-hyperlink-to-macro.png  
      
      .. figure:: ../../images/common/edt-tips-hyperlink-to-macro-target.png


Hyperlinks in Comments
~~~~~~~~~~~~~~~~~~~~~~

You can define hyperlinks in comments using the **@link** or **@see** pragmas, for example:

.. code-block::

 -- @link usb_init.usb_init_arch.TIME_SUSPEND
 
 -- For more details @see @see usb_commands::sv_usb_byte and @see usb_fs_monitor.usb_Dn

Hover the hierarchical id specified after the pragma with the mouse cursor while holding down the :kbd:`Ctrl` key, and click to go to the element's declaration.

Alternatively, place the editor cursor on the hierarchical id and press :kbd:`F3`

.. figure:: ../../images/common/edt-hyperlink-in-comment.png
	:align: center


The hierarchical identifier following **@link** or **@see** is of the form:

 [<package_name>::<type_name>.<inner_type_name>.]<element_name>

where **<element_name>** must be a type (entity, architecture, etc.) or a type member (method, signal, port etc.).

.. rubric:: Examples

- @link <element_name>  


.. figure:: ../../images/common/edt-hyperlink-in-comment-identifier.png
  :align: center

- @link <type_name>.<element_name>  

.. figure:: ../../images/common/edt-hyperlink-in-comment-type-identifier.png
  :align: center

- @link <package_name>::<element_name> : 


.. figure:: ../../images/common/edt-hyperlink-in-comment-absolute-path.png
  :align: center

.. note::

	If **<path.to.element>** does not solve to a unique element in code, a list of navigation options is displayed. 

.. figure:: ../../images/common/edt-hyperlink-in-comment-ambiguity.png
	:align: center




