Is there a rename refactoring for PHP in Visual Studio Code? It is the only thing that stops me from fully move from NetBeans to VSC. Renaming is very importat for me (not search/replace).
PHP code refactoring Last modified: 14 July 2022. Refactoring means updating the structure of the source code without changing the behaviour of the application. Refactoring helps you keep your code solid, dry, and easy to maintain.
Refactoring variable names involves renaming the variable and then updating usages of the variable that occur elsewhere, such as in the pipeline, other flow services, or document types.
Select Edit > Refactor > Rename. Right-click the code and select Rename.
There are
{
"command": "editor.action.changeAll",
"key": "ctrl+f2",
"when": "editorTextFocus && !editorReadonly"
}
and
{
"command": "editor.action.rename",
"key": "f2",
"when": "editorHasRenameProvider && editorTextFocus && !editorReadonly"
}
in the keybindings. F2 appears to work across all files, CTRL-F2 in the current file only.
Try this rename symbol instead of the standard find/replace. Rename is bound to F2 for all files, CTRL - F2 for current file, may require installing a php language extension.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With