Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355036

Summary: [formatter] New-line and indent after commas in var declaration
Product: [WebTools] JSDT Reporter: Martin <eclipse>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: NEW --- QA Contact: Chris Jaun <cmjaun>
Severity: enhancement    
Priority: P3 CC: eclipse, thatnitind
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
URL: https://github.com/eclipse/webtools.jsdt.core/pull/4
Whiteboard:

Description Martin CLA 2011-08-18 04:17:12 EDT
Would it be possible to get the JavaScript formatter to line-break after commas in multiple-variable declarations, and to then indent the following lines?

Currently:

var myVar = 'test', hisVar = 'real', herVar = 'live';

Ideally (if the formatting comes out right):

var myVar = 'test',
    hisVar = 'real',
    herVar = 'live';

This would then conform nicely with the standard JSLint practice of declaring all at the front.