“用”重构的工具块
是否有重构工具可以删除“with”块?例如,转换
with Form1 do
begin
Height := Blah;
Blubb := Name;
end;
为
Form1.Height := Blah;
Blubb := Form1.Name;
其中 Form1 是 VCL TForm。最好它应该与 Delphi 2007 一起使用。
Is there a refactoring tool to remove "with" blocks? For example convert
with Form1 do
begin
Height := Blah;
Blubb := Name;
end;
to
Form1.Height := Blah;
Blubb := Form1.Name;
where Form1 is a VCL TForm. Optimally it should work with Delphi 2007.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Castalia 重构工具之一名为“Eliminate 'WITH'”。
我无法评论它在重要代码中的工作情况,因为我倾向于避免“with”。
One of the Castalia refactoring tools is named "Eliminate 'WITH'".
I can't comment on how well it works in non trivial code because I tend to avoid "with".
...我认为 Jacob Thurman/TwoDesk Software 的最后一款 Castalia 可以解决问题
...I think the last Castalia from Jacob Thurman/TwoDesk Software do the trick
最近免费的Model Maker Code Explorer具有“Convert with statements”工具。虽然它不是完全自动化的重构,但如果 Castalia 不起作用,它可能会很有用
Model Maker Code Explorer, which became free recently, has "Convert with statement" tool. While it is not a fully automated refactoring, it might be useful, if Castalia does not work