[Repo Assist] feat: add status bar item showing phpcbf active/error state#104
Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
Draft
Conversation
Adds a status bar item (bottom-right) that: - Shows '✓ phpcbf' whenever a PHP file is the active editor, giving users immediate visual confirmation the extension is loaded and ready. - Hides automatically when the active file is not PHP. - Flashes '⚠ phpcbf' for 4 seconds when a format() call fails (promise rejects), prompting the user to enable phpcbf.debug. After 4 s it resets to the ready state. No package.json changes required — VS Code status bar items do not need a contributes.commands entry. This directly addresses the recurring 'Does Nothing!' confusion (#21, #8, #25): users can see at a glance whether the extension is active and whether the last format attempt encountered an error. Test Status: all 7 unit tests pass (npm run test:unit). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
35 tasks
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.
🤖 This is an automated draft PR from Repo Assist, an AI assistant.
Summary
Adds a status bar item (bottom-right) that gives users immediate visual feedback about the extension state — directly addressing the recurring "Does Nothing!" confusion (#21, #8, #25).
Motivation
Currently there is no visual indication that the phpcbf extension is active for the open PHP file. Users who encounter issues (wrong path, wrong standard, exit-code 0 meaning nothing to fix) see nothing at all and assume the extension is broken. This generates repeated "Does Nothing!" issues.
Many popular VS Code formatters (Prettier, PHP CS Fixer) show a status bar indicator for exactly this reason.
What Changed
extension.jsonly — nopackage.jsonchanges required (status bar items do not need acontributes.commandsentry):StatusBarItemis created inactivate()and registered as a subscription.updateStatusBarVisibility()shows✓ phpcbfwhen the active editor haslanguageId === "php", hides otherwise.showStatusWarning()flashes⚠ phpcbffor 4 s after a format failure (promise rejection), then resets to the ready state..catch()handler inprovideDocumentFormattingEditscallsshowStatusWarning()with a hint to enablephpcbf.debug.User-visible behaviour
✓ phpcbf⚠ phpcbffor 4 s, then resetsTrade-offs
phpcbf.debug.Test Status
✅ All 7 existing unit tests pass (
npm run test:unit):The full VS Code extension integration test (
npm test) requires an X server and is not run in CI on this repo, consistent with all other Repo Assist PRs.