OVYA / php-cs-fixer

php-cs-fixer wrapper for the Emacs editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

doesnt work in php-cs-fixer version 2.10

atef201080 opened this issue · comments

gives this error

Warning (emacs): Command php-cs-fixer version not supported.
Fix this issue removing the Emacs package php-cs-fixer or updating the program php-cs-fixer to version 2.*

when i use it with php-cs-fixer version 2.10.0 which is the latest version..
thank you for this awesome package.

Hello,

This is strange because I use daily this package with php-cs-fixer V2.10 and all goes right.
Are you sure you have only one executable file of php-cs-fixer ?
In a terminal, what is output of the command which php-cs-fixer and, in Emacs, the output of the command (executable-find "php-cs-fixer") (use M-: and paste this command in Emacs) ?
Finally, what is the value of the Emacs variable php-cs-fixer-command (C-h v) ?

in terminal this is the output /c/Users/Home/AppData/Roaming/Composer/vendor/bin/php-cs-fixer
and (executable-find "php-cs-fixer") command output:
screenshot_2

Emacs variable php-cs-fixer-command was [No Match]

Ok…
I never used php-cs-fixer in a Windows system and I haven't a such OS to test it, so it's difficult to help you.
I don't understand why the variable php-cs-fixer-command is not defined in Emacs because the package defines it… Is php-cs-fixer.el loaded ?
However, it seems you have two programs for php-cs-fixer : php-cs-fixer and php-cs-fixer.bat
In the console what is the output of the commands php-cs-fixer --version and php-cs-fixer.bat --version.
In Emacs, what is the output of M-! php-cs-fixer --version.

I'm going to go ahead and close this. If you have any more issues feel free to reopen.

I was having the same problem and found out that in windows php-cs-fixer --version contains ansi escapes. I changed this part inside the php-cs-fixer--is-command-ok:
(concat php-cs-fixer-command " --version")
to
(concat php-cs-fixer-command " --no-ansi --version")
And it worked for me.