diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 18f463b9fad..fdd70cda461 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -715,7 +715,7 @@ namespace ts.formatting { processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === SyntaxKind.JsxText) { - const range = { pos: child.getStart(), end: child.getEnd() }; + const range: TextRange = { pos: child.getStart(), end: child.getEnd() }; indentMultilineCommentOrJsxText(range, childIndentation.indentation, /*firstLineIsIndented*/ true, /*indentFinalLine*/ false); } diff --git a/tests/cases/fourslash/indentationInJsx3.ts b/tests/cases/fourslash/indentationInJsx3.ts index 3c75356a12f..1c93cbc24bd 100644 --- a/tests/cases/fourslash/indentationInJsx3.ts +++ b/tests/cases/fourslash/indentationInJsx3.ts @@ -4,28 +4,20 @@ ////function foo () { //// return ( ////
-////hello -////goodbye +/////*0*/hello +/////*1*/goodbye ////
//// ) ////} -goTo.position(21); -verify.textAtCaretIs("return"); -goTo.position(38); -verify.textAtCaretIs("
"); -goTo.position(44); -verify.textAtCaretIs("hello"); -goTo.position(50); -verify.textAtCaretIs("goodbye"); +goTo.marker('0'); +verify.currentLineContentIs("hello"); +goTo.marker('1'); +verify.currentLineContentIs("goodbye"); format.document(); -goTo.position(21); -verify.textAtCaretIs("return"); -goTo.position(38); -verify.textAtCaretIs("
"); -goTo.position(56); -verify.textAtCaretIs("hello"); -goTo.position(74); -verify.textAtCaretIs("goodbye"); \ No newline at end of file +goTo.marker('0'); +verify.currentLineContentIs(" hello"); +goTo.marker('1'); +verify.currentLineContentIs(" goodbye"); \ No newline at end of file