Skip to content

fix(vscode): preserve imports when moving Flyde files - #291

Open
dappweb wants to merge 1 commit into
flydelabs:mainfrom
dappweb:codex/flyde-move-imports-20261013
Open

dappweb wants to merge 1 commit into
flydelabs:mainfrom
dappweb:codex/flyde-move-imports-20261013

Conversation

@dappweb

@dappweb dappweb commented Oct 13, 2026

Copy link
Copy Markdown

Moving Child.flyde into parts/ currently leaves an importing flow pointing at ./Child.flyde. This change updates the reference to ./parts/Child.flyde during VS Code's rename operation. Moving the importer itself rebases its references too, and another save in an already open visual editor preserves those changes.

  • Apply targeted YAML scalar edits for file and directory moves, including nested inline flows and legacy relative import keys. Preserve unrelated content, comments, dirty buffers, and block-scalar line endings.
  • Refresh affected visual panels after the move, reject saves from old render generations, and re-read documents edited during asynchronous rendering. Cancelled rename tokens restore the existing panel's ability to save.
  • Preserve URI scheme/authority when mapping a moved importer, and refresh the path used for the editor's debugger subscription and bootstrap.

Validation

  • Real VS Code 1.98.2 extension host: 22 passing, including 9 new move regressions. These exercise the production rename participant, real workspace renames and the real loader; open-panel tests perform visual edits before and after moves. Cancellation and concurrent-render edit regressions also pass.
  • Loader: 31 passing, 2 existing pending, including 13 new reference-edit cases. Existing core/editor/nodes suites: 135/1/1 passing; core has 8 existing pending cases.
  • Monorepo build passed during implementation. Final VS Code compile, webview typecheck/build, and compiled extension tests passed after the editor safety fixes. The visual suite passed 4 tests before the final rename safety corrections. Final lint passes with 4 existing warnings; git diff --check passes.
  • Control run with only the compiled rename-participant registration disabled: the producer-move regression fails with a real ENOENT for the old path. Restoring registration makes it pass. This was a handler-disabled control, not a pristine-main checkout.

The top-level test command needs an environment adjustment on Node 22: loader's existing TypeScript import-assignment syntax requires disabling native type stripping, but Electron rejects that inherited NODE_OPTIONS flag. Package tests and the extension host were therefore run separately; the top-level test command is not claimed to have passed as one command. A short temporary VS Code profile was used because the default long workspace path exceeded the local IPC socket path limit.

Demo

21-second native VS Code checkpoint demo showing the original reference, its updated reference after a real dependency move, and a second visual edit in the same panel. The real loader resolves Child at all three checkpoints.

The video is a montage of three actual native screenshots captured during a successful automated extension-host scenario, with subtitle captions. It is not a continuous recording; no synthesized editor UI is shown.

Scope

This handles moves reported by VS Code's file-rename API. It does not recover arbitrary external filesystem moves. Anchored/aliased source scalars are left untouched to avoid changing unrelated alias consumers. Runtime verification was on macOS with local file URIs; Windows, remote filesystem providers, and executing/debugging a moved flow were not exercised. URI preservation and debugger-path refresh are implemented and source-reviewed.

AI disclosure

OpenAI Codex agents authored this implementation and its tests with the account owner's authorization. Another Codex agent reviewed the final changes. The validation above records executed checks; no maintainer approval, human review, exclusive claim, bounty availability, or award is implied.

Fixes #112

/claim #112

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.

Broken imports after moving files

1 participant