Intellisense lost inside closure

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Intellisense lost inside closure

Postby davidbcn » January 16th, 2017, 3:39 pm

Type hinting is completely lost with variables that are scoped into a closure using the "USE" keyword:

Image 3.png


In this example, if you do $instance->... outside the closure intellisense will populate the methods, properties, etc.. of the $instance class.

But doing the same inside the closure yields nothing.
You do not have the required permissions to view the files attached to this post.
davidbcn
 
Posts: 87
Joined: September 10th, 2014, 3:07 am

Re: Intellisense lost inside closure

Postby Jakub Misek » January 17th, 2017, 10:23 am

Thank you David,

We'll handle variables in closures in a future update.

In this case, the type of "$instance" depends on where $promise() is called which we do not handle currently.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to PHP Tools

Who is online

Users browsing this forum: Majestic-12 [Bot] and 48 guests

cron

User Control Panel

Login

Who is online

In total there are 49 users online :: 1 registered, 0 hidden and 48 guests (based on users active over the past 5 minutes)
Most users ever online was 256 on March 28th, 2024, 9:42 am

Users browsing this forum: Majestic-12 [Bot] and 48 guests