SanderRonde / phpstan-vscode

PHPStan plugin for VSCode
https://marketplace.visualstudio.com/items?itemName=SanderRonde.phpstan-vscode
MIT License
40 stars 9 forks source link

Path to execute is wrong... #7

Closed 9brada6 closed 2 years ago

9brada6 commented 2 years ago

Hi... I tried your plugin because it looks refreshed and I like it would be somewhat maintained....

However after installing, I get this error:

image

The path to the file is good, but it seems that it looks for the path inside VSCode folder. I though is because I have vs Code portable, but on installed version is the same...

The only option that I have set is: "phpstan.configFile": "./phpstan.neon". I also tried "phpstan.configFile": "phpstan.neon" and is the same.... I'm on Windows if it matters.

SanderRonde commented 2 years ago

Don't worry this project is being maintained :) I've uploaded a version that should fix the issue (version 1.3.1). Can you check if it fixed it for you?

SanderRonde commented 2 years ago

Should be fixed in https://github.com/SanderRonde/phpstan-vscode/commit/6fe5c4f2545490a7fdce91b4c2baaa31256e1407. Please re-open the issue if that's not the case

9brada6 commented 2 years ago

Hi... thanks for quick fix! It doesn't work for me at all now... any error is not displayed... but also no errors in development console... I will check via a debugger and see where is going wrong when I have time...

SanderRonde commented 2 years ago

The easiest thing to check is the PHPStan section of the output panel. Can you post those results here?

9brada6 commented 2 years ago
Checking file w:\avada\wordpress\wp-content\themes\Avada\includes\class-awb-typekit-typography.php
Showing status bar
Spawning PHPStan with the following configuration:  {"binCmd":"w:\\avada\\wordpress\\wp-content\\themes\\Avada\\vendor\\bin\\phpstan","args":["analyse","-c","w:\\avada\\wordpress\\wp-content\\themes\\Avada\\phpstan.neon","--error-format=raw","--no-progress","--no-interaction","--memory-limit=1G","w:\\avada\\wordpress\\wp-content\\themes\\Avada\\includes\\class-awb-typekit-typography.php"]}
Document opened, checking
Skipping Log file
Active editor changed, checking
Skipping Log file
PHPStan process exited succesfully
Hiding status bar, last operation result = Success
File check done for file w:\avada\wordpress\wp-content\themes\Avada\includes\class-awb-typekit-typography.php errors= 
Active editor changed, checking
Checking file w:\avada\wordpress\wp-content\themes\Avada\includes\class-awb-typekit-typography.php
Showing status bar
Document opened, checking
Skipping scminput file
Spawning PHPStan with the following configuration:  {"binCmd":"w:\\avada\\wordpress\\wp-content\\themes\\Avada\\vendor\\bin\\phpstan","args":["analyse","-c","w:\\avada\\wordpress\\wp-content\\themes\\Avada\\phpstan.neon","--error-format=raw","--no-progress","--no-interaction","--memory-limit=1G","w:\\avada\\wordpress\\wp-content\\themes\\Avada\\includes\\class-awb-typekit-typography.php"]}
PHPStan process exited succesfully
Hiding status bar, last operation result = Success
File check done for file w:\avada\wordpress\wp-content\themes\Avada\includes\class-awb-typekit-typography.php errors= 
Document opened, checking
Skipping Log file
Active editor changed, checking
Skipping Log file
SanderRonde commented 2 years ago

Hmm looks like it's running successfully and just not encountering any errors. What output do you get when you run the command manually on those files?

9brada6 commented 2 years ago

When I run manually it works... when I run on another, but smaller project, the errors appear, but do not get highlighted and do not appear in problems tab:

https://user-images.githubusercontent.com/19844284/173919327-df6db1f4-a435-4f4d-9803-faa5ba462057.mp4

SanderRonde commented 2 years ago

Ah I've found the error. Should be fixed in a new release (which I'll create soon).

9brada6 commented 2 years ago

Checked... but still the same... now the errors inside output looks like this: File check done for file w:\fusion-tests\main-platform\Servers\Server.php errors= ["Property FT\\Servers\\Server::$server_configuration is never read, only written.","Method FT\\Servers\\Server::waitForContainerToStop() invoked with 1 parameter, 0 required."]

I just wonder if for you it works... it is because you have a different OS?

SanderRonde commented 2 years ago

Hmm it should be working now (also yeah I did update the error formatting a bit). I'm testing it on windows too so I'm not sure why it's not working. Can you check the dev tools and see if that lists anything? The error was a "failed to read file ...." error so maybe something like that again?

9brada6 commented 2 years ago

Yes... I got this: image

SanderRonde commented 2 years ago

Ah so something is going wrong in removing baseline errors. Can you try out this demo build and tell me what it logs? Two things should be added:

It's a .zip file because github doesn't allow uploading .vsix files. Just rename it to .vsix and install it. phpstan-vscode-1.3.3.zip

9brada6 commented 2 years ago

Yes... now the errors are displayed...

On the output I get this:

"--error-format=raw","--no-progress","--no-interaction","--memory-limit=1G","w:\\fusion-tests\\main-platform\\Servers\\Server.php"]}
PHPStan process exited succesfully
Hiding status bar, last operation result = Success
File check done for file w:\fusion-tests\main-platform\Servers\Server.php errors= ["Property FT\\Servers\\Server::$server_configuration is never read, only written.","Method FT\\Servers\\Server::waitForContainerToStop() invoked with 1 parameter, 0 required."]
Failed to filter baseline errors Cannot read properties of undefined (reading 'test')

On the console I get this:

image

I don't know if all the errors are from PHPStan tho... I will go now and leave this discussion on tomorrow or when you have time... tx again for your time.

Edit: If I disable the extension I don't get last 2, so the one with $getPassword is not from this extension.

SanderRonde commented 2 years ago

Alright I found the error. Thanks for your help. Fix should be live soon.