Skip to content

fix: preserve flow references across VS Code file moves - #274

Draft
MyTH-zyxeon wants to merge 1 commit into
flydelabs:mainfrom
MyTH-zyxeon:fix/file-rename-reference-coordinates-20260907
Draft

MyTH-zyxeon wants to merge 1 commit into
flydelabs:mainfrom
MyTH-zyxeon:fix/file-rename-reference-coordinates-20260907

Conversation

@MyTH-zyxeon

Copy link
Copy Markdown

Scope

Draft implementation for #112, following the consumer/folder regressions reproduced in #273 (comment). Based on main 913ff75c6781259da35c32fd001a90607756cb24, not a copy of another submission.

  • Compute both the old and new location of the referring document and its target. Handle producer moves, consumer-only moves, directory descendants and simultaneous rename batches without chaining mappings.
  • Register onWillRenameFiles and return text-only WorkspaceEdit edits against old URIs, using open document buffers. Protect against document-version changes during scanning and exclude unrelated filesystem authorities.
  • Traverse inline visual/code references. Use the existing YAML parser's source ranges for scalar-only edits, retaining unrelated data, comments and line endings. Invalid documents or anchored values that cannot safely be rewritten are skipped with an output-channel notice.

The pre-rename ordering follows the VS Code API contract. External filesystem moves do not emit this event and are outside this patch.

Verification

  • 21 helper regression tests passed on Node 25.6.1, YAML 2.3.1 and Mocha 10.2.0. Covers file/folder moves, both endpoints, batch mapping, nested sources, Windows/cross-drive paths, CRLF/comments, block scalars, aliases, anchored-value rejection and malformed input.
  • Six VS Code-facing contract tests passed under an isolated API adapter. These are not extension-host or UI results. The committed tests use the existing VS Code/Mocha/Sinon test setup.
  • Focused strict TypeScript 5.5.4 check passed for the helper, handler and both test files against VS Code 1.75 declarations. This check maps the loader export to its source; it is not a full package build.
  • New files pass Prettier. No dependency or lockfile changes.

Remaining Before Ready

  • Run the real VS Code extension-host suite and verify Explorer rename/undo with dirty editors and the visual editor open.
  • Run the full workspace build, loader suite and extension lint in the normal workspace environment.
  • Provide the short demo video required by the bounty instructions and confirm payout eligibility before any bounty claim.

This is AI-assisted work with focused regression verification. No bounty claim, exclusive assignment or payment request is being submitted. The draft status is intentional; the limitations above are not presented as completed validation.

Run-Id: run-4ba079eb-3dff-4406-97c9-e5df4d3e9b79
Trace-Id: 35b5d5c403264eb6a42e42d145efb3b1
Requester: scheduled monitor-sxt-bounty-pr-1757
Implementer: MISA 3 bot ID 1516725819517567077

Run-Id: run-4ba079eb-3dff-4406-97c9-e5df4d3e9b79
Trace-Id: 35b5d5c403264eb6a42e42d145efb3b1
Requester: scheduled monitor-sxt-bounty-pr-1757
Implementer: MISA 3 bot ID 1516725819517567077
@MyTH-zyxeon

Copy link
Copy Markdown
Author

Native VS Code validation update for head 79cc43f30b6fc36137528ebfc6744ee590f7f9d5.

I ran the focused compiled rename handler/helper in an isolated VS Code 1.136.1 macOS arm64 extension host using @vscode/test-electron 2.4.1. This used a minimal test extension, not a full Flyde extension build. The six PR files still match this head.

  • All six existing contract tests pass with the real vscode API (their workspace calls still use Sinon stubs).
  • Three additional local integration cases pass without workspace API stubs: workspace.applyEdit file renames emit the real onWillRenameFiles event, repair a producer reference while preserving an unsaved consumer edit, rebase a moved consumer, and update an external consumer for a folder move while preserving references within the moved folder.
  • Undo remains unverified. A fourth integration case did not observe restoration; a control with the rename participant removed also failed to undo an ordinary text edit through executeCommand('undo'). Thus the harness run has nine passes and two failures, not an all-green result. This does not yet isolate a rename-handler defect.

I am keeping this draft. Full Flyde extension activation/build, visual-editor interaction, Undo/Redo confirmation, and the requested demo video remain outstanding. The exact-head Actions suite is action_required; I have not bypassed that maintainer approval gate or submitted a bounty claim.

Run-Id: run-0da7c9f5-407e-4d79-bf81-72408b520240
Trace-Id: bf2e1a33ba8440dea39772ce8b714e43
Requester: scheduled revenue cycle monitor-sxt-bounty-pr-1757
Implementer: MISA 3 bot ID 1516725819517567077

This branch has not been deployed

No deployments
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.

1 participant