如何在没有自动 DocBlock 格式的情况下在 NetBeans 中进行多行注释? [英] How to do multi-line comments in NetBeans without auto DocBlock formatting?

查看:32
本文介绍了如何在没有自动 DocBlock 格式的情况下在 NetBeans 中进行多行注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时在我的代码中我喜欢注释掉一段代码以供临时使用/引用等,例如:

/*废话*/

但是如果我想在那个块中插入一行,当我点击回车时,它会自动在下一行放一个 * ,就像我在做一个 DocBlock 一样,这是一个小烦恼.这发生在每个回车键上:

/*等等<在此处按下输入>**/

现在我认为这种自动格式化"应该只在开场评论使用格式/**(两颗星)时发生.多行注释在 DocBlocks 之前已经存在很长时间了,所以我不确定为什么它会强制这些老派"标准直截了当/* */注释具有花哨的不需要的额外 DocBlock * !

那么有没有办法:

  • a) 理想情况下 - 只有在开始标记是/** 时才进行格式化
  • b) 或者如果它不能区分/* 和/**,有没有办法完全禁用自动注释格式?

干杯

解决方案

我最终在他们的 Bugzilla 中将此作为 Netbeans 错误输入,他们现在已经修复了该问题.他们很快就做到了,我应该在 12 小时内为他们点赞.据我所知,它似乎将包含在 Netbeans 7.4 版本中.一定要喜欢开源!:)

此处的工作详细信息:

https://netbeans.org/bugzilla/show_bug.cgi?id=230814

Sometimes in my code I like to comment out a block of code for temporary use/reference etc eg:

/* 

blah

*/ 

But it's a minor annoyance that if I then want to go and insert a line inside that block, when I click enter, it will automatically put a * on the next line as though I were doing a DocBlock. This happens on every enter key:

/* 

blah<enter pressed here>
*

*/ 

Now I would have thought this 'auto-formatting' should only take place if the opening comment is using the format /** (two stars). Multi line comments were around a long time before DocBlocks, so I'm not sure why it forces these "old school" standard straight forward /* */ comments to have fancy unwanted extra DocBlock *'s!

So is there a way to:

  • a) Ideally - only have that formatting take place if the opening tag is /**
  • b) Or if it can't differentiate between /* and /**, is there a way to disable the auto-comment-formatting entirely?

Cheers

解决方案

I ended up entering this as a Netbeans bug in their Bugzilla and they have now fixed the issue. They did this VERY Quickly I should add - within 12 hours - kudos to them. From what I can make out it looks like it will be included in Netbeans 7.4 release. Gotta love Open Source! :)

Job details here:

https://netbeans.org/bugzilla/show_bug.cgi?id=230814

这篇关于如何在没有自动 DocBlock 格式的情况下在 NetBeans 中进行多行注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆