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 (
132
132
let targetNode : undefined | ts . Node | [ number , number ]
133
133
if ( ts . isIdentifier ( node ) && node . parent ) {
134
134
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
135
138
if ( ts . isPropertyAssignment ( node ) ) {
136
139
targetNode = node . initializer
137
140
} else if ( 'body' in node ) {
@@ -140,6 +143,10 @@ export default (
140
143
const pos = node . end
141
144
targetNode = [ pos , pos ]
142
145
}
146
+ if ( ts . isJsxClosingElement ( node ) || ts . isJsxClosingFragment ( node ) ) {
147
+ const { pos } = node
148
+ targetNode = [ pos , pos ]
149
+ }
143
150
}
144
151
145
152
if ( ! targetNode ) {
You can’t perform that action at this time.
0 commit comments