-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactored scanJsxToken when is formatting * Added bug regression test * Simplify JsxText formatting * Renamed isFormatting to allowMultilineJsxText * Updated baselines
- Loading branch information
1 parent
1e9b21f
commit 36f7623
Showing
8 changed files
with
119 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,79 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
//@Filename: file.tsx | ||
//// const a = ( | ||
//// <div> | ||
//// foo | ||
//// </div> | ||
//// ); | ||
//// | ||
//// const b = ( | ||
//// <div> | ||
//// { foo } | ||
//// </div> | ||
//// ); | ||
//// | ||
//// const c = ( | ||
//// <div> | ||
//// foo | ||
//// { foobar } | ||
//// bar | ||
//// </div> | ||
//// ); | ||
//// | ||
//// const d = | ||
//// <div> | ||
//// foo | ||
//// </div>; | ||
//// | ||
//// const e = | ||
//// <div> | ||
//// { foo } | ||
//// </div> | ||
//// | ||
//// const f = | ||
//// <div> | ||
//// foo | ||
//// { foobar } | ||
//// bar | ||
//// </div> | ||
|
||
format.document(); | ||
|
||
verify.currentFileContentIs( | ||
`const a = ( | ||
<div> | ||
foo | ||
</div> | ||
); | ||
const b = ( | ||
<div> | ||
{foo} | ||
</div> | ||
); | ||
const c = ( | ||
<div> | ||
foo | ||
{foobar} | ||
bar | ||
</div> | ||
); | ||
const d = | ||
<div> | ||
foo | ||
</div>; | ||
const e = | ||
<div> | ||
{foo} | ||
</div> | ||
const f = | ||
<div> | ||
foo | ||
{foobar} | ||
bar | ||
</div>`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,23 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// Github issue #41925 | ||
|
||
//@Filename: file.tsx | ||
//// function foo() { | ||
//// const bar = "Oh no"; | ||
//// | ||
//// return ( | ||
//// <div>"{bar}"</div> | ||
//// ) | ||
//// } | ||
|
||
format.document(); | ||
|
||
verify.currentFileContentIs( | ||
`function foo() { | ||
const bar = "Oh no"; | ||
return ( | ||
<div>"{bar}"</div> | ||
) | ||
}`); |