Delphi 2010 中的代码导航在 $IFDEF 块内部中断
我的应用程序中有一些条件编译的类。
{$IFDEF SOME_OPTION}
type
TMyClass = class
procedure Foo;
end;
{$ENDIF}
...
{$IFDEF SOME_OPTION}
procedure TMyClass.Foo;
begin
end;
{$ENDIF}
该选项 SOME_OPTION 是在该项目的“项目选项”-“Delphi 编译器”-“条件定义”和“项目选项”-“资源编译器”-“目录和条件”-“定义预处理器符号”中定义的。
当我尝试按住 Ctrl 键并单击他们的方法时,没有任何反应,代码导航不起作用。
我使用Delphi 2010。我该如何解决这个问题?
I have a few conditionally compiled classes in my app.
{$IFDEF SOME_OPTION}
type
TMyClass = class
procedure Foo;
end;
{$ENDIF}
...
{$IFDEF SOME_OPTION}
procedure TMyClass.Foo;
begin
end;
{$ENDIF}
That option SOME_OPTION is defined in "Project Options" - "Delphi Compiler" - "Conditional Defines" and in "Project Options" - "Resource Compiler" - "Directories and Conditionals" - "Defines a preprocessor symbol" for this project.
When I try to Ctrl+Click on their methods, nothing happens, code navigation don't want to work.
I use Delphi 2010. How can I solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是一个错误,修复的可能性为零。
/ 沃伦·P
It is a bug, and the chances of it being fixed are zero.
/ Warren P
我认为正确的位置不是在“项目选项”-“资源编译器”中...
但是在“项目选项”-“Delphi编译器”-“条件定义”中。
更新:
我在 Delphi XE 中尝试过,无论它是否定义,或者在哪里,对于 Ctrl+Click 在所有情况下为我工作似乎并不重要。
请注意,我有 已安装 Andreas Hausladen 的 IDE Fix Pack 4.6.6 和 DDEv Extension 2.5。
你用它们吗?
更新2:
当在同一单元中时,即使 SOME_OPTION 未定义,它似乎也能工作,但当从另一个单元调用 Foo 时则不起作用。
但似乎有效的是,当它在项目选项中正确定义时并且您重建应用程序(您会在调用 Foo 的行上看到蓝点)。然后IDE可以使用编译器来定位另一个单元中的函数源。
目前我能想到的就这么多。正如已经说过的,它不是 IDE 最好的部分......
I don't think the proper place is in "Project Options" - "Resource Compiler"...
But in "Project Options" - "Delphi Compiler" - "Conditional Defines".
Update:
I tried in Delphi XE here at work and whether it is defined or not, or where, does not seem to matter for Ctrl+Click to work for me in all cases.
Note that I have Andreas Hausladen's IDE Fix Pack 4.6.6 and DDEv Extension 2.5 installed.
Do you use them?
Update 2:
When in the same unit, it seems to work, even when SOME_OPTION is undefined, but not when Foo is called from another unit.
What seem to work though is when it is properly defined in the Project Options and you rebuild the application (you see the blue dot on the line calling Foo). Then the IDE can use the compiler to locate the function source in the other unit.
That's all I can think of for the moment to help with that. And as has been stated already, it's not the best part of the IDE...
不起作用,因为您没有很好地定义编译指令。必须按照此处所述定义指令 http://docwiki.embarcadero.com/RADStudio/en/Delphi_compiler_directives< /a> 在使用 IDE 部分。一个好的做法是在条件指令更改后重新编译项目。
Is not working because you have not well defined your compilation directives. Directives must be defined as described here http://docwiki.embarcadero.com/RADStudio/en/Delphi_compiler_directives in the Using the IDE section. A good practice is also to recompile the project after conditional directives are changed.