bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.61k stars 94 forks source link

Annotate class member insed a function scope #2786

Closed hakito closed 7 months ago

hakito commented 8 months ago

Feature description or problem with existing feature I am using CakePHP. When I work with a template file I am in a function like scope and have for example access to the form helper with $this->Form

Describe the solution you'd like I'd like to be able to annotate the type of Form. I tried it with

use Cake\View\Helper\FormHelper;
/** @var FormHelper $this->Form */
/** @property FormHelper $Form */

But none of them worked.

bmewburn commented 7 months ago

Does adding the below to the template file work?

/** @var \Cake\View\View $this **/
hakito commented 7 months ago

Yes that does the trick - thanks!