Skip to content

fix(vscode): update relative Flyde file imports when files or folders move (#112) - #297

Open
hornsandhalos619 wants to merge 1 commit into
flydelabs:mainfrom
hornsandhalos619:fix/update-imports-on-file-move-issue-112
Open

hornsandhalos619 wants to merge 1 commit into
flydelabs:mainfrom
hornsandhalos619:fix/update-imports-on-file-move-issue-112

Conversation

@hornsandhalos619

Copy link
Copy Markdown

Summary

Fixes broken relative node/flow imports when files or folders are moved or renamed in the VS Code Explorer.

Changes

  • vscode/src/fileMoveImportUpdater.ts: Added resolveMovedTargetPath, formatRelativeFlydeImport, updateVisualNodeFileSources, and updateFlowObjectImportsOnMove to rewrite relative source: { type: 'file', data: '...' } paths (including nested inline visual nodes) and legacy imports entries whenever an imported node/flow file, a parent folder, or the importing .flyde flow itself is moved.
  • vscode/src/extension.ts: Registered a vscode.workspace.onDidRenameFiles listener that scans workspace .flyde flows and applies a WorkspaceEdit to keep relative file imports valid.
  • vscode/src/fileMoveImportUpdater.node.test.ts: Added unit tests covering moved imported files, moved .flyde flows, renamed directories, and nested inline visual nodes.

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