added reject() for phpcbf exit codes 0 & 3 to stop editor hanging when there are no fixable errors found#41
Open
theodejager wants to merge 1 commit intosoderlind:masterfrom
Open
Conversation
…n there are no fixable errors found
This was referenced Mar 9, 2026
github-actions bot
added a commit
that referenced
this pull request
Mar 9, 2026
…exit code 0 - Use path.join(TmpDir, ...) instead of TmpDir + "/..." for Windows path separator compatibility (addresses PR #23 from 2018) - Reject the formatter Promise on exit code 0 (no fixable errors found), preventing the VS Code formatting spinner from hanging indefinitely (see issue #39, mirrors PR #41 and PR #48) - Buffer all stdout output and display it as an error message when phpcbf exits with code 3; the previous conditional register of the stdout handler was dead code (phpcbfError was always false at check time) so users never saw the error detail - Replace two separate conditional stdout handler registrations with a single always-registered handler that buffers output and logs to the console in debug mode Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #39