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

Bug 426124

Summary: Format JS indents object literals incorrectly in .json and .js
Product: [ECD] Orion Reporter: Adrian Aichner <adrian.aichner>
Component: JS ToolsAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: adrian.aichner
Version: 5.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Adrian Aichner CLA 2014-01-20 09:09:42 EST
Starting with a test.json containing just this:

{
    "name": "name","title": "title","dependencies": ["menuitems", "addon-sdk"]
}

The first [Format JS] (without any text selection) works as expected:

{
    "name": "name",
    "title": "title",
    "dependencies": ["menuitems", "addon-sdk"]
}

Doing [Format JS] (without any text selection) again shows the problem:

{
    "name": "name",
        "title": "title",
        "dependencies": ["menuitems", "addon-sdk"]
}

This indentation suggests an incorrect hierarchy level.

Same happens when the file is named test.js.

It also happens when indenting

var obj = {
    "name": "name","title": "title","dependencies": ["menuitems", "addon-sdk"]
};

twice.
Comment 1 Adrian Aichner CLA 2014-06-15 11:29:27 EDT
I just checked this is still broken.
Comment 2 John Arthorne CLA 2015-05-05 14:44:48 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html