首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IDE中是否有自动修复注释格式的工具?

IDE中是否有自动修复注释格式的工具?
EN

Stack Overflow用户
提问于 2010-03-08 17:18:53
回答 2查看 147关注 0票数 7
代码语言:javascript
复制
/* Suppose I have a multi-line comment with hard line-breaks
 * that are roughly uniform on the right side of the text,
 * and I want to add text to a line in order to make the
 * comment a bit more descriptive.
 */

现在,,最不幸的是,,我需要将文本添加到顶部的行之一。

代码语言:javascript
复制
/* Suppose I have a multi-line comment with hard line-breaks (here is some added text for happy fun time)
 * that are roughly uniform on the right side of the text,
 * and I want to add text to a line in order to make the
 * comment a bit more descriptive.
 */

修复每一行需要O (n )时间(n是行数),以便它们大致重新排列。电脑应该这么做,而不是我。

在我们的IDEs中有处理这个问题的工具吗?他们叫什么?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-03-08 17:21:46

emacs支持命令fill-paragraph,该命令通常映射到meta-q

fill-paragraph对文本第二段的输出:

代码语言:javascript
复制
/* Suppose I have a multi-line comment with hard line-breaks (here is
 * some added text for happy fun time) that are roughly uniform on the
 * right side of the text, and I want to add text to a line in order
 * to make the comment a bit more descriptive.
 */
票数 4
EN

Stack Overflow用户

发布于 2010-03-08 17:23:49

Eclipse内置了这个(至少,我认为这是您想要的)。键入注释时,键入Ctrl+Shift+F,它将格式化所有代码,或仅设置突出显示的代码部分。

我刚刚测试了它,它为我调整了我所有的评论。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2403191

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档