Community
Participate
Working Groups
The following code: ShippingController = { aVariable: "hello", shippingDomain: function() { NavigationEngine.processGenericServerCall(true); } } will get formatted as: ShippingController = { aVariable : "hello", shippingDomain : function() { NavigationEngine.processGenericServerCall(true); } } with my formatting options. There is no way to specify that there should not be a whitespace after the key name in the object (here aVariable and shippingDomain). I looked everywhere and could not find it. It would be nice if this option was implemented, as I use this convention (no space before the semicolon). I am using WTP latest version with Ganymede.
Nitin, you might consider this an enhancment, but it is a good way to cover all the formatting code.
Testing a fix now.
Created attachment 117806 [details] proposed patch
In the patch I added a new option on the whitespace tab of the format page for Object Initializers. Also added four new strings in the FormatterMessages properties file. In the CodeFormatterVisitor class the visit method for ObjectLiteralField was updated to add spaces around the colon based on user selections.
Looks good.
Patch checked in.
Patch was checked in by Phil.
Thanks guys!
Verified in 20081215095735