Menu

What's the difference between Find Reference/Definition

Pan San
2018-03-20
2018-03-21
  • Pan San

    Pan San - 2018-03-20

    Greetings,

    Is there any difference between Find Reference and Definition?

    When I use these to command, Gtag always shows all the symbols which I want. (The plugin did a great job.)

    I'm wondering, is there any differences between Find Reference and Definition?

     
  • Pavel Nedev

    Pavel Nedev - 2018-03-21

    Hi Pan,

    Yes, there is a big difference.
    Find Definition takes you to where function/class/global variable is defined.
    Find Reference shows you all the places where the function/global variable is used.
    But you know that already, that's why you are confused :)

    You are wondering because on occasions the GTags parser cannot determine if something is definition or reference and it just marks that as a symbol (unknown existing tag). And when you do search for it later (as reference or definition) it is not found under those categories and instead is looked-up as a symbol (which leads to Find Definition and Find Reference showing the same results). Those two commands translate to Find Symbol in the mentioned case.

    BR

     

Log in to post a comment.

MongoDB Logo MongoDB