Skip to content

Commit b6ea2f9

Browse files
Refactor test and annotate object literal
1 parent 9b9032f commit b6ea2f9

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

src/services/formatting/formatting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ namespace ts.formatting {
715715
processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta);
716716

717717
if (child.kind === SyntaxKind.JsxText) {
718-
const range = { pos: child.getStart(), end: child.getEnd() };
718+
const range: TextRange = { pos: child.getStart(), end: child.getEnd() };
719719
indentMultilineCommentOrJsxText(range, childIndentation.indentation, /*firstLineIsIndented*/ true, /*indentFinalLine*/ false);
720720
}
721721

tests/cases/fourslash/indentationInJsx3.ts

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,20 @@
44
////function foo () {
55
//// return (
66
//// <div>
7-
////hello
8-
////goodbye
7+
/////*0*/hello
8+
/////*1*/goodbye
99
//// </div>
1010
//// )
1111
////}
1212

13-
goTo.position(21);
14-
verify.textAtCaretIs("return");
15-
goTo.position(38);
16-
verify.textAtCaretIs("<div>");
17-
goTo.position(44);
18-
verify.textAtCaretIs("hello");
19-
goTo.position(50);
20-
verify.textAtCaretIs("goodbye");
13+
goTo.marker('0');
14+
verify.currentLineContentIs("hello");
15+
goTo.marker('1');
16+
verify.currentLineContentIs("goodbye");
2117

2218
format.document();
2319

24-
goTo.position(21);
25-
verify.textAtCaretIs("return");
26-
goTo.position(38);
27-
verify.textAtCaretIs("<div>");
28-
goTo.position(56);
29-
verify.textAtCaretIs("hello");
30-
goTo.position(74);
31-
verify.textAtCaretIs("goodbye");
20+
goTo.marker('0');
21+
verify.currentLineContentIs(" hello");
22+
goTo.marker('1');
23+
verify.currentLineContentIs(" goodbye");

0 commit comments

Comments
 (0)