Skip to content

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
theodejager:fix-issue-39
Open

added reject() for phpcbf exit codes 0 & 3 to stop editor hanging when there are no fixable errors found#41
theodejager wants to merge 1 commit intosoderlind:masterfrom
theodejager:fix-issue-39

Conversation

@theodejager
Copy link

fixes #39

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>
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

Successfully merging this pull request may close these issues.

Indent when saving does not work if phpcbf has nothing to indent

1 participant