Skip to content

Format document action is not working properly with objects in functions parameters #14589

@mjbvz

Description

@mjbvz

From @micnic on March 9, 2017 10:6

Format document action is not working properly when providing multiple objects as parameters to javascript functions.

  • VSCode Version: 1.10.2
  • OS Version: Linux Ubuntu 16.04 and Windows 10 tested

Steps to Reproduce:

  1. Write the following lines in a .js file:
someRandomFunction({
    prop1: 1,
    prop2: 2
}, {
    prop3: 3,
    prop4: 4
}, {
    prop5: 5,
    prop6: 6
});
  1. Press the format document editor action keys (Ctrl + Shift + I)

  2. See the following result:

someRandomFunction({
    prop1: 1,
    prop2: 2
}, {
        prop3: 3,
        prop4: 4
    }, {
        prop5: 5,
        prop6: 6
    });

Expected result would be to keep the indentation of the objects.

Copied from original issue: microsoft/vscode#22285

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: FormatterThe issue relates to the built-in formatterHelp WantedYou can do thisVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions