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 {
2461
2461
const { fileName } = this . activeFile ;
2462
2462
const before = this . getFileContent ( fileName ) ;
2463
2463
this . formatDocument ( ) ;
2464
- const after = this . getFileContent ( fileName ) ;
2465
- this . assertObjectsEqual ( after , before ) ;
2464
+ this . verifyFileContent ( fileName , before ) ;
2466
2465
}
2467
2466
2468
2467
public verifyTextAtCaretIs ( text : string ) {
Original file line number Diff line number Diff line change @@ -558,11 +558,15 @@ namespace ts.formatting {
558
558
case SyntaxKind . FunctionDeclaration :
559
559
case SyntaxKind . FunctionExpression :
560
560
case SyntaxKind . MethodDeclaration :
561
- case SyntaxKind . ArrowFunction :
562
561
case SyntaxKind . Constructor :
563
562
case SyntaxKind . GetAccessor :
564
563
case SyntaxKind . SetAccessor :
565
564
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 ;
566
570
case SyntaxKind . ExportDeclaration :
567
571
return childKind !== SyntaxKind . NamedExports ;
568
572
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