question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"php-cs-fixer.onsave": true not working with "files.autoSave": "onFocusChange"

See original GitHub issue

When the "files.autoSave": "onFocusChange" settings is on in VS Code (it means saves automatically the changes) and you don’t save the file manually, the fixer doesn’t work.

Still works on manual save.

Am I missing something?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

17reactions
junstylecommented, Dec 20, 2017

try: "editor.formatOnSave": true and make sure "php-cs-fixer.documentFormattingProvider": true

12reactions
mriverodortacommented, May 6, 2019

this happens to me today, the thing that was causing the problem was that I have installed another PHP formatter PHP Intelephense so VS Code was executing PHP Intelephense instead of php-cs-fixer. the solution was to explicitly specify php-cs-fixer as the default PHP formatter in settings.json like this.

"[php]": { "editor.defaultFormatter": "junstyle.php-cs-fixer" }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio Code files.autoSave onFocusChange not working
I'm trying to setup my visual studio code editor to auto save files on focus change. Reading the setting documentation, I've set up...
Read more >
vscode-php-cs-fixer - Bountysource
I have installed the PHP CS Fixer plugin in WSL, but it can not find the php-cs-fixer.phar ... The extension is installed here...
Read more >
(PDF) 凌波微步:wagon + VS Code 的輕功哲學
Problem. +. VS Code git bash. wagon + VS Code. VS Code $SHELL %COMSPEC% ... files should be fixed on save. "phpformatter.onSave": false...
Read more >
VS Code tips — Auto save - YouTube
With auto save, VS Code automatically saves your code as you work.Configure when files are auto saved with the files. autoSave setting.
Read more >
Coding style standards | Kirby CMS
PHP coding style standards; Tools; PHP CS Fixer; CodeSniffer; Comparing results ... This command would fix all issues in all files in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found