Skip to content

[Repo Assist] feat: add VS Code output channel for debug logging and error display#50

Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
repo-assist/improve-output-channel-debug-logging-eb1ecdc426e46b8a
Draft

[Repo Assist] feat: add VS Code output channel for debug logging and error display#50
github-actions[bot] wants to merge 1 commit intomasterfrom
repo-assist/improve-output-channel-debug-logging-eb1ecdc426e46b8a

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 9, 2026

🤖 This is an automated PR from Repo Assist, an AI assistant.

Summary

Replaces console.log / console.group calls with a named VS Code output channel (PHPCBF), directly addressing the longstanding user complaint in issues #8 and #21 where debug mode shows "nothing" and users don't know how to diagnose problems.

Motivation

The most common question from users is "the extension does nothing, even with phpcbf.debug: true — where is the output?" The answer has always been: "open Developer Tools (Help → Toggle Developer Tools → Console)". That's a hidden, developer-facing tool that most end users never find.

With this change, debug output appears in the standard Output panel (View → Output → PHPCBF), which is a first-class VS Code UI surface visible to all users.

Changes

Before After
console.group("PHPCBF") + console.log(...) (only visible in Dev Tools) outputChannel.appendLine(...) (visible in View → Output → PHPCBF)
Errors logged to console only Errors logged to output channel + channel auto-reveals
stderr captured to console only stderr captured to output channel
Output channel not disposed on deactivate Channel registered in context.subscriptions

Specific changes in extension.js:

  • activate() creates window.createOutputChannel("PHPCBF") and registers it with context.subscriptions
  • Passes the channel to new PHPCBF(outputChannel)
  • getArgs(): outputs args to channel (was console.group + console.log)
  • format(): outputs timestamp + filename at start; exit code; stdout; stderr; done message
  • Error handler: logs to channel and auto-reveals it (was console.log)
  • phpcbfError handler: logs to channel and auto-reveals it

Test Status

This extension requires a live VS Code instance. The changes are purely in the logging layer — no formatter logic was modified.

Manual verification steps:

  1. Enable "phpcbf.debug": true
  2. Open a PHP file and save — the Output panel should open automatically showing args, exit code, and timing
  3. Set an invalid phpcbf.executablePath and save — the Output panel should reveal with the error message
  4. Formatting still works correctly for exit codes 1 and 2 (file changed / partially changed)

Related Issues

Addresses the long-standing "does nothing / no debug output" reports in #8 and #21.

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

Replace console.log/console.group calls with a named VS Code output
channel ('PHPCBF'). Benefits:

- Users can see debug output in 'View → Output → PHPCBF' without
  opening Developer Tools (Help → Toggle Developer Tools → Console),
  which addresses the many 'does nothing / no debug output' reports
  on issues #8 and #21.
- The output channel auto-reveals when phpcbf encounters an error or
  when debug mode is enabled, so problems surface immediately.
- stderr is now also captured to the output channel (was previously
  logged to browser console only).
- The channel is registered with context.subscriptions so it is
  disposed when the extension deactivates.

No behaviour changes for the formatter logic itself.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Mar 9, 2026
Documents the bug fixes and improvements from the open Repo Assist PRs:
- Fix formatter hang on exit code 0 (PR #49, closes #39)
- Fix phpcbf.enable=false bypass (PR #56)
- Fix temp file leak on process error (PR #58)
- Fix onWillSaveTextDocument save timeout (PR #53, closes #35)
- Fix deprecated fs.exists (PR #51, closes #36)
- Fix undefined showErrorMessage on unknown exit code (PR #61)
- Add VS Code output channel for debug/error display (PR #50)
- Refactor getArgs standard variable (PR #60)
- Fix eslintrc and no-case-declarations lint issues

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants