Skip to content

fix(vscode): keep Flyde imports working after file moves#267

Open
nam157 wants to merge 1 commit into
flydelabs:mainfrom
nam157:codex/fix-flyde-imports-on-move
Open

fix(vscode): keep Flyde imports working after file moves#267
nam157 wants to merge 1 commit into
flydelabs:mainfrom
nam157:codex/fix-flyde-imports-on-move

Conversation

@nam157

@nam157 nam157 commented May 19, 2026

Copy link
Copy Markdown

Fixes #112

/claim #112

Proposed Changes

  • Register a VS Code onDidRenameFiles listener for Flyde flows.
  • Rewrite relative source: file imports inside a moved .flyde flow so its existing imports still point to the same files after the move.
  • Rewrite workspace .flyde files that reference a moved import target so importer flows keep resolving the target from its new location.
  • Keep the path-rewrite logic in a small pure helper with focused regression coverage.

Proof

pnpm --filter @flyde/editor build
pnpm --filter @flyde/nodes build
pnpm --filter @flyde/loader build
pnpm --filter flyde-vscode compile
pnpm --filter flyde-vscode compile-tests
./vscode/node_modules/.bin/mocha --ui tdd vscode/out/test/flydeImportPathRewriter.test.js
pnpm --filter flyde-vscode lint

Results:

  • flyde-vscode compile passed.
  • flyde-vscode compile-tests passed.
  • Focused Mocha suite passed: 4 passing.
  • flyde-vscode lint passed with 0 errors; existing unrelated warnings remain in open-flyde-panel.ts, scan-importable-nodes.ts, and find-package-root.ts.

Checklist

  • PR created against main.
  • TypeScript compile passed.
  • Regression tests added for moved flow imports and moved target references.
  • No user-facing docs needed for this bug fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken imports after moving files

1 participant