Coderush v11.1.6 代码格式化
我正在评估代码格式化的新换行/对齐功能。
仅当代码超过 120 个字符时才可以换行。
选项“Wrap longlines”设置为120,但似乎不起作用。
附言。我来自 resharper 阵营,但大型项目的速度非常慢,我需要寻找替代方案。
i am evaluating the new wrapping/alignment feature of Code Formatting.
Is is possible to wrap the code only if it exceeds let's say 120 characters.
The option "Wrap long lines" is set to 120 but it seems not to work.
PS. I am coming from the resharper camp, but it is so painfully slow on large projects that i need to search for alternatives.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“Wrap longlines”选项对长度超过选项值的代码行进行换行。但是,在当前的实现中,它不包装语句。这意味着它将包装长条件、具有长名称的标识符等,但不会包装位于单行上的语句。好消息是 CodeRush 的下一个主要版本将允许您包装任何超过选项值(例如 120 个字符)的代码。要使当前选项起作用,请打开“长行换行”选项并将列的大小设置为您的首选值。然后,转到“常规格式设置”选项并启用“在自动格式上调整代码样式”选项 - 这将允许您使用 Visual Studio 格式设置中的“换行长行”选项来重新格式化代码(例如“编辑”->“高级”) -> 设置文档格式,CTRL+E,D)。
The "Wrap long lines" option wraps code lines whose length exceeds the option value. However, in the current implementation it doesn't wrap statements. This means that it will wrap long conditions, identifiers with a long name, etc but not the statements that are located on a single line. The good news is that the next major version of CodeRush will allow you to wrap any code that exceeds the option value (e.g. 120 characters). To make the current option work, toggle the "Wrap long lines" option on and set the column's size to your preferred value. Then, go to the General Formatting options and enable the "Adjust code style on autoformat" option - this will allow you to reformat the code with the "Wrap long lines" option in action using the Visual Studio formatting (e.g. Edit->Advanced->Format Document, CTRL+E,D).