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.

phs
  • 10,687
  • 4
  • 58
  • 84
Timothy Chung
  • 153
  • 1
  • 1
  • 4

4 Answers4

28

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

Dave Markle
  • 95,573
  • 20
  • 147
  • 170
Mr Fooz
  • 109,094
  • 6
  • 73
  • 101
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.

grepsedawk
  • 5,959
  • 5
  • 24
  • 22
  • 3
    This is the crudest, grungiest tip I've ever heard! But it speaks to blood lost trying any other way. I love it! – rp. Dec 03 '08 at 02:42
  • 1
    I think I got this tip from Martin Fowlers Refactoring book, if you were curious :) – grepsedawk Dec 03 '08 at 02:52
8

On method declaration: Ctrl+K, Ctrl+T

softarn
  • 5,327
  • 3
  • 40
  • 54
1

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

Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275