Skip to content

Conversation

@JuliusBairaktaris
Copy link
Contributor

This PR addresses issue #4744 by implementing proper error handling for the tex-fmt formatter.

Previously, tex-fmt failures were silent regarding their cause because stderr was ignored. This change ensures that if tex-fmt exits with a non-zero code:

  • stderr and stdout are captured.
  • The captured output is logged to the "LaTeX Workshop" output channel.
  • The user is notified via an error message to check the logs.

Key Changes

  • Modified src/lint/latex-formatter/tex-fmt.ts:
    • Added listeners for stderr and stdout.

Testing

  • Manual Verification: Verified using a local installation of tex-fmt and forcing a failure by passing an invalid argument in the settings. Confirmed that error details now appear in the output channel.

Related Issue

Closes #4744

Copilot AI review requested due to automatic review settings December 6, 2025 08:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances error handling for the tex-fmt formatter by capturing and logging stderr/stdout output when the formatter fails. Previously, tex-fmt failures were silent, making debugging difficult for users.

Key Changes:

  • Added logging of stderr and stdout to the output channel when tex-fmt exits with a non-zero code
  • Added explicit return statement to prevent execution of success path after error handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jlelong jlelong merged commit a77696e into James-Yu:master Dec 7, 2025
13 checks passed
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.

Feature Request: Emit warnings output by the formatter to the extension-user

2 participants