What does the "Go to definition" function do?


Well-known member
Jan 16, 2017
United Kingdom
Programming Experience
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:

public static void Write(ulong value);

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

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.
Top Bottom