Enhancement : Keep the view in sync without a window reload - #85
Open
Sillot wants to merge 2 commits into
Open
Conversation
Changing the storage location used to ask for a window reload before the Notes view would show anything from the new folder. The tree now applies the change in place, and keeps itself in sync with what is on disk. - the storage location and the allowed extensions apply immediately - notes and folders added or removed outside of the window are picked up: file system events where they arrive, and a poll of the open folders, which is what covers synced and Windows folders where none ever do - the view refreshes once a create or delete has actually completed on disk, rather than before the write - reveal a note or folder in the file explorer of the operating system, going through explorer.exe on WSL where the built-in command hands a Linux path to Windows - tree items carry a stable id, so an automatic refresh no longer collapses the folders the user had opened Also unblocks the test setup, which could not run: an eslint rule dropped upstream, dependency typings failing the build, the renamed vscode-test package, and the ELECTRON_RUN_AS_NODE that VS Code exports into the terminals it spawns.
Picking a storage location always wrote it to the user settings. It can now go to the workspace settings instead, which is the default, so a folder of notes can travel with the project. notes.storeLocationInWorkspace turns that off for anyone who would rather keep a personal path out of a .vscode/settings.json that ends up committed. It is scoped to the application, so a repository cannot set it back.
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.
Selecting a different storage location used to prompt for a window reload, and
the Notes view showed nothing from the new folder until it was accepted. The tree
now applies the change in place, and keeps itself in sync with what is on disk.
Changes
notes.notesExtensionsapply immediately, no reloadReveal in File Exploreron the context menu of a note or a folderor in your own editor settings, so a personal path need not land in a
.vscode/settings.jsonthat gets committednewNote,newFolderanddeleteNotecalledrefresh()outside theirfscallbacks, so new items only showed up after a manual refresh
New settings
notes.storeLocationInWorkspacetruenotes.watchExternalChangestruenotes.watchIntervalSeconds5(one of 2, 3, 5, 10, 30)Notes for review
folder, or on a Windows drive seen from WSL, never delivers events. The open
folders are polled too — one
readdireach, ~10 ms per folder in that slowcase, and nothing at all while the view is hidden.
id. Without it an automatic refresh collapseswhatever folders the user had opened.
notes.storeLocationInWorkspaceisscope: applicationon purpose: it is apreference about where your own settings live, so a repository must not be
able to set it.
revealFileInOSreceives a Linux path and fails silently, so the pathgoes through
wslpath -wandexplorer.exeinstead..eslintrc.json,tsconfig.jsonandvscode-testchanges are unrelatedto the feature:
npm testcould not run at all before them.Testing
npm testcovers the change detection, and the whole thing was exercised by handin an Extension Development Host.
The features were made with an AI Agent.