TypeScript/tests/cases/fourslash/formatTypeOperation.ts

26 lines
833 B
TypeScript
Raw Normal View History

2015-09-03 15:33:07 +02:00
/// <reference path="fourslash.ts"/>
////type Union = number | {}/*formatBarOperator*/
/////*indent*/
////|string/*autoformat*/
////type Intersection = Foo & Bar;/*formatAmpersandOperator*/
////type Complexed =
//// Foo&
//// Bar|/*unionTypeNoIndent*/
//// Baz;/*intersectionTypeNoIndent*/
format.document();
goTo.marker("formatBarOperator");
verify.currentLineContentIs("type Union = number | {}");
goTo.marker("indent");
verify.indentationIs(4);
goTo.marker("autoformat");
verify.currentLineContentIs(" | string");
goTo.marker("formatAmpersandOperator");
verify.currentLineContentIs("type Intersection = Foo & Bar;");
goTo.marker("unionTypeNoIndent");
2015-09-03 15:45:41 +02:00
verify.currentLineContentIs(" Bar |");
2015-09-03 15:33:07 +02:00
goTo.marker("intersectionTypeNoIndent");
2015-09-03 15:45:41 +02:00
verify.currentLineContentIs(" Baz;");