What does the "Go to definition" function do?

VitzzViperzz

Well-known member
Joined
Jan 16, 2017
Messages
75
Location
United Kingdom
Programming Experience
1-3
I was at a C# seminar last night and I saw that the guy presenting used the "Go to definition" a lot. I forgot to ask him what it actually did, but when I tried it myself I saw that it brings lots of code like this:

C#:
public static void Write(ulong value);

Some say that these are definitions - but what are there the definitions of? Just curious to know.

Thanks
 
You can use that on an identifier anywhere in code and it will take you to where that identifier is declared. The identifier might be for a variable, a property, a method, a type or whatever. If you use that option on a member of an interface then 'Go to definition' will take you to the declaration in the interface while the 'Go to implementation' option will take you to the implementation of that member in a class. If it's implemented in multiple classes then you will be given the choice of which to navigate to.
 
Back
Top Bottom