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 252561 - Highlight to display comment.
Summary: Highlight to display comment.
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 8.1
Hardware: PC Windows 8 x64
: P3 normal (vote)
Assignee: Geertjan Wielenga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-23 21:27 UTC by htokuda10
Modified: 2015-05-25 09:27 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Example in PDF (310.21 KB, application/pdf)
2015-05-24 20:56 UTC, htokuda10
Details

Note You need to log in before you can comment on or make changes to this bug.
Description htokuda10 2015-05-23 21:27:48 UTC
Problem: One of the things that I find distracts me from coding is all of the commenting that I document within my programs.  with the "/**...*/" block, you have the ability to minimize that particular section of code.  But like the comments that are documented using double forward slashes (//), they are all visible to the programmer.  And having a lot of these can become very distracting.

Proposed solution:  Would it be possible to highlight a section of code, whether it be a variable or a block of code, right click on the highlighted piece, and select "add comment" which will add a comment to that section of code?  The added comment will display when hovered over by your mouse, but will be out of view the rest of the time.  This will help decrease and possibly eliminate this specific distraction when programming, code reading, and debugging, but will still be available (if provided of course).

Printing: When printing you could give the user the option to print comments.  If selected, the IDE will pull the comment and place it over the commented section appropriately.

Indicators of comments: Similar to indicating that a section of code is collapsable, maybe with the same bracket indicating the section, you could highlight it with a color indiciating that the section is provided with a comment.

All of this would increase the amount of active code displayed on the screen by reducing the lines taken up by comments.  This allows the programmer the ability to focus more clearly on the code within the program.  Additionally this is very beneficial when the programmer already knows what sections of code do, documents all their work, but does not want to see all of the comments documented within the program.  Less distractors make reading and debugging more efficient, and will also allow the programmer to maintain their train of thought.  Thank you.
Comment 1 cezariusz 2015-05-24 09:14:43 UTC
How about this:
* View -> Code Folds -> Collapse All Javadoc
* Tools -> Options -> Editor -> Folding -> Documentation

And use a dev build to make the folding border less distracting (see bug 229039).
Where would you like to store your nonstandard comments, and why do you want to invent something new if Javadoc works just fine?
Comment 2 htokuda10 2015-05-24 20:56:54 UTC
Created attachment 153833 [details]
Example in PDF

I was requested to provide more information.  See below for additional details on this enhancement idea.

Attached you will find a PDF of an example of what I had in mind.  I used an old project and photo shopped the images to display my idea.  Currently NetBeans IDE has the ability to collapse "All Java Code" which makes searching for methods easier, "All JavaDocs" which collapses all JavaDoc specific commenting, "Fold Tree" which collapses the specific tree which the cursor is clicked in, and "Collapse All" which does exactly that.  As for in-text comments, there is no clean way to hide these comments from view.

My suggestion was primarily the ability to be able to add a comment that will be hidden from view, but still immediately available when needed.  Keeping the (//) as viewable in-text commenting is definitely a must, as this is a key feature to commenting lines of code out.  Maybe a fourth type of commenting syntax that is NetBeans specific ("//*") that can be placed directly above the line that the comment is intended for.  This allows the ability to display or hide all ("//*") type comments and make them accessible by highlight able markers.  If the idea can be extended to other blocks of comments ("/**...*/" and "/*.../"), then that is great.  This suggestion is intended to help provide a cleaner and more readable coding environment, with simplicity and efficiency in mind.
Comment 3 cezariusz 2015-05-25 09:27:47 UTC
My suggestions for enhancements:
1. Add a code template to generate a folding block like this:
        // <editor-fold defaultstate="collapsed" desc="Some comment">
        /**
         */
        // </editor-fold>
2. Add an option to omit <editor-fold> when printing.