[英]How do I see the where class OBJECTS are declared and defined using solution explorer in Visual Studios 2015?
I'm using Visual Studios 2015.我正在使用 Visual Studios 2015。
I'd like to see where a class object is declared and defined in my code.我想看看在我的代码中声明和定义 class object 的位置。
Eg Where are statements like myClass object1;
例如,像
myClass object1;
? ?
Also, is there a way to use the find all references tool on a class method and not see other classes' methods of the same name?另外,有没有办法在 class 方法上使用查找所有引用工具,而看不到其他类的同名方法?
Eg We have myclass1::Run()
, myclass2::Run()
and perhaps a variable Run
somewhere.例如,我们有
myclass1::Run()
、 myclass2::Run()
,也许还有一个变量Run
某处。 Can I specify which kind of reference I'm looking for?我可以指定我正在寻找哪种参考吗?
Simple questions, but I haven't been able to find the answers elsewhere.简单的问题,但我无法在其他地方找到答案。
In Visual Studio 2019, the Find All References
command should do exactly what you want.在 Visual Studio 2019 中,“
Find All References
命令应该完全符合您的要求。 It should automatically return only the references for the particular type or member that you selected, not other symbols that happen to have the same name.它应该只自动返回您选择的特定类型或成员的引用,而不是碰巧具有相同名称的其他符号。
To be clear, the way I use the Find All References
command does not involve the Solution Explorer.需要明确的是,我使用
Find All References
命令的方式不涉及解决方案资源管理器。 Rather, I select the name in the code editor, right-click and choose Find All References
(or press a keyboard shortcut, usually F4).而是,我在代码编辑器中命名 select,右键单击并选择
Find All References
(或按键盘快捷键,通常是 F4)。 That approach works in VS 2015, 2017, and 2019, etc. However, the results window changed drastically from VS 2015 to VS 2017 and newer.该方法适用于 VS 2015、2017 和 2019 等。但是,结果 window 从 VS 2015 到 VS 2017 及更新版本发生了巨大变化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.