Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357457 - [Formatter] adds unwanted white space between opening parenthesis and var in for loop
Summary: [Formatter] adds unwanted white space between opening parenthesis and var in ...
Status: CLOSED DUPLICATE of bug 369785
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-13 05:07 EDT by D.Wittner CLA
Modified: 2013-05-02 15:08 EDT (History)
5 users (show)

See Also:


Attachments
patch (869 bytes, patch)
2012-07-15 02:56 EDT, Toshihiro Izumi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description D.Wittner CLA 2011-09-13 05:07:54 EDT
Build Identifier: 20090920-1017

I have configured the formatter to not insert a white space after the opening parenthesis in the for loop. 

It works well if i declare the counter variable outside the loop:

for (i = 0, j = array.length; i < array.length; i++, j--) {
}

But if i declare the counter variable inside the loop, the formatter inserts a white space after the opening parenthesis:

for ( var i = 0, j = array.length; i < array.length; i++, j--) {
}

Reproducible: Always

Steps to Reproduce:
1. Just format the following code fragment:

for (var i = 0, j = array.length; i < array.length; i++, j--) {
}
Comment 1 Toshihiro Izumi CLA 2012-07-15 02:56:54 EDT
Created attachment 218730 [details]
patch
Comment 2 Octavian Nita CLA 2012-07-30 06:45:19 EDT
Hey there,

Thanks for the patch - any ideea when (/where) will it first be available? (either in a nightly build, or official patch, etc. - unfortunately I am not familiar with Eclipse's patch release process and even using the documentation it is not that obvious...)
Comment 3 Wang Jialiang CLA 2013-03-07 19:45:42 EST
Please fix this format issue soon.
I'm surprised a patch was created last year and didn't make it for Juno SR2 release :(
Comment 4 Kevin Breslin CLA 2013-04-30 19:32:13 EDT
When will this fix be added to production? It's quite bothersome.
Comment 5 Wang Jialiang CLA 2013-04-30 19:38:15 EDT
(In reply to comment #4)
> When will this fix be added to production? It's quite bothersome.

Consider this issue has been there for years and several other JS format bugs dragging event longer, I have high hopes in the next decade, lol.
Comment 6 Michael Rennie CLA 2013-05-02 15:08:33 EDT
Thanks for the patch Toshihiro. I am going to mark this bug a dupe of 369785 (even though it is newer) because I started working on that one before I realized this one existed :)

*** This bug has been marked as a duplicate of bug 369785 ***