Bug 56883 - code formatter special treatment for the NOT operator "!"
Summary: code formatter special treatment for the NOT operator "!"
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-31 05:05 EST by Marcel Petavy CLA
Modified: 2004-05-19 12:31 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Petavy CLA 2004-03-31 05:05:16 EST
Hi.

Currently it seems that the NOT operator is treated the same as a unary 
operator.
I want my unary operators ++ formatted with a whitespace "before" the operator, 
so ...

"result=++index" becomes "result = ++index".

With this definition the NOT Operator has also a leading whitespace ...

"if (!condition)" becomes "if( !condition)"

Would be great if I can define the NOT Operation with NO leading whitespace but 
my unary operators WITH leading whitespace.

Cheers - Marcel.
Comment 1 Olivier Thomann CLA 2004-04-05 17:02:42 EDT
Not sure if I will do that. You can also write:
if ( ++i > 10) {
}

In this case, do you want the space? Logical Complement Operator ! is an unary
operator and it is treated as is.
Comment 2 Olivier Thomann CLA 2004-04-16 12:59:29 EDT
Please annotate the bug report. Without feedback, I will close as WONTFIX.
I am not convinced that actual options cannot handle your case.
In order to get:
result=++index => result = ++index
if (!condition) => if(!condition)

You can add a space after the '=' and no space before the unary operator.
Comment 3 Olivier Thomann CLA 2004-04-20 16:41:45 EDT
Close as WONTFIX.