intellisense for objects in foreach loop

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

intellisense for objects in foreach loop

Postby seifist » September 20th, 2012, 5:41 pm

I have the commercial version of php tools for visual studio 2012 and have been using it for the last few weeks with much satisfaction.

One point of irritation, however, is that the intellisense doesn't work when I am using a foreach loop to loop through an array of objects.

Lets say I create a custom object called MyObject. Then in another object I create an array as a property. If I populate said array with a series of MyObjects, when I try to use a foreach loop to loop through the objects in that array, the intellisense treats each item I am looping through as an untyped variable. Therefore, intellisense doesn't work for the properties and functions of MyObject.

Are there any settings I can change to fix this? If not, is this a known issue that will be repaired in future versions?
seifist
 
Posts: 3
Joined: September 20th, 2012, 5:36 pm

Re: intellisense for objects in foreach loop

Postby Jakub Misek » September 20th, 2012, 6:04 pm

Hi,

Thank You for your feedback! IntelliSense of array items, together with completing array keys, is currently one of our planned high-priority features. We will do our best to release it in one of the next updates.

I'll mail You once this feature will be released. Feel free to give us note about anything else You would like to see in next version.

Regards,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: intellisense for objects in foreach loop

Postby seifist » September 25th, 2012, 6:24 pm

Thanks Jakub, I look forward to the update.
seifist
 
Posts: 3
Joined: September 20th, 2012, 5:36 pm

Re: intellisense for objects in foreach loop

Postby BladeMF » October 11th, 2012, 9:30 am

I might add this - when implementing "foreach" intellisense, search for implementation of Iterator interface on the collection (object being looped, if it not an array) and then take the return value from the PHPDoc on the Current() function.
Welcome to the zone where normal things don't happen very often.
BladeMF
 
Posts: 346
Joined: October 10th, 2012, 7:14 am

Re: intellisense for objects in foreach loop

Postby Jakub Misek » October 11th, 2012, 12:41 pm

BladeMF wrote:I might add this - when implementing "foreach" intellisense, search for implementation of Iterator interface on the collection (object being looped, if it not an array) and then take the return value from the PHPDoc on the Current() function.

Great idea! We will surely add this onto our todo list.
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: No registered users and 54 guests

cron

User Control Panel

Login

Who is online

In total there are 54 users online :: 0 registered, 0 hidden and 54 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: No registered users and 54 guests