SanderRonde / phpstan-vscode

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

phpstan.enabled config doesn't disable auto checking #29

Closed Zelyutin closed 1 year ago

Zelyutin commented 1 year ago

Hello! I have v2.2.19(last) version installed, however it seems that PhpStan execute file check on every save even if phpstan.enabled setting is set to false.

PhpStan part from settings.json:

"phpstan.enabled": false,
"phpstan.binPath": "C:\\Users\\User\\AppData\\Roaming\\Composer\\vendor\\bin\\phpstan",
"phpstan.options": [
    "--xdebug"
],
"phpstan.timeout": 30000,
"phpstan.memoryLimit": "2G",
"phpstan.configFile": "phpstan.neon,phpstan.neon.dist",
"phpstan.suppressTimeoutMessage": true,

On every file save I see following messages in output:

[check:1] Check started for file:///e:/MyDir/MyFile.php
[check:1] Spawning PHPStan with the following configuration:  {"binCmd":"C:\\Users\\User\\AppData\\Roaming\\Composer\\vendor\\bin\\phpstan","args":["analyse","-c","e:\\MyDir\\phpstan.neon","--error-format=raw","--no-interaction","--memory-limit=2G","--no-progress","--xdebug","e:\\MyDir\\MyFile.php","-a","C:\\Users\\User\\AppData\\Local\\Temp\\tmp-19784-c95NOXtk3qHR\\autoload.php","-c","C:\\Users\\User\\AppData\\Local\\Temp\\tmp-19784-c95NOXtk3qHR\\config.neon"]}

My final target is to set full project scan on save, tried with but haven't reached any result neither in default file disabling nor in project check enabling

"editor.codeActionsOnSave": {
    "cmd.phpstan.scanProjectForErrors": true
}

I tried workspace reloading and full vs code exit but nothing changed. Also I've tried separate disabling with out editor.codeActionsOnSave enabling so there's no dependency.

P.S. Thank you for your extension! It really helped me a lot in my work for a past few days.

P.P.S. Full project check is a really great function (saw that it's relatively new to others) and even if the files are closed in VSCode the ones with error are lightened up in a file navigation.

Zelyutin commented 1 year ago

In addition, it seems like "phpstan.enabled": false disables check on save but when I hover on some meaningful symbol the check phpstan starts to check the file anyway

SanderRonde commented 1 year ago

First of all thanks for the kind words :)

Hmm these should all be disabled when phpstan.enabled is set to false. I've made some changes in the latest version (2.2.22) that should help you out:

Can you verify whether it has been fixed (doubt it since I didn't change much), and if it hasn't, can you post the output of the PHPStan client output panel? That should help in verifying whether something is wrong with the configuration or if it's really the extension. Version 2.2.22 should be live right now.

github-actions[bot] commented 1 year ago

Issues go stale after too much time without activity. If inactive for another 7 days this issue will be closed.