TypeScript/tests/cases/fourslash/semicolonFormattingNestedStatements.ts

24 lines
629 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
/// <reference path='fourslash.ts' />
////if (true)
////if (true)/*parentOutsideBlock*/
////if (true) {
////if (true)/*directParent*/
////var x = 0/*innermost*/
////}
goTo.marker("innermost");
edit.insert(";");
2017-06-26 19:55:04 +02:00
// Adding semicolon should format the innermost statement
2014-11-11 04:04:57 +01:00
verify.currentLineContentIs(' var x = 0;');
2014-07-13 01:04:16 +02:00
// Also should format any parent statement that is terminated by the semicolon
goTo.marker("directParent");
2014-11-11 04:04:57 +01:00
verify.currentLineContentIs(' if (true)');
2014-07-13 01:04:16 +02:00
// But not parents that are not terminated by it
goTo.marker("parentOutsideBlock");
verify.currentLineContentIs('if (true)');