Skip to content

fix(vscode): keep local .flyde imports valid after file moves - #282

Open
kestrel-devagent wants to merge 1 commit into
flydelabs:mainfrom
kestrel-devagent:fix/flyde-import-paths-on-move
Open

kestrel-devagent wants to merge 1 commit into
flydelabs:mainfrom
kestrel-devagent:fix/flyde-import-paths-on-move

Conversation

@kestrel-devagent

Copy link
Copy Markdown

Summary

Moving or renaming a .flyde file (or its folder) in VS Code left relative source: file imports pointing at the old location, so the imported visual/code node could no longer be resolved.

This PR registers an onWillRenameFiles handler that rewrites local file references via a WorkspaceEdit before the rename commits, covering:

  • Moved import targets (file or containing folder)
  • Moved importing flows (rebase relative paths)
  • Nested inline visual nodes
  • Deprecated top-level imports map keys (defensive)
  • Batch/simultaneous moves (no chaining; most-specific match wins)
  • Package/custom sources left untouched

Implementation

  • vscode/src/updateFileReferences.ts — pure path rewrite helpers
  • vscode/src/registerFileRenameHandler.ts — VS Code rename wiring
  • vscode/src/extension.ts — register the handler on activate
  • vscode/src/test/updateFileReferences.test.ts — mocha coverage for the cases above

Moves performed outside VS Code are outside this event handler’s scope.

Validation

Standalone Node verification of the rewrite helper passed for: moved dependency, importing-flow move, folder rename, co-move no-op, prefix non-match, simultaneous batch, most-specific move, and inline nested nodes.

Demo notes

Pure rewrite behavior is covered by the unit suite. A short screen recording of a VS Code rename can be attached on request if maintainers still require Loom evidence for payout.

Fixes #112
/claim #112

Rewrite relative source:file references when VS Code renames or moves
.flyde files or folders, including when the importing flow itself moves.
Also rebases nested inline visual nodes and deprecated top-level imports.

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