Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312494 - Incorrect code indentation when formatting Javascript with line comments
Summary: Incorrect code indentation when formatting Javascript with line comments
Status: CLOSED DUPLICATE of bug 315234
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2 RC4   Edit
Assignee: Ian Tewksbury CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-11 15:40 EDT by Kian Win Ong CLA
Modified: 2010-06-21 13:57 EDT (History)
2 users (show)

See Also:


Attachments
line-comments-wrong.txt (315 bytes, text/plain)
2010-05-11 15:44 EDT, Kian Win Ong CLA
no flags Details
block-comments-correct.txt (339 bytes, text/plain)
2010-05-11 15:45 EDT, Kian Win Ong CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kian Win Ong CLA 2010-05-11 15:40:42 EDT
Build Identifier: 20090621-0832, 

The Javascript formatter mangles code indentation badly, when line comments are used in either conditional blocks or function bodies.

Replacing the line comments with block comments will, however, produce the correct indentation.

Please see attached files for comparison between using line comments and block comments.

Reproducible: Always

Steps to Reproduce:
1. line-comments-wrong.js show incorrectly formatted Javascript, whereas block-comments-correct.js shows that replacing line comments with block comments produces correct formatting.
Comment 1 Kian Win Ong CLA 2010-05-11 15:44:43 EDT
Created attachment 168014 [details]
line-comments-wrong.txt
Comment 2 Kian Win Ong CLA 2010-05-11 15:45:56 EDT
Created attachment 168015 [details]
block-comments-correct.txt
Comment 3 Kian Win Ong CLA 2010-05-11 15:46:59 EDT
Also occurs on Eclipse 3.6 M7, Build 20100506-2000
Comment 4 Chris Jaun CLA 2010-06-21 13:57:29 EDT

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