Watch package changes through PackageWatcher instead of TerminaPacakageWatcher - #1698
Watch package changes through PackageWatcher instead of TerminaPacakageWatcher#1698Eduardo Villalpando Mello (edvilme) wants to merge 3 commits into
Conversation
|
🔒 Automated review in progress — Stella Huang (@StellaHuang95) is auto-reviewing this PR. |
|
GitHub cannot anchor PR review comments to unchanged lines in the diff. Falling back to a general PR comment for src/features/terminal/terminalPackageWatcher.ts:L1.
Removing this watcher drops refreshes for environments manually activated in a terminal but not selected in any workspace scope. Please confirm that this behavior is intentionally out of scope for #1683 and document the tradeoff in the PR description. |
| "integrity": "sha512-D7DbgGFtsqIPIFMPJwCad9Gfi/hC0PWErRRHFnaCWoEDYi5tQUDiJCTmGUbBiLzjqAck4KcXt9Ayj0CNlIrF+w==", | ||
| "dev": true, | ||
| "license": "BSD-2-Clause", | ||
| "peer": true, |
There was a problem hiding this comment.
Info · Optional note
These "peer": true additions appear unrelated to the watcher refactor and look like incidental lockfile reserialization. Please revert this churn to keep the change focused.
Stella Huang (StellaHuang95)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
This pull request refactors and improves the package change detection and watcher system for Python environments. It consolidates the logic for watching package changes across all environment managers into a single, manager-agnostic watcher registration, and removes redundant or manager-specific watcher code. The new system ensures that package changes are detected and handled consistently, regardless of environment type or package manager.
Fixes #1683
Core improvements to package watcher system:
registerPackageWatchersfunction is introduced inpackageWatcher.ts, which registers package watchers for all active environments, sharing watchers when environments are active in multiple scopes and cleaning up watchers when no longer needed. This replaces the old per-manager watcher registration. (src/managers/common/packageWatcher.tsL2-R11, F89a1842L51R51).dist-infodirectories, catching more package changes. (F89a1842L18R18, F89a1842L43R43)Cleanup and removal of legacy code:
terminalPackageWatcher.tsand its related imports and registration are removed, as its functionality is now covered by the new watcher system. [1] [2] [3]builtin/main.tsandpoetry/main.ts, further consolidating watcher logic. [1] [2] [3] [4]API and test updates:
InternalPackageManagerclass now exposes agetPackageWatchTargetsmethod to allow custom watch targets per package manager.These changes improve maintainability, reliability, and coverage of package change detection across all Python environments managed by the extension.