sandhje / vscode-phpmd

VSCode PHP Mess Detector extension
MIT License
15 stars 4 forks source link

Declare PHP 7 only compatibility #13

Closed NiklasBr closed 7 years ago

NiklasBr commented 7 years ago

Maybe the readme should be explicit that this extension is not compatible with PHP 5.6? Otherwise the first time this is run in VSCode a bunch of error messages will be thrown.

sandhje commented 7 years ago

Just tested it a minute ago to be sure, but on my system its working perfectly with both PHP 5.6 and 5.5. Could you specifiy what error messages you get, and maybe include the phpmd-vscode logs from the output panel. That way I can look into what exaclty is going wrong.

NiklasBr commented 7 years ago

I got some errors the first time I installed the extension that said something to the extent that PHP 7 was not running. But I can't get those error messages any more.

Output:

[Info  - 3:55:36 PM] Language server connection initialized.
[Info  - 3:55:37 PM] Configuration change triggerd, validating all open documents.
[Info  - 3:55:37 PM] New document opened, starting validation.
[Info  - 3:58:22 PM] Document saved, starting validation.
[Info  - 3:58:25 PM] Document saved, starting validation.
[Info  - 3:58:35 PM] Document saved, starting validation.
[Info  - 4:02:12 PM] New document opened, starting validation.
(node:55649) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: An error occured, no output was received after executing the phpmd command
(node:55649) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[Info  - 4:02:34 PM] Document saved, starting validation.
(node:55649) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: An error occured, no output was received after executing the phpmd command

PHP info:

$ php -v
PHP 5.6.30 (cli) (built: Feb  7 2017 16:18:37) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

screen shot 2017-06-28 at 16 03 15

This error does not appear on system with PHP 7.

sandhje commented 7 years ago

Could you please send the "verbose" logs? Sorry I didn't mention that specifically in my last comment. Those logs give a lot more diagnostic info, like the exact command executed. Anyway it looks like the phpmd command doesn't return any output. Could you also try running the command you find in the verbose logs in the vscode terminal? Probably some error will occur. Should be interesting to see what exactly because that would mean the error handling and feedback in the extension is not quite flawless yet ;). It might have something to do with you working on OSX (I guess from the screenshot) and me being on Windows. I'll try and get my hands on a mac the coming week to test this too.

sandhje commented 7 years ago

Closing this issue since there is no more feedback on this issue and I cannot reproduce it. A seperate issue (#14) was made to address the related "unhandled promise rejection" message seen in the output posted by @NiklasBr.