I get this error on Mac when trying to install stubs
No handler found for the command: 'crane.downloadPHPLibraries'. An extension might be missing an activation event.
It did work today when trying and wrote crane php stub.
Odd, I'll do some investigation. Thanks for reporting this
I did update VSC on June releases. (the second one released today?) Did not work(same error) on my colleague when i installed crane yesterday on his machine. on a fresh install of VSC.
Which version of OS X is the machine that's not working running?
I have the same error message on a fresh Win10 install, with fresh Visual Studio Code install. Stubs won't install.
Forgot to mention that PHP Intellisense is also the 1st extension I installed and I actually didn't install any other.
Got the same error on a Windows 10 as @AbuJunayd, someone just got a fix or a workaround?
As a workaround you can download a zip of the stubs from here and place them in the C:/Users/[name]/AppData/Roaming/Crane/phpstubs/crane-php-stubs-master/ folder (you may have to create this folder)
Then press F1, type reindex and select the crane option to reindex the workspace.
Thanks dude! You're welcome
Getting this error on reindexing: No handler found for the command: 'crane.rebuildSources'. An extension might be missing an activation event.
You need to open a php file before trying to reindex the workspace
Same issue
The workaround of @nevadascout is wrong place the files in %APPDATA%\Crane\phpstubs\crane-php-stubs-master\
%APPDATA% resolves to C:\Users
The path likely won't exist so just use [START] +[R] > explorer %APPDATA% or easier just run the following command:
[START]+[R] > cmd > mkdir %APPDATA%\Crane\phpstubs\
Then download the file https://codeload.github.com/HvyIndustries/crane-php-stubs/zip/master (the zip contains the last folder as described above and extract it into %APPDATA%\Crane\phpstubs\
After that you need to open a folder (your PHP project) and then [CTRL]+[SHIFT]+[R] to reindex crane.
Finally PHP autocomplete for vscode :+1:
Oops, thanks for the correction @vdoria! I've updated my comment
Also, the error message No handler found for the command: 'crane.downloadPHPLibraries' occurs because you haven't opened a php file to initialize the crane library. If you open a php file the crane library loads and the command then becomes executable.
This is true for any crane command.
We could fix this with activation events :
https://code.visualstudio.com/docs/extensionAPI/activation-events#_activationeventsoncommand
We could enable plugin for all exposed commands so there will no need to open a PHP file in order to make it work.
I think you would have to use.
"activationEvents": [
"*"
]
However, would this attempt to start indexing files event if it isn't a php project?
@TheColorRed you are right, using '*' will trigger the plugin at start (vscode says it's not a good practice), but using onCommand:crane.downloadPHPLibraries will trigger it only if the command is requested by the user...
Instead using *, we could define all shortcut commands that depends on php environements.