neild3r / vscode-php-docblocker

Simple docblocker for php
MIT License
94 stars 31 forks source link

Running the contributed command: 'php-docblocker.trigger' failed. #108

Closed aaly00 closed 3 years ago

aaly00 commented 5 years ago

After the latest VS Code update, I have been getting this error. I change the php path from PHP5 to PHP7.3, but I am not sure if that's related since the extension doesn't require dependencies AFAIK. image

VS Code version: image

Tried reloading. Uninstalling then reloading. I also tried to reboot the machine.

neild3r commented 5 years ago

This command only works if your cursor is on the line above a Function or Class where exactly are you triggering running the tigger command?

aaly00 commented 5 years ago

This is a file I created somefile.php image

I trigger the command where the cursor is shown. Throws the error.

EDIT:

Works if it is a class, but doesn't work if it is a function, not sure why. image

neild3r commented 5 years ago

Probably because the plugin was designed for class based functions which start with a visibility (private, public, protected) your function doesn't have a visibility so it's not triggering. It could be possible to make it so that it can handle functions outside of classes.

gotchapt commented 5 years ago

I'm having the same problem on a function with visibility, since the last VSCode update. I'm on VSCode 1.36.0. It still works for class

neild3r commented 5 years ago

@gotchapt Can you please give an example of a function you are trying to trigger the docblock on that is not working? It is working for me

gotchapt commented 5 years ago

@gotchapt Can you please give an example of a function you are trying to trigger the docblock on that is not working? It is working for me

Just found out the issue, I forgot how to php 😅 Was declaring a function like

public function appendGroupRequestData(
  array & $availabilities
)

instead of

public function appendGroupRequestData(
  array &$availabilities
)