SanderRonde / phpstan-vscode

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

Ignoring the detection will result in a persistent error message that should disappear #47

Closed BinaryAlan closed 4 months ago

BinaryAlan commented 5 months ago

Figure: line 29 :return $this-> businesscirclelogic-> getPointRelation ($longitude, $latitude)-> toArray () ; , -> toArray () has been removed, but it still reports an error, because the check was skipped

image
SanderRonde commented 5 months ago

Hmm I'm not really sure what the bug is here. Is the issue that it should be checking the file but isn't? Could it be that the file is not yet saved to disk maybe? If it's correct in not checking and the issue is that it doesn't remove the squiggly lines when removing the offending line, that's something I can't really fix. The extension tells VSCode where an issue is and VSCode tries its best to position the error. It's really hard to detect when an offending line was removed and when an issue has been fixed by the user. The only real way to check that is to re-check the file with PHPStan, which only happens on-save.

BinaryAlan commented 5 months ago

Is it possible that the file was modified and saved during phpstan execution, but this change was skipped and the phpstan check was not performed again ?

SanderRonde commented 5 months ago

Theoretically not. Any running check should be cancelled as soon as the file changes and a new one should be queued.

Does this happen often or rarely? And do you have autosave on?

BinaryAlan commented 5 months ago

It happens frequently, and files are automatically saved when they lose focus

SanderRonde commented 5 months ago

Can you check out the pre-release version of the extension? Quite a lot has changed and it should be a lot more robust now. It does now always check the whole project at a time instead of just the file and has more guards for invalidating running checks when a file changes. Thanks!

BinaryAlan commented 4 months ago

It's working fine now, thanks

SanderRonde commented 4 months ago

Awesome, good to hear. I'll close this issue then