Repository navigation
fix(vscode): keep local .flyde imports valid after file moves - #282
Open
kestrel-devagent wants to merge 1 commit into
Open
kestrel-devagent wants to merge 1 commit into
kestrel-devagent wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moving or renaming a
.flydefile (or its folder) in VS Code left relativesource: fileimports pointing at the old location, so the imported visual/code node could no longer be resolved.This PR registers an
onWillRenameFileshandler that rewrites local file references via aWorkspaceEditbefore the rename commits, covering:importsmap keys (defensive)Implementation
vscode/src/updateFileReferences.ts— pure path rewrite helpersvscode/src/registerFileRenameHandler.ts— VS Code rename wiringvscode/src/extension.ts— register the handler on activatevscode/src/test/updateFileReferences.test.ts— mocha coverage for the cases aboveMoves 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