Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 293242 - [formatter] JavaScript formatting breaks down in presence of line comment
Summary: [formatter] JavaScript formatting breaks down in presence of line comment
Status: CLOSED DUPLICATE of bug 249225
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: wst.javascript-triaged CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-24 14:07 EDT by Martin von Zweigbergk CLA
Modified: 2010-03-03 11:18 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Zweigbergk CLA 2009-10-24 14:07:53 EDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Build Identifier: 20090920-1017

In some cases, the presence of a line comment completely changes the indentation of the code following it.

When formatting the code below, the lines following the line comment get indented less than they reasonably should. Removing either the line comment or the field "a" makes the code format correctly.

var x = {
	a : true,
	f : function() {
		if (true) { //
		}
	}
};


Reproducible: Always

Steps to Reproduce:
1. Create a new JavaScript file.
2. Enter the code above (see "Details")
3. Format
Comment 1 Deepak Azad CLA 2010-02-01 16:53:31 EST
Formatting also fails with
                var x = {  
		    f : function() {
		        if (true) { //
		        }
		    },
		    a: true
		};

This is a duplicate of Bug 249225.
Comment 2 Chris Jaun CLA 2010-02-26 13:31:25 EST

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