Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Align fields in columns broken?(Align fields in columns formatter option appears broken)
Align fields in columns broken? [message #721667] Fri, 02 September 2011 13:36 Go to next message
Arin Lipman is currently offline Arin LipmanFriend
Messages: 17
Registered: May 2010
Junior Member
I'm trying to configure the formatter so that sets of lines that are assigning values have the equal / colons aligned. I found something online saying that the "Align fields in columns" option on the indentation tab of the Code Formatter options dialog is supposed to provide this behavior, but this does not seem to work.

Sample code:
var foo =
{
   a : 1,
   bb : 2,
   ccc : 3
};

var a = 1;
var bb = 2;
var ccc = 3;

I would like it to look like this:
var foo =
{
   a   : 1,
   bb  : 2,
   ccc : 3
};

var a   = 1;
var bb  = 2;
var ccc = 3;

Can anyone out there help?
Thanks,
Arin

Edited to apply correct code formatting in post

[Updated on: Fri, 02 September 2011 13:39]

Report message to a moderator

(no subject) [message #721683 is a reply to message #721667] Fri, 02 September 2011 14:37 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

(This is less of a question for the web tools than for the newcomers
forum where it would receive greater consideration in terms of numbers
who see it and answers given.)

On 02-Sep-11 07:36, dread45153 wrote:
> I'm trying to configure the formatter so that sets of lines that are
> assigning values have the equal / colons aligned. I found something
> online saying that the "Align fields in columns" option on the
> indentation tab of the Code Formatter options dialog is supposed to
> provide this behavior, but this does not seem to work.
>
> Sample code:
> var foo =
> {
> a : 1,
> bb : 2,
> ccc : 3
> };
>
> var a = 1;
> var bb = 2;
> var ccc = 3;
>
> I would like it to look like this:
> var foo =
> {
> a : 1,
> bb : 2,
> ccc : 3
> };
>
> var a = 1;
> var bb = 2;
> var ccc = 3;
>
> Can anyone out there help?
> Thanks,
> Arin
Re: (no subject) [message #721687 is a reply to message #721683] Fri, 02 September 2011 14:58 Go to previous messageGo to next message
Arin Lipman is currently offline Arin LipmanFriend
Messages: 17
Registered: May 2010
Junior Member
This is an issue specific to the JavaScript code formatter. Since the exported XML file from the formatter profile contains the id "org.eclipse.wst.jsdt.core.formatter.align_type_members_on_columns" I assumed that this would need to be implemented by the WST package and not by the core eclipse project.

I'm trying to figure out if this is a bug (and if so, a workaround), or if this is "expected behavior" for that function...
Re: (no subject) [message #721712 is a reply to message #721687] Fri, 02 September 2011 16:18 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 02-Sep-11 08:58, dread45153 wrote:
> This is an issue specific to the JavaScript code formatter. Since the
> exported XML file from the formatter profile contains the id
> "org.eclipse.wst.jsdt.core.formatter.align_type_members_on_columns" I
> assumed that this would need to be implemented by the WST package and
> not by the core eclipse project.
>
> I'm trying to figure out if this is a bug (and if so, a workaround), or
> if this is "expected behavior" for that function...

(Ah, sorry, my bad...)
Previous Topic:Extend XML Editor
Next Topic:eclipse gui disappear
Goto Forum:
  


Current Time: Sat May 04 21:08:17 GMT 2024

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

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

Back to the top