We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 845c4ff commit 36ad9b9Copy full SHA for 36ad9b9
typescript/src/specialCommands/handle.ts
@@ -132,6 +132,9 @@ export default (
132
let targetNode: undefined | ts.Node | [number, number]
133
if (ts.isIdentifier(node) && node.parent) {
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
138
if (ts.isPropertyAssignment(node)) {
139
targetNode = node.initializer
140
} else if ('body' in node) {
@@ -140,6 +143,10 @@ export default (
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
+ }
150
151
152
if (!targetNode) {
0 commit comments