SanderRonde / phpstan-vscode

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

Uncaught Error: Interface "PHPStan\Diagnose\DiagnoseExtension" not found #106

Closed berniedurfee-renaissance closed 2 months ago

berniedurfee-renaissance commented 2 months ago

Getting this error in 3.2.8:

Fatal error: Uncaught Error: Interface "PHPStan\Diagnose\DiagnoseExtension" not found in /Users/<me>/.vscode/extensions/sanderronde.phpstan-vscode-3.2.8/php/Diagnoser.php:12

3.2.1 works, anything past that throws the same error:

Fatal error:  Uncaught Error: Interface "PHPStan\Diagnose\DiagnoseExtension" not found in /Users/<me>/.vscode/extensions/sanderronde.phpstan-vscode-3.2.2/php/Diagnoser.php:12

Is there a dependency update or something required that I'm missing after 3.2.1?

SanderRonde commented 2 months ago

Hmm what version of PHPStan are you using? If you're using >0.12.0 this should work, if you're using a lower version then the extension should not be running this code

SanderRonde commented 2 months ago

Given that the code we're talking about has been (temporarily) disabled anyways I'll just remove the code for the time being since it is blocking quite a bit and I'm sure you're not alone. Am still wondering about the answer to the above question though so I can figure out what went wrong :)

SanderRonde commented 2 months ago

Fixed in 3.2.9

berniedurfee-renaissance commented 2 months ago
❯ vendor/bin/phpstan --version
PHPStan - PHP Static Analysis Tool 1.11.5
berniedurfee-renaissance commented 2 months ago

Same error, here's a little more of the stack trace:

Fatal error: Uncaught Error: Interface "PHPStan\Diagnose\DiagnoseExtension" not found in /Users/<me>/.vscode/extensions/sanderronde.phpstan-vscode-3.2.9/php/Diagnoser.php:12
Stack trace:
#0 /Users/<me>/.vscode/extensions/sanderronde.phpstan-vscode-3.2.9/_config/<uuid>/autoload.php(2): require_once()

The autoloader file:

❯ cat /Users/<me>/.vscode/extensions/sanderronde.phpstan-vscode-3.2.9/_config/<uuid>/autoload.php
<?php
require_once '/Users/<me>/.vscode/extensions/sanderronde.phpstan-vscode-3.2.9/_config/<uuid>/TreeFetcher.php';require_once '/Users/<me>/.vscode/extensions/sanderronde.phpstan-vscode-3.2.9/php/Diagnoser.php';
SanderRonde commented 2 months ago

Ah I think I know why the original error was happening. Should be fixed now though. (the 3.2.9 fix indeed did not work, 3.2.10 is out now)

berniedurfee-renaissance commented 2 months ago

Working now, thank you!