When working on my TypeScript code there is an issue with the automatic indenting of code. I use VS2013 with Resharper.
The problem occurs mostly from method chaining.
For example using promises:
someService.GetSomeProperties().then(x => {
return otherService.doSomethingWithX(x.map(y => y.id));
}).then(x => {
// Pressing enter sets the cursor to this position
// Using document format (CTRL+K,CTRL+D) the code moves to this level
return '';
}).then(x => { // Pressing enter from here
// Moves the previous line to it's position and cursor here
return 'a';
}).then(x => {
// However document format moves this code block to this indention level
// as well
}).then(x => {
// Follow up chaining remains the same
});
Based on the 'symptoms' this behavior seems to be coming from having multi-line statements in general.
I've looked through both VS2013's options and R#s but I can't find any option that has any effect on this behavior.
Does anybody know how to fix it?