File tree 2 files changed +29
-1
lines changed 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -2002,6 +2002,6 @@ namespace ts.refactor.extractSymbol {
2002
2002
}
2003
2003
2004
2004
function isInJSXContent ( node : Node ) {
2005
- return ( isJsxElement ( node ) || isJsxSelfClosingElement ( node ) || isJsxFragment ( node ) ) && isJsxElement ( node . parent ) ;
2005
+ return ( isJsxElement ( node ) || isJsxSelfClosingElement ( node ) || isJsxFragment ( node ) ) && ( isJsxElement ( node . parent ) || isJsxFragment ( node . parent ) ) ;
2006
2006
}
2007
2007
}
Original file line number Diff line number Diff line change
1
+ /// <reference path='fourslash.ts' />
2
+
3
+ // @jsx : preserve
4
+ // @filename : a.tsx
5
+ ////function Foo() {
6
+ //// return (
7
+ //// <>
8
+ //// /*a*/<span></span>/*b*/
9
+ //// </>
10
+ //// );
11
+ //// }
12
+
13
+ goTo . file ( "a.tsx" ) ;
14
+ goTo . select ( "a" , "b" ) ;
15
+ edit . applyRefactor ( {
16
+ refactorName : "Extract Symbol" ,
17
+ actionName : "constant_scope_1" ,
18
+ actionDescription : "Extract to constant in global scope" ,
19
+ newContent :
20
+ `const /*RENAME*/newLocal = <span></span>;
21
+ function Foo() {
22
+ return (
23
+ <>
24
+ {newLocal}
25
+ </>
26
+ );
27
+ }`
28
+ } ) ;
You can’t perform that action at this time.
0 commit comments