use classname as classalias not recognized by intellisense

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

use classname as classalias not recognized by intellisense

Postby urosg » September 15th, 2018, 6:36 am

Hi,

a simple example where use namespace as alias is declared the alias is then not recognized.

Code: Select all
namespace some\name\space;

use some\other\name\space\Class as ClassAlias;

class Class extends ClassAlias
{
}


with this the used ClassAlias at extends is underlined green and declared as "Use of unknown class".
urosg
 
Posts: 51
Joined: February 24th, 2016, 2:05 am

Re: use classname as classalias not recognized by intellisen

Postby Miloslav Beno » September 21st, 2018, 9:25 am

Hi,

Thanks for the post.

The warning seems to be fine. It doesn't say `ClassAlias` is unknown, it says `some\other\name\space\Class` is unknown.

If I didn't get the issue please let me know.

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

Re: use classname as classalias not recognized by intellisen

Postby urosg » September 23rd, 2018, 12:48 pm

Thank you for the answer, it seems there must have been some other error present in parsing the project as I now rechecked and the issue is not apparent anymore.

Thanks again!
urosg
 
Posts: 51
Joined: February 24th, 2016, 2:05 am

Re: use classname as classalias not recognized by intellisen

Postby Miloslav Beno » September 24th, 2018, 8:51 am

Great. I'm glad it's fine now.

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

Re: use classname as classalias not recognized by intellisen

Postby urosg » October 4th, 2018, 4:22 am

This issue has risen up again, unfortunately I don't yet have a way to 100% reproduce it.

Will try to find more details and let you know.
urosg
 
Posts: 51
Joined: February 24th, 2016, 2:05 am

Re: use classname as classalias not recognized by intellisen

Postby urosg » October 4th, 2018, 5:14 am

Now this is interesting.

Currently I have the solution open with two vertical windows, in the left one the classes are recognized correctly but in the right one (let's say) partially.

See here "right" side:
phptools-unknownclass.PNG


and "left" side:
photools-unknownclass-left.PNG


You can see that the classes are underlined as unknown, where the "yii\helpers\Url" actually shows "unknown class error" but the "ActiveForm" (which has the "use kartik\widget\ActiveForm at start) shows the correct description along with the unknown class error. But in the "left" you can see the yii\helpers namespace be recognized correctly.

After reloading Visual Studio it was recognized ok. It seems that sometimes the project is not loaded correctly, but there were no errors while loading in both cases.
You do not have the required permissions to view the files attached to this post.
urosg
 
Posts: 51
Joined: February 24th, 2016, 2:05 am


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 23 guests

cron

User Control Panel

Login

Who is online

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