Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Comments format along with java code  RSS feed

 
Harikrishna Gorrepati
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have the following java code plus comments and want to keep the same format in Eclipse java file. But, when I say Ctrl+Shift+F (Format option), I am loosing all format. Please advice what should I do ?
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go to Windows | Preferences | Java | Appearance | Formatter and click Edit next to the active profile. On the Profile dialog, click that Comments button and uncheck the various settings. For this particular comment, unchecking "Enable block formatting" should be sufficient.

But personally, I would change this comment into a javadoc comment for the either the class of the main method, using HTML tags for the options (a..g).

By the way, either your post has a typo or you are missing the '/' on line 25 after the '*' to end the comment.
 
Harikrishna Gorrepati
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peter. It was a typo error. I unchecked "Enable Javadoc comment formatting" and it worked.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!