[Routine - VT] fix: set up FileSystemWatchers for scopes added after workspace folder change#68
Draft
winterdrive wants to merge 1 commit into
Draft
[Routine - VT] fix: set up FileSystemWatchers for scopes added after workspace folder change#68winterdrive wants to merge 1 commit into
winterdrive wants to merge 1 commit into
Conversation
…r change When onDidChangeWorkspaceFolders fires and reinitializeScopes() adds new ConfigScopes, no FileSystemWatcher was created for them. External edits to virtualTab.json in newly added folders would not auto-refresh the tree view. Now tracks which scope IDs already have a watcher and only creates new watchers for previously-unseen scopes, avoiding duplicate registrations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Jun 26, 2026
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.
Pre-flight Check
Active branches / open PRs checked before this fix:
origin/routine/vt-fix-duplicate-scope-260625(PR [Routine - VT] fix: preserve sourceScopeId when duplicating a group #67) — touchessrc/commands.ts,src/core/DropUriParser.ts,src/dragAndDrop.ts,src/provider.tsorigin/fix/issue-60-folder-drop-files-mime— touchessrc/core/DropUriParser.ts,src/dragAndDrop.ts,src/provider.tsThis PR only modifies
src/extension.ts, which is untouched by all active branches — no conflicts.Changes
File:
src/extension.tsWhen
onDidChangeWorkspaceFoldersfires,provider.reinitializeScopes()correctly refreshesprovider.configScopeswith newly added workspace folders. However,setupWatchers()was only called once at extension activation — new scopes had noFileSystemWatchermonitoring theirvirtualTab.json. Externally-edited config files in dynamically added folders would not auto-refresh the tree view.Fix: After
reinitializeScopes(), filterprovider.configScopesto find scopes that don't yet have a watcher, and callsetupWatchersonly for those new scopes. ASet<string>(watchedScopeIds) tracks which scope IDs already have watchers to prevent duplicate registrations.Safety Verification
tsc --noEmit: No errors.npm test: 473/473 tests pass. The 1 suite-level failure is a pre-existing TypeScript symbol collision between two git worktrees (busy-yalow-edb734andtrusting-vaughan-0206eb) — unrelated to this change.package.jsoncommands, configuration keys, or serialization format changed.🤖 Generated with Claude Code