Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to limit Find All References in Visual Studio to just the variable concerned

With C++ files, why does the right-click option to 'Find All References' of a variable usage return all spelling usages in the entire project whether related or not. How can this Find operation be limited to just the actual variable concerned?

like image 733
Nicholas Avatar asked Oct 29 '22 21:10

Nicholas


1 Answers

As for MSVC 2015 Update 2 it does actually find all the references to a variable, including comments and strings.

When you get a list of references you can see different icons for each element denoting different types of references: like comments, strings or variables with the same name. Then you have two options when walking though the list: visit all found locations (F4, Shift+F4) or only confirmed references using the black arrow buttons, as shown here:

Find Symbol Results buttons

I would also recommend to rescan solution if searching doesn't work correctly (Solution Explorer > right click > Rescan Solution).

like image 66
finnan Avatar answered Nov 15 '22 03:11

finnan