I run diff with the -p option so the output will include the name of the function where each change occurred. Is there an analogous option for
diff
-p
There is no such function in GNU grep, although it has been discussed in the past.
However if your code is under git's control, git grep has an option -p that will do that.
git
git grep