Control 单击以在 IDE 中获取定义不起作用

发布于 2024-07-26 09:11:15 字数 134 浏览 3 评论 0原文

我正在使用 C++Builder,我知道要转到变量或类的定义,您必须按下 Control 并单击方法名称,或者要转到定义的任何标识符。

然而,正如你们大多数人会注意到的那样,这并不总是有效。

有人有这样做的技巧吗?

I am using C++Builder, I know that to go to a definition of a variable or class you must press control and click on the method name, or any identifier where you want to go to a definition.

However, as most of you would notice this does not work all the time.

Does anyone have any trick on doing this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

温暖的光 2024-08-02 09:11:15

从源文件调用时“转到声明”通常会成功,但从标头调用时会失败。 如果您知道它是如何工作的,就很容易理解为什么:当您对标识符执行 Ctrl+Click 时,编译器就会启动,以特殊的“Kibitz”模式运行,并且基本上将源代码编译到插入符号的位置。 对于 .cpp 文件,这很简单 - 这些文件通常可以独立编译。 然而,头文件通常依赖于其他头文件,但不明确包含它们 - 即,对“sysmac.h”进行独立编译将失败并出现错误,因为该头文件期望预先包含“System.hpp”。 这就是在头文件中调用代码完成和代码浏览时经常失败的原因之一。

"Go to declaration" usually succeeds when invoked from a source file, but fails when invoked from a header. It's easy to understand why if you know how it works: When you perform Ctrl+Click on an identifier, the compiler kicks in, running in a special "Kibitz" mode, and basically compiles your source code up to the position of the caret. For a .cpp file, this is easy - those can usually be compiled standalone. A header file, however, often depends on other headers but doesn't include them explicitly - i.e. doing a standalone compilation on "sysmac.h" will fail with an error because that header expects "System.hpp" to be included beforehand. This is one of the reasons why Code Completion and Code Browsing often fail when invoked in header files.

入画浅相思 2024-08-02 09:11:15

我实际上使用了 Visual Studio 模拟器作为按键,因此我现在可以右键单击弹出菜单并转到定义。

枚举 Visual Studio 键盘设置的另一个好处是多行选项卡和 alt-Tab 现在可以使用。 遗憾的是不再有编译快捷方式(RAD Studio 2007 默认键盘设置为 F6)。

I actually used the Visual Studio Emulator for keys and because of that I can now right click a popup menu and go to definition.

Another benefit of enumlating the Visual Studio keyboard setup is the multiple line tab and alt-Tab now works. Sadly no more shortcut to compile (F6 for RAD Studio 2007 default keyboard setup).

甜宝宝 2024-08-02 09:11:15

如果您运行 Codegear 2009 中“工具”菜单下的“预编译头向导..”,可能会提高“转到定义”功能的性能。

If you run the Precompiled-Header Wizard.. under the Tools menu in Codegear 2009, it may improve the performance of the Go to Definition function.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文