fix: Extension not formatting files#79
Conversation
|
Oh, this looks like an issue with the latest version of Might be related to: laravel/pint#390 |
|
Thank you for tracking this down. I had been puzzling over it for at least an hour last night but didn't have the diagnostic know-how to trace it to that part. Anyway, I was about to submit an issue when I noticed your PR, so I got a repro ready already. May it be of use to @d8vjork when checking out this PR: |
This makes sense, in this case we need to close STDIN manually to avoid hanging. Fixed in d7d0d6e |
|
@saade Thanks for giving this PR and for all the effort! Is this |
|
Same for @fritz-c for the replication repo! I'm gonna soon check all this, also with previous versions of Pint to not let previous Pint users down |
|
@d8vjork The Pint Seems like a good amount of support. |
This PR makes Pint always run with the --repair flag.
TLDR
Without this flag, Pint does not apply any formatting when executed via the VSCode extension host, even though the same command works as expected in a terminal. With --repair, Pint consistently applies fixes inside the extension.
Background & Investigation
I went through a lot of trial and error trying to understand the issue:
Initial behavior: Pint ran fine in the terminal (with or without --repair), but in the extension it exited without formatting the file.
What I tried:
Findings:
Conclusion
Although the root cause is still unknown, using --repair is the only reliable way I found to make Pint apply fixes in the VSCode extension environment. While this may be a workaround, it is functional and unblocks the extension.