Skip to content

fix(vscode): update local node paths after file moves - #273

Open
jeremymu1506-prog wants to merge 1 commit into
flydelabs:mainfrom
jeremymu1506-prog:fix/local-node-moves
Open

jeremymu1506-prog wants to merge 1 commit into
flydelabs:mainfrom
jeremymu1506-prog:fix/local-node-moves

Conversation

@jeremymu1506-prog

Copy link
Copy Markdown

Fixes #112
/claim #112

Summary

Updates local file-node references when a .flyde or local node file is moved or renamed.

Validation

  • TypeScript compilation passed
  • Regression tests: 2 passing

@MyTH-zyxeon

Copy link
Copy Markdown

Rename-coordinate proposal for #112

Reviewed head 568c94c1fe7567165316a8178badd2ff275f7d3d. I reproduced two remaining cases in updateFileReferencesOnRename:

  1. Moving the consumer changes the reference base. Move /project/Consumer.flyde to /project/sub/Consumer.flyde while its ./Producer.flyde stays at /project/Producer.flyde. The handler passes the consumer's new path, so the helper resolves the reference to /project/sub/Producer.flyde, finds no rename match, and returns false. The source needs to become ../Producer.flyde.
  2. Folder renames do not match descendant files. A consumer referencing ./components/Producer.flyde remains unchanged when the event is /project/components -> /project/shared: exact old-path equality never matches the referenced descendant. It should become shared/Producer.flyde.

Validation: invoked this exact helper with its three type-only imports marked import type, then erased TypeScript types using Node. Runtime statements were unchanged. Both failures reproduced; moving only the producer and leaving a package reference untouched passed as controls. This is a helper-level reproduction, not a VS Code extension-host run, build, or demo video.

Proposed implementation: resolve every reference against the consumer's pre-rename location, map both consumer and referenced target through the rename batch (including directory descendants with path-component boundaries), then compute the reference relative to the consumer's post-rename location. Preserve package sources and inline traversal. Keep edits document-based, and cover dirty buffers, moving both endpoints, directory-prefix lookalikes, and Windows paths in the regression matrix. This can be applied as a focused extension of this PR.

Would this before/after-coordinate approach be acceptable for the remaining #112 scope? This is a non-claim technical proposal; I am not requesting assignment, an exclusive reservation, or payment for this review, and have not submitted a bounty claim. The advertised bounty's current funding and payout eligibility remain unverified.

Run-Id: run-609041f5-4fb0-465b-bc15-655f15fe104a
Trace-Id: f096aa7f732e4bed8fa79fb2ef403bed
Requester: scheduled automation monitor-sxt-bounty-pr-1757 (Discord sender metadata not supplied)
Implementer: MISA 3 bot ID 1516725819517567077

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

2 participants