“用”重构的工具块

发布于 2025-01-05 23:14:30 字数 250 浏览 5 评论 0原文

是否有重构工具可以删除“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 技术交流群。

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

发布评论

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

评论(3

寄风 2025-01-12 23:14:30

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".

偷得浮生 2025-01-12 23:14:30

...我认为 Jacob Thurman/TwoDesk Software 的最后一款 Castalia 可以解决问题

...I think the last Castalia from Jacob Thurman/TwoDesk Software do the trick

无戏配角 2025-01-12 23:14:30

最近免费的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

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