Delphi 2010 留下我的评论

发布于 2024-09-08 16:24:35 字数 612 浏览 1 评论 0原文

Delphi 2010 中的代码格式化程序是开发编码标准的有用工具,或者至少我是这么认为,但它有一个可怕的习惯,会破坏注释。

像这样的精美评论块..

SomeFunction(SomeVaribleWithALongName,             // Comment
             Option2,                              // Comment
             FieldByName('SomeField').AsSomething; // Comment

变得更难阅读

SomeFunction(SomeVaribleWithALongName, // Comment
             Option2, // Comment
             FieldByName('SomeField').AsSomething; // Comment

我已将我能看到的所有内容设置为“False”、“As Is”或“None”,但 CTRL + D 仍然会移动我糟糕的评论。

有没有人对此有解决方案,或者我应该加入一大群讨厌格式化程序的失望的 Delphi 程序员吗?

The code formatter in Delphi 2010 is a useful tool for developing coding standards, or at least this is my opinion, however it has a horrid habit of ruining comments.

A nicly commented block like this..

SomeFunction(SomeVaribleWithALongName,             // Comment
             Option2,                              // Comment
             FieldByName('SomeField').AsSomething; // Comment

Becomes harder to read

SomeFunction(SomeVaribleWithALongName, // Comment
             Option2, // Comment
             FieldByName('SomeField').AsSomething; // Comment

I have set everything I can see to either False, As Is or None, yet CTRL + D still moves my poor comments.

Does anyone have a solution to this or shall I just join the vast group of disappointed Delphi programmers that hate the Formatter?

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

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

发布评论

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

评论(2

风吹过旳痕迹 2024-09-15 16:24:35

为什么不尝试一下 GExperts (www.gexperts.org)。有一个“实验”版本,它是最新版本 1.33 的补丁,其中包含代码格式化程序。这个代码格式化程序最初是一个名为 DelForEx 的独立工具,自 Delphi 早期以来它一直是一个出色的格式化程序。 GExperts 中的代码格式化程序有一个选项,允许您将简单注释与特定列位置对齐。

GExperts 适用于 D2010。您需要先安装最新版本,然后从补丁中复制相关文件来添加代码格式化程序。尽管该补丁被标记为实验性的,但它非常稳定,所以我不会太担心。

Why don't you give GExperts a go (www.gexperts.org). There is an "experimental" version which is a patch on the latest version which is 1.33 which includes a code formatter. This code formatter was originally a separate tool called DelForEx which had been an excellent formatter since the early days of Delphi. The code formatter in GExperts has an option which allows you to align simple comments to a specific column position.

GExperts is available for D2010. You need to first install the latest version and then copy the relevant files from the patch to add the code formatter. Even though the patch is labelled experimental it is pretty stable so I wouldn't worry about that too much.

仄言 2024-09-15 16:24:35

RAD Studio 2010 的 pascal 代码格式化程序相当不成熟和粗糙。查看开源one,它非常灵活(但是,我从未实践过这种风格,所以我不能保证您将容忍您的评论而不触及来源)

RAD Studio 2010's pascal code formatter is rather immature and crude. Check out open source one, it is very flexible (however, i never practiced such style, so i cannot promise you will have tolerance to your comments w/o touching the source)

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