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.

Bug 114946 - Support for block comments in the Ruby editor
Summary: Support for block comments in the Ruby editor
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Editing (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@ruby
Depends on:
Reported: 2007-09-06 21:19 UTC by rpatel
Modified: 2011-01-28 20:10 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description rpatel 2007-09-06 21:19:45 UTC

It would be nice to add block commenting support in Ruby editor such that the developer can select block of code to
comment, right click, and hit "Comment the selected block" or some such thing. I dislike typing =begin/=end, and so
would any Java programmer, I would imagine. In Java block commenting is made much much easier by the original
programmers. Besides the fact that =begin/=end idiom doesn't seem to be working in NetBeans' Ruby editor for some reason.

Comment 1 Torbjorn Norbye 2007-09-06 21:45:26 UTC
Try selecting the text and pressing Ctrl-/  (or click on the editor toolbar action named "Comment").

This will perform a sequence of same-line comments, just like in Java.

The reason this is generally preferred over using block-comment delimiters (=begin/=end in Ruby, /* */ in Java) is that
these don't nest, so if you need to comment out code which contains already commented out code, it doesn't work - the
innermost "escape" causes the outer comment to be seen as regular code.

What did you mean by "the fact that =begin/=end idiom doesn't seem to be working in NetBeans' Ruby editor for some
reason." ?  It does as far as I know; can you provide more details on what you're observing and what the wrong behavior is?
Comment 2 rpatel 2007-09-06 21:54:37 UTC

Yes, Ctrl+/ worked. Noted your point about Ruby's limitation in handling block comments using =begin/=end. Thanks.

Now, what I meant by my previous statement is this - 

I tried marking a code block with =begin and =end at relevant places and NetBeans doesn't seem to understand it. It
gives "Syntax error, unexpected =". I am using M10. Yes, I will upgrade to Beta1 when time permits.