Add trait support

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

Add trait support

Postby davidbcn » February 8th, 2017, 8:41 am

Mostly I found that support for traits is a little bit crippled.

[1] Autocomplete when adding trait to class does not populate with traits in the same namespace. You need to use full namespace ("\Drupal\fdf\MyCustomTrait" instead of "MyCustomTrait" directly).

[2] Autocomplete when adding traits will let you use anything, including interfaces and classes. It should only populate with traits and show error when "using" inside a class is pointing to something that is not a trait.

[3] Methods "inherited" by a class through a trait are not seen by Intellisense. I had to resort to creating stub interfaces for Intellisense to pick the methods in the traits.

It would be great to see support for traits improved.
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: Add trait support

Postby davidbcn » February 8th, 2017, 8:56 am

UPDATE: Looks like some of the issues are due to the fact that PHP Tools needs use statement in trait to have full namespace.
davidbcn
 
Posts: 87
Joined: September 10th, 2014, 3:07 am

Re: Add trait support

Postby Jakub Misek » February 8th, 2017, 12:35 pm

Hi David,

Thanks for the feedback. We've fixed [1] and [2]. So these will be in next update.

We'll improve other traits features in a future updates as well.

Best,
Jakub
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: Add trait support

Postby Miloslav Beno » February 9th, 2017, 12:54 pm

Hello,

Please check the latest preview. It contains [1] and [2] fixes.

Thanks!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 29 guests

User Control Panel

Login

Who is online

In total there are 29 users online :: 0 registered, 0 hidden and 29 guests (based on users active over the past 5 minutes)
Most users ever online was 297 on March 29th, 2024, 7:06 am

Users browsing this forum: No registered users and 29 guests