Skip to content

Preserve local flow imports when files or folders move in VS Code - #277

Open
BreakYukino wants to merge 1 commit into
flydelabs:mainfrom
BreakYukino:fix/rename-flow-imports
Open

BreakYukino wants to merge 1 commit into
flydelabs:mainfrom
BreakYukino:fix/rename-flow-imports

Conversation

@BreakYukino

Copy link
Copy Markdown

Moving an imported local node or its parent directory leaves .flyde references pointing at the old path. This registers a VS Code onWillRenameFiles participant that supplies a WorkspaceEdit, including rebasing references when the importing flow itself moves.

Only the YAML scalar for each affected file reference is replaced. Comments, unrelated config, package/custom sources, and unsaved buffer edits are preserved. It handles modern sources, nested inline nodes, legacy imports, folder and batched moves, and Windows drive-letter casing returned by findFiles.

Validation:

  • 14 focused regression tests pass.
  • VS Code extension TypeScript compilation, webview typecheck, webview build, and lint of the new modules pass.
  • An actual VS Code 1.135.0 test with a minimal extension registering this patch's compiled handler passed file rename, dirty-buffer preservation, and importer move checks. The short recording and result are in vscode/test-evidence/. This validates the VS Code integration, not full Flyde flow execution.
  • Full pnpm build was attempted and stops in unchanged nodes/src/ControlFlow/ControlFlow.spec.ts: TS2305: Module 'chai' has no exported member 'assert' during the existing webpack build.
  • Full pnpm test was attempted; the loader suite stops with ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX on the local Node runtime.
  • Existing visual tests were attempted on Windows; the four platform snapshots are absent. Generated baselines were not committed or presented as passing comparisons.

Files moved outside VS Code are outside this handler's scope. Malformed YAML is skipped and logged rather than rewritten.

AI assistance: authored and tested with Codex on behalf of the account owner. The Windows drive-case regression was found in the real editor check and then added to the tests.

Closes #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