Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing happend after running :CocCommand php-cs-fixer.download #1

Closed
xbot opened this issue Jun 28, 2021 · 8 comments
Closed

Nothing happend after running :CocCommand php-cs-fixer.download #1

xbot opened this issue Jun 28, 2021 · 8 comments

Comments

@xbot
Copy link

xbot commented Jun 28, 2021

The following command works under my project root:

./vendor/bin/php-cs-fixer fix --ansi

But nothing happend after running :CocCommand php-cs-fixer.download in vim. Files that can be formatted by the plain command cannot be formatted by this CocCommand.

@yaegassy
Copy link
Owner

Can you please run this to isolate the problem? Are you getting any error messages?

  1. Run :CocCommand workspace.showOutput
  2. In "Choose by number:" enter the number of php-cs-fixer
  3. Run :CocCommand php-cs-fixer.fix

@xbot
Copy link
Author

xbot commented Jun 28, 2021

No error messages are found. The output is:

########## php-cs-fixer

Run: php vendor/bin/php-cs-fixer fix --using-cache=no --rules=@PSR12 /var/folders/px/rtcpjkg56j36pvt4ymn33r_40000gn/T/vMCguK8/tmp-236845cx81xUpi0ID
Cwd: /Users/don/my-project-root

@yaegassy
Copy link
Owner

There doesn't seem to be any problem.

coc-php-cs-fixer will use vendor/bin/php-cs-fixer if found. https://github.com/yaegassy/coc-php-cs-fixer#note

Has it been formatted?

@xbot
Copy link
Author

xbot commented Jun 28, 2021

No, as I said, no changes have been made to the file.

I'm not sure why the file path is a temporary one in the output above, shouldn't it be the real path? Or is that the content of the formatted temporary file will be put back to the vim buffer?

@yaegassy
Copy link
Owner

tmp file to perform the formatting and replace the results.

You have also reported an issue related to "php-cs-fixer" on coc-diagnostic, so it is probably something wrong with your environment...


Is the file you are trying to format a large file?

@yaegassy
Copy link
Owner

For large files, "coc.nvim" may have a timeout.

If you change this setting to a larger value, will there be any change in behavior?

  "coc.preferences.willSaveHandlerTimeout": 1000,

@xbot
Copy link
Author

xbot commented Jun 28, 2021

I finally found the reason. It's related to the option --rules=@PSR12.

My project has included a custom php-cs-fixer rules package by composer, I think this option conflicts with it.

I set the php-cs-fixer.rules to an empty string, it works now.

Thank you for your help.

@xbot xbot closed this as completed Jun 28, 2021
@yaegassy
Copy link
Owner

OK, I'm glad to hear that the problem has been resolved. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants