This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I tried to add commenting tokens for RHTML files. I added the following to the RHTML.nbs file (in ruby/rhtml/src/**/). COMMENT_LINE { prefix:"<%# "; suffix:" %>"; } However, when I place the caret on a line with text and apply "comment", nothing happens. If I place the caret on an empty line, it -does- insert <%# %> Also, if I hit undo (Ctrl-Z) I have to press it twice - it first deletes the suffix, then the prefix. I think these text modifications should be done under an atomicLock to make sure that they can be undone as a single unit.
We will look at it.
I have fixed the problem with undo. Commenting RHTML non-empty lines does not work from the reason that there is an embedded token sequence of text/html mime type in token sequence of application/x-httpd-eruby mime type. The commnet action is driven by nbs file given by the most embedded mime type (which is text/html). Currently, we do not have any support to handle this situation.
It's unlikely that the prefix/suffix approach would work well for RHTML anyway (because the preferred behavior would be to go -inside- existing <% %> delimiters and add/remove a "#" right inside the "<%"). Is there a way to provide a custom method to handle this? (I've noticed method hooks used in many other places for more complicated behavior). If not, would that be hard to provide? Then I can write the RHTML specific logic myself.
There is no support for handling by a custom method, but we can add it. However, there still be the problem with invoking the action on a line with an embeded mime type different to application/x-httpd-eruby.
Yes, the embedded scenario is there but I'm already handling it for indentation so I think I could do something similar for comments (unless I don't understand what the problem is). But if you could add a hook mechanism that would be great!