Skip to content

Commit a87203b

Browse files
committed
fix: react aware useState rename fixed
1 parent 0442261 commit a87203b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/features/reactAwareRename.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ export default () => {
2626
new vscode.Position(targetRange.end.line, lineText.indexOf(useStatePatternMatch[1]!)),
2727
newName,
2828
)
29-
const editRenameSetter: vscode.WorkspaceEdit = await vscode.commands.executeCommand(
29+
const setterEdit: vscode.WorkspaceEdit = await vscode.commands.executeCommand(
3030
'vscode.executeDocumentRenameProvider',
3131
document.uri,
32-
// though its fast
3332
new vscode.Position(targetRange.end.line, lineText.indexOf(', set') + ', set'.length + 1),
3433
`set${newName[0]!.toUpperCase()}${newName.slice(1)}`,
3534
)
3635

37-
mainEdit.set(document.uri, [...mainEdit.get(document.uri), ...editRenameSetter.get(document.uri)])
36+
mainEdit.set(document.uri, [...setterEdit.get(document.uri)])
3837
await vscode.workspace.applyEdit(mainEdit)
3938
return true
4039
})()

0 commit comments

Comments
 (0)