I use VSCODE to write the php code.
I'm going to rename a variable or function.
Many sites say "Press F2", but
When I actually press F2, there is no response.
The variable has a cursor and the variable is selected, all of which are unresponsive.
Click Ctrl-F2 to change the string.
It is not available because it ignores the scope and changes all characters.
function sample1(){
$result=1;//<=Change this
return$resutl;
}
function sample2(){
$ResultSample=2;
return$ResultSample;
}
/// If resetl is hoho, the following occurs:
function sample1(){
$hogehoge=1;
return $hogehoge;
}
function sample2(){
$hogehogeSample=2;
return $hogehogeSample;
}
By the way, when editing vue, you can change the name of the in-scope variable with the "f2 key when the variable has a cursor (not selected)."
There seems to be some configuration, but I couldn't find it in the search engine.
Is there anything that needs to be expanded?
Thank you for your cooperation.
In VS Code, F2 should have editor.action.rename assigned
When using php, another command may be enabled by specifying when
(You may find it by referring to the keyboard shortcut (Ctrl+kCtrl+s).
If you want to run editor.action.rename, open the command palette (Ctrl+Shift+p) and copy the command ID
Alternatively,
editor.action.rename to another key
1721 Uncaught (inpromise) Error on Electron: An object could not be cloned
1858 M2 Mac fails to install rbenv install 3.1.3 due to errors
2934 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
1646 I want to run pyautogui without remote connection on Windows 10 in the cloud
© 2025 OneMinuteCode. All rights reserved.