Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Turn off formatter for commented lines(Eclipse change settings)
Turn off formatter for commented lines [message #1795485] Mon, 24 September 2018 07:52 Go to next message
Valentin Stanciu is currently offline Valentin StanciuFriend
Messages: 1
Registered: September 2018
Junior Member
Hi,

Is there a way to turn off the formatter only for commented lines?

1. Example code:

int number = 10;
number = 11;

2. Code after selecting it and using Ctrl + Shift + / to comment it:

/*int number = 10;
number = 11;*/

3. Code after using auto-format Ctrl + Shift + F:

/*
* int number = 10; number = 11;
*/

4. Code after selecting it and using Ctrl + Shift + \ to uncomment it:

* int number = 10; number = 11;

It will remove /* and */ from start and end of the code, but it will leave * behind at the start of each line.
Is there a way to stop the auto-format from turning the code from 2. into 3.? Or even after the auto-format does that change, to make the Ctrl + Shift + \ remove the * from each line?
Re: Turn off formatter for commented lines [message #1795758 is a reply to message #1795485] Fri, 28 September 2018 06:20 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33210
Registered: July 2009
Senior Member
Have a look at Window -> Preferences -> Java -> Code Style -> Formatter, edit those, and look at the Comments section where you can disable block comment formatting.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Different behaviour when generating hashCode and equals
Next Topic: Invalid Property Category Path Error
Goto Forum:
  


Current Time: Mon Sep 09 14:48:51 GMT 2024

Powered by FUDForum. Page generated in 0.04233 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top