TypeScript code formatter reformats promise-chains

Topics: General, Language Specification
Aug 24, 2013 at 7:16 PM
We use promises extensively in our TypeScript projects, and our promise-chains typically look like this (the same style is followed by popular promise libraries as well):
        this.promise(range).then((data) => {
            return this.promise(data.values);
        }).then((values) => {
            return this.promise(values.sane);
        }).then((saneValues) => {
            return this.promise(saneValues);
        }).otherwise((failure) => {
            console.log(failure);
        });
The issue we're facing is that TypeScript's formatter formats the above code as:
        this.promise(range).then((data) => {
            return this.promise(data.values);
        }).then((values) => {
                return this.promise(values.sane);
            }).then((saneValues) => {
                return this.promise(saneValues);
            }).otherwise((failure) => {
                console.log(failure);
            });
Since we (and I'm sure others as well) rely on the formatter for a lot of automatic code formatting, would it be possible to modify the formatter not to reformat the first block of code?

Thanks!
Aug 25, 2013 at 10:12 AM
A slightly different but related indenting issue is raised here: https://typescript.codeplex.com/workitem/1145