intellisense for objects in foreach loop
5 posts
• Page 1 of 1
intellisense for objects in foreach loop
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?
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
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,
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. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: intellisense for objects in foreach loop
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
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
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. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 37 guests