File tree Expand file tree Collapse file tree 3 files changed +53
-3
lines changed
Expand file tree Collapse file tree 3 files changed +53
-3
lines changed Original file line number Diff line number Diff line change @@ -2461,8 +2461,7 @@ namespace FourSlash {
24612461 const { fileName } = this . activeFile ;
24622462 const before = this . getFileContent ( fileName ) ;
24632463 this . formatDocument ( ) ;
2464- const after = this . getFileContent ( fileName ) ;
2465- this . assertObjectsEqual ( after , before ) ;
2464+ this . verifyFileContent ( fileName , before ) ;
24662465 }
24672466
24682467 public verifyTextAtCaretIs ( text : string ) {
Original file line number Diff line number Diff line change @@ -558,11 +558,15 @@ namespace ts.formatting {
558558 case SyntaxKind . FunctionDeclaration :
559559 case SyntaxKind . FunctionExpression :
560560 case SyntaxKind . MethodDeclaration :
561- case SyntaxKind . ArrowFunction :
562561 case SyntaxKind . Constructor :
563562 case SyntaxKind . GetAccessor :
564563 case SyntaxKind . SetAccessor :
565564 return childKind !== SyntaxKind . Block ;
565+ case SyntaxKind . ArrowFunction :
566+ if ( sourceFile && childKind === SyntaxKind . ParenthesizedExpression ) {
567+ return rangeIsOnOneLine ( sourceFile , child ! ) ;
568+ }
569+ return childKind !== SyntaxKind . Block ;
566570 case SyntaxKind . ExportDeclaration :
567571 return childKind !== SyntaxKind . NamedExports ;
568572 case SyntaxKind . ImportDeclaration :
Original file line number Diff line number Diff line change 1+ /// <reference path="fourslash.ts" />
2+
3+ // @Filename : Bar.tsx
4+ //// export const Bar = ({
5+ //// foo,
6+ //// bar,
7+ //// }: any) => (
8+ //// <div>Hello world</div>
9+ //// )
10+ ////
11+ //// export const Bar2 = ({
12+ //// foo,
13+ //// bar,
14+ //// }) => (<div>Hello world</div>)
15+ ////
16+ //// export const Bar2 = ({
17+ //// foo,
18+ //// bar,
19+ //// }) => <div>Hello world</div>
20+ ////
21+ //// export const Bar3 = ({
22+ //// foo,
23+ //// bar,
24+ //// }) =>
25+ //// (<div>Hello world</div>)
26+ ////
27+ //// export const Bar4 = ({
28+ //// foo,
29+ //// bar,
30+ //// }) =>
31+ //// <div>Hello world</div>
32+ ////
33+ //// export const Bar5 = () => (
34+ //// <div>Hello world</div>
35+ //// )
36+ ////
37+ //// export const Bar6 = () => (<div>Hello world</div>)
38+ ////
39+ //// export const Bar7 = () => <div>Hello world</div>
40+ ////
41+ //// export const Bar8 = () =>
42+ //// (<div>Hello world</div>)
43+ ////
44+ //// export const Bar9 = () =>
45+ //// <div>Hello world</div>
46+
47+ verify . formatDocumentChangesNothing ( ) ;
You can’t perform that action at this time.
0 commit comments