Visual Studio - show all calls to a function in source code level
Asked Answered
M

4

15

I am wondering if there is any way to list all the calls to a function in source code, so that I could see the dependencies if I modify that function.

One method I use is to search the function name in the "Entire Solution" but I am looking for a better way.

Microwatt answered 3/12, 2008 at 2:7 Comment(0)
R
28

Right-click on the call and select "Find All References".

Refractory answered 3/12, 2008 at 2:8 Comment(0)
B
12

A brute force method is to change the name of the function and recompile and look at the errors. Sometimes I have trouble with the Find References functionality in VS.

Bort answered 3/12, 2008 at 2:11 Comment(2)
This is the crudest, grungiest tip I've ever heard! But it speaks to blood lost trying any other way. I love it!Anile
I think I got this tip from Martin Fowlers Refactoring book, if you were curious :)Bort
J
8

On method declaration: Ctrl+K, Ctrl+T

Janson answered 22/2, 2012 at 10:34 Comment(0)
P
1

Use NDepend. It comes with a VS add-in that allows you to do CQL queries on the fly. See this screenshot.

Pontic answered 3/12, 2008 at 2:19 Comment(2)
Of course this only works for .NET code and not unmanaged C++ codeBort
www.cppdepend.com - yup, virtually identical tool for C++Scandent

© 2022 - 2024 — McMap. All rights reserved.