Repository navigation
Edit overrides in another editor, and open them in VS Code - #29
Merged
Merged
Conversation
Main watches workspace/files: once the folder has been quiet for 200 ms, each changed override's file is read in the store's write queue (so the app's own writes read back unchanged) and, when it differs, becomes the served content. The renderer then updates the open tab (as saved, or keeping unsaved edits behind a banner), says so and reloads the page as a save does. Open in VS Code (tab header, Explorer row menu, palette) opens the file through VS Code's vscode://file URL, never the system's handler for its type; Show in folder finds it for any other editor.
4 tasks done
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.
What and why
Implements U11 (roadmap M2): edit an override's file in your own editor and the app picks it up.
How it works:
src/main/overrideFiles/):OverrideFileWatcherwatchesworkspace/fileswith a non-persistentfs.watchand counts only content files (<id>.<ext>). Bases,writeAtomic's temp files and editors' swap files are ignored.OverrideStore.takeFileEditin one batch.takeFileEditreads the file inside the store's write queue, so the app's own writes read back unchanged.overrides-changed, then a newoverrides-editedevent with the active workspace's changed ids. The renderer (features/override/external-editor) updates the tabs, shows the toast and reloads.vscode://file/<path>URL, built in main from the override id. It never goes throughshell.openPath, since Windows runs.jsfiles with Windows Script Host.registerOverrideIpc.ts.removeWorkspaceandtakeFileEditgot their own files, to keepOverrideStoreunder 150 lines.fileTabItems.ts.features/override/group: an ungrouped one would have gone over steiger's limit of 20. The older override slices stay where they are, to keep this PR to one change.Only VS Code has a direct action; other editors get the file through Show in folder. A setting for another editor's command could come later.
How it was tested
test/unit/overrideFiles.test.ts):test/renderer/external-edits.test.ts):test/e2e/app.e2e.test.ts), in the real app:vscode://URL (shell.openExternalis stubbed);Checklist
feature/…,bugfix/…) intomain, and does one thingnpm run typecheck,npm run lint:fsd,npm run lint:structure,npm run lint,npm run lint:unused,npm run lint:duplicates,npm run lint:secrets,npm testandnpm run test:e2epass (1193 unit, 110 e2e)docs/SPEC.mddescribes any behaviour this changes (§2, §5 Edits made elsewhere, §7 Another editor, §8, §11)[Unreleased]inCHANGELOG.md