Skip to content

Visual Studio formatting is wrong in some cases #3817

Open
@ahmelsayed

Description

@ahmelsayed

Here is an example

var webApps: ng.ui.IState[] = [{
    name: "home.webapp",
    templateUrl: "templates/empty-shell.html"
}, {
    name: "home.webapp.templates",
    templateUrl: "templates/templates.html"
}, {
    name: "home.webapp.work",
    templateUrl: "templates/work.html"
}];

VS formats it to

var webApps: ng.ui.IState[] = [{
    name: "home.webapp",
    templateUrl: "templates/empty-shell.html"
}, {
        name: "home.webapp.templates",
        templateUrl: "templates/templates.html"
    }, {
        name: "home.webapp.work",
        templateUrl: "templates/work.html"
    }];

another example is

function test($http: ng.IHttpService) {
    $http({
        url: "https://github.com",
        method: "GET"
    })
    .success((d) => {
        console.log(d);
    })
    .finally(() => {
        console.log("finally");
    });
}

VS formats it to

function test($http: ng.IHttpService) {
    $http({
        url: "https://github.com",
        method: "GET"
    })
        .success((d) => {
            console.log(d);
        })
        .finally(() => {
            console.log("finally");
        });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do thisVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions