pivaldi/php-cs-fixer

Confusing error message when multiple files open

Closed this issue · 1 comments

After adding the popup-to-buffer change (commit fa21b0f), the popup is verfy confusing and does not allow me to save files.

For example: if I'm editing two or more files, have not saved, and I have made an error in one of them and try to save files:

  • the message in the popup does not tell me which file the error is in,
  • the popup shows a temporary file name and not the name of the file the error was found in,
  • I cannot open the temporary file because it's been deleted,
  • I cannot save files until I've fixed the error.

One workaround I have for now is to disable PHP mode in all the files and then save them.

Here is an example of the text I see in the popup:

PHP Parse error:  syntax error, unexpected single-quoted string "vm_event_id", expecting "]" in /tmp/PHP-CS-Fixer5HheZR.php on line 209

Parse error: syntax error, unexpected single-quoted string "vm_event_id", expecting "]" in /tmp/PHP-CS-Fixer5HheZR.php on line 209

Errors parsing /tmp/PHP-CS-Fixer5HheZR.php

Im using Emacs built from the Git repository on 2025-02-03:

  • Repository revision: a8e85243790b6ab9b9e261c77ddfdc65a9867069
  • Repository branch: master

Running on Debian bookworm.

The php-cs-fixer version information is:

  • Package-Version: 20241103.1232
  • Package-Revision: 710208c

Thank you

Thank you for reporting this issue.

My fixe make the package acts as before the commit fa21b0f
but adds the new option php-cs-fixer-fix-popup-on-error because I've globally disabled warnings but want php-cs-fixer error feedback 😃
Even with php-cs-fixer-fix-popup-on-error set to t, the problem you report must not occur any more.

The error buffer/message now contains the filename failing on fixe.

Regards.