phpstan.el icon indicating copy to clipboard operation
phpstan.el copied to clipboard

phpstan.neon, but no phpstan executable chokes flyspell

Open xendk opened this issue 4 years ago • 0 comments

Seems that if flycheck-phpstan finds a config file, but can't find a phpstan executable, it manages to error in a way that makes flycheck toss its cookies and never show any new errors for the buffer.

I install phpstan in vendor/bin and don't have any global install, which works fine. But in a project where there's a phpstan.neon, but phpstan haven't been installed, flycheck dies after the first check, and then seems to be in a permanent running state (at least according to doom-modeline).

Disabling the phpstan checker makes thing work when opening new buffers.

Running flycheck-compile and selecting the phpstan checker gives a "PHPStan executable not found" error, which I've traced to phpstan-get-executable.

I'm a bit surprised that flycheck apparently keels over because of the error thrown, I would have thought it would ignore the checker and carry on, but apparently not. On the other hand, it does force checker writers to handle errors and not rely on flycheck picking up the pieces.

I would think a possible solution would be having flycheck-phpstan--enabled-and-set-variable check if the executable could be found and return nil in case of error.

xendk avatar Jan 15 '20 21:01 xendk