File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
typescript/src/specialCommands Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,9 @@ export default (
132132 let targetNode : undefined | ts . Node | [ number , number ]
133133 if ( ts . isIdentifier ( node ) && node . parent ) {
134134 node = node . parent
135+ if ( ts . isJsxExpression ( node ) ) node = node . parent
136+ if ( ts . isJsxAttributeLike ( node ) ) node = node . parent
137+ if ( ts . isJsxAttributes ( node ) ) node = node . parent
135138 if ( ts . isPropertyAssignment ( node ) ) {
136139 targetNode = node . initializer
137140 } else if ( 'body' in node ) {
@@ -140,6 +143,10 @@ export default (
140143 const pos = node . end
141144 targetNode = [ pos , pos ]
142145 }
146+ if ( ts . isJsxClosingElement ( node ) || ts . isJsxClosingFragment ( node ) ) {
147+ const { pos } = node
148+ targetNode = [ pos , pos ]
149+ }
143150 }
144151
145152 if ( ! targetNode ) {
You can’t perform that action at this time.
0 commit comments