[Repo Assist] fix: consolidate critical bug fixes (pre-v0.0.10)#106
Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
Draft
[Repo Assist] fix: consolidate critical bug fixes (pre-v0.0.10)#106github-actions[bot] wants to merge 1 commit intomasterfrom
github-actions[bot] wants to merge 1 commit intomasterfrom
Conversation
- Fix hang when phpcbf has nothing to fix (exit code 0 → reject cleanly) - Always close stdin in format() regardless of debug mode - Use path.join() for temp file path (fixes Windows path separators) - Set cwd: TmpDir in cp.spawn (phpcs 2.x macOS compatibility, closes #16) - Fix fs.exists async race in addRootPath() → use fs.existsSync - Fix exit code 3 stdout reading (was registered after spawn, too late) - resolve([]) instead of reject() in provideDocumentFormattingEdits (closes #19) - Read phpcbf.onsave per-document URI in onWillSaveTextDocument (closes #27) - Only reload settings on phpcbf.* config changes (not all VS Code changes) - Resolve ~, ./, ${workspaceFolder}, ${workspaceRoot} in phpcbf.standard (closes #7, #38) - Clean up temp file on spawn error Closes #7, #16, #19, #27, #35, #36, #38, #39 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
34 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
Consolidates the most critical bug fixes from the many open Repo Assist PRs into a single reviewable change. This is the same set of fixes as the blocked issue #98, but without the
package.jsonversion bump so this PR can be created and reviewed now. The version bump can be done separately before release.Changes
Bug Fixes
reject()cleanly instead of leaving the promise unresolved. Closes Indent when saving does not work if phpcbf has nothing to indent #39.onWillSaveTextDocumenttimeout errors on some phpcbf builds. Closes onWillSaveTextDocument-listener error #35.path.join()for temp file path — fixes path separator issues on Windows. Closes Use path.sep when building path to temporary file #23.cwd: TmpDirincp.spawn— so phpcbf can write temporary diff files even on macOS/Linux where the default cwd may be read-only. Closes Detect phpcs version and add option --no-patch if version 2.* #16.fs.existsasync race inaddRootPath()— replaced with synchronousfs.existsSyncsoexecutablePathis always resolved beforeformat()runs. Closes executablePath broken #36.stdoutOutputis collected during the whole lifecycle.resolve([])instead ofreject()inprovideDocumentFormattingEditswhen no changes are needed — eliminates spurious "Formatter failed" notifications. Closes Warning in debugger tools when saving file #19.phpcbf.onsaveper-document URI inonWillSaveTextDocumentso per-folder settings in multi-root workspaces work correctly. Closes add ignorePatterns configuration #27.phpcbf.*config changes — prevents unnecessaryloadSettings()calls on every VS Code settings change.~,./,\$\{workspaceFolder},\$\{workspaceRoot}inphpcbf.standard— so paths like"~/standards/ruleset.xml"or"./phpcs.xml"work without hardcoded paths. Closes ${workspaceRoot} inside phpcbf.debug #7, phpcbf.standard doesn't allow relative paths or ${workspaceFolder} #38.Relationship to Other Open PRs
This PR supersedes (those can be closed once this merges):
Test Status
✅ Unit tests pass:
⚠️ Integration tests: VS Code integration tests require a GUI environment and cannot run in CI. The logic changes are unit-testable; the formatting provider changes follow the VS Code extension API contract.
npm run test:unit— 7/7 tests pass✅ Syntax check:
node --check extension.js— no syntax errorsCloses
Closes #7, #16, #19, #27, #35, #36, #38, #39