calvinbaart / vscode-phpstan Goto Github PK
View Code? Open in Web Editor NEWPHPStan extension for VSCode
Home Page: https://marketplace.visualstudio.com/items?itemName=calsmurf2904.vscode-phpstan
PHPStan extension for VSCode
Home Page: https://marketplace.visualstudio.com/items?itemName=calsmurf2904.vscode-phpstan
You need to downgrade to PHPstan 0.10.x
Currently, when settings either phpstan.excludeFiles
or phpstan.enabled
are changed vscode-phpstan
doesn't re-evaluate list of found problems and doesn't clear the list when phpstan.enabled
is set to false
.
vscode-phpstan should at least remove found problems when phpstan.enabled = false
in workspace settings.
Steps to reproduce:
phpstan.enabled = false
Hi!
I'm still forced to use php 5.6 at work, but I'm able to manually execute phpstan if I call it using my php7.1 executable as prefix to the phar path.
I mean something like
/usr/local/opt/[email protected]/bin/php /usr/local/bin/phpstan
Do you think it would be possible to add it to this extension?
Hello
I've tried as many configuration possibilities I can but impossible to make things working.
I get the following error
Command 'PHPStan: Scan for Errors' resulted in an error (Running the contributed command: 'extension.scanForErrors' failed.)
And the console of the Developer Tools shows
Command 'PHPStan: Scan for Errors' resulted in an error (Running the contributed command: 'extension.scanForErrors' failed.)
Can you please give a few informations on how to configure vscode-phpstan?
Thanks
I installed it locally, checked the settings.
Perhaps I need to adjust some of the settings, but you didn't not explain the settings :-(
Btw: I even restarted VSC
I tried:
"phpstan.options": ["--autoload-file=./vendor/autoload.php"]
I'm getting this exception on executing the command: "PHPScan: Scan for errors"
I'm using:
VS Code 1.24.1
I've install phpstan with that command line: composer global require phpstan/phpstan
I'm using default configuration of your module.
[2018-07-20 10:34:26.209] [exthost1] [error] TypeError: Cannot read property 'fsPath' of undefined
at PHPStan._command.vscode_1.commands.registerCommand (C:\Users\easypara.vscode\extensions\calsmurf2904.vscode-phpstan-0.1.8\out\phpstan.js:22:30)
at e._executeContributedCommand (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:697:706)
at e.$executeContributedCommand (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:698:212)
at e._doInvokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:658:87)
at e._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:657:779)
at e._receiveRequest (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:656:851)
at e._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:656:620)
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:655:544
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:658:673
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:96:599
at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:97:917)
at u (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:159:721)
at Socket. (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:159:898)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Socket.Readable.push (_stream_readable.js:136:10)
at Pipe.onread (net.js:560:20) extension.scanForErrors
I can launch phpstan manually and it work without getting a fatal error:
Seems like phpstan
entered an infinite loop. Where can I find its log in order to debug the situation?
This rather follows on from #9. (Not sure why the author self closed this, no explanation.)
It would be highly useful to be able to specify per-project the PHP binary path to use, particularly when working on systems with multiple PHP versions installed.
Currently phpstan.path requires an absolute path. Please support a path relative to the workspace/folder root.
Upon installing and having COMPOSER_HOME defined, I get the following error when running Scan for errors
[2018-06-30 11:59:22.597] [exthost1] [error] TypeError: Cannot read property 'fsPath' of undefined
at PHPStan._command.vscode_1.commands.registerCommand (/home/raul/.vscode/extensions/calsmurf2904.vscode-phpstan-0.1.7/out/phpstan.js:22:30)
at e._executeContributedCommand (/opt/vscode/resources/app/out/vs/workbench/node/extensionHostProcess.js:674:613)
at e.$executeContributedCommand (/opt/vscode/resources/app/out/vs/workbench/node/extensionHostProcess.js:675:6)
at e._doInvokeHandler (/opt/vscode/resources/app/out/vs/workbench/node/extensionHostProcess.js:636:832)
at e._invokeHandler (/opt/vscode/resources/app/out/vs/workbench/node/extensionHostProcess.js:636:550)
at e._receiveRequest (/opt/vscode/resources/app/out/vs/workbench/node/extensionHostProcess.js:635:631)
at e._receiveOneMessage (/opt/vscode/resources/app/out/vs/workbench/node/extensionHostProcess.js:635:400)
at /opt/vscode/resources/app/out/vs/workbench/node/extensionHostProcess.js:634:315
at /opt/vscode/resources/app/out/vs/workbench/node/extensionHostProcess.js:637:395
at /opt/vscode/resources/app/out/vs/workbench/node/extensionHostProcess.js:95:432
at e.fire (/opt/vscode/resources/app/out/vs/workbench/node/extensionHostProcess.js:96:764)
at Socket.<anonymous> (/opt/vscode/resources/app/out/vs/workbench/node/extensionHostProcess.js:154:338)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Socket.Readable.push (_stream_readable.js:136:10)
at Pipe.onread (net.js:560:20) extension.scanForErrors
I'm using:
Versión: 1.24.1
Commit: 24f62626b222e9a8313213fb64b10d741a326288
Fecha: 2018-06-13T17:47:35.732Z
Shell: 1.7.12
Representador: 58.0.3029.110
Nodo 7.9.0
Arquitectura x64
Files/folders added either to "files.exclude" and "phpstan.excludeFiles" should be excluded from phpstan checks as well, but it is not the case for me. The folders are already excluded in "files.exclude" successfully, but errors pop-up from the extension, even when the phpstan.excludeFiles option is set.
// Example workspace settings
{
"folders": [
{
"path": "/Users/admin/Workspaces/myproject"
}
],
"settings": {
"phpstan.excludeFiles": [
"mixedvendor",
"mixedvendor/",
"mixedvendor/*",
"/mixedvendor",
"/mixedvendor/",
"/mixedvendor/*",
"**/mixedvendor",
"**/mixedvendor/",
"**/mixedvendor/*",
],
},
}
This is happens MAC OSX
[phpstan] Uncaught Error: Call to private method Nette\Utils\ObjectMixin::hasProperty() from context 'Nette\Configurator' in C:\Users\cn\AppData\Roaming\Composer\vendor\nette\utils\src\Utils\SmartObject.php:32
I do not have Nette installed. Trying to use with a Laravel project. Installed phpstan globally
This is perfect for my workflow, but there is a blocking bug in my use of this.
When I introduce a problem in my code that PHPStan identifies, it marks up the error in the code nicely. But when I press ctrl-v to put it back, or fix it a different way, the error continues to be shown.
I can make it disappear by doing one of the following:
I am running vscode-phpstan in VSCode on Ubuntu 16.04.
Phpstan 0.11 has been released with BC breaks affecting this extension. The extension stopped working (no errors are shown) when I updated to 0.11 and continues to work after a downgrade.
This seems to be a problem at least:
CLI option --errorFormat superceded by --error-format
fix launch.json as followed:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
},
{
"name": "PHPStan",
"type": "php",
"request": "launch",
"program": "${file}",
"runtimeArgs": ["/u/php7/phpstan.phar","--no-progress", "--level=4", "--configuration=/u/php7/phpstan.neon", "analyse"],
"cwd": "${fileDirname}"
},
{
"name": "Syntax Check",
"request": "launch",
"type": "php",
"program": "${file}",
"runtimeArgs": ["-l"],
"cwd": "${workspaceFolder}"
}
]
}
When installed in VS Code, the extension reports:
PHPStan: process exited with error, see log for details
However, I do not see any reference in the extension settings on how to locate the PHPStan log. Where is the referenced log located?
thank yoU!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.