feat: auto-restart tools when dependency lock file changes#177
feat: auto-restart tools when dependency lock file changes#177
Conversation
…start tools Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com> Agent-Logs-Url: https://github.com/oxc-project/oxc-vscode/sessions/f66badc1-1e3f-4b14-8d04-133065a794e8
Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com> Agent-Logs-Url: https://github.com/oxc-project/oxc-vscode/sessions/f66badc1-1e3f-4b14-8d04-133065a794e8
|
@copilot check for |
Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com> Agent-Logs-Url: https://github.com/oxc-project/oxc-vscode/sessions/176b62b3-3597-4658-a8f0-607e0560797a
Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com> Agent-Logs-Url: https://github.com/oxc-project/oxc-vscode/sessions/176b62b3-3597-4658-a8f0-607e0560797a
Done in commit |
| * first workspace folder is returned so that an initial `npm install` is | ||
| * also detected. | ||
| */ | ||
| private resolveWatchPath( |
There was a problem hiding this comment.
@copilot The watch file should already be resolved. No need to check for workspace or exe extension
There was a problem hiding this comment.
Done in 1e05627. Removed the fallback resolveWatchPath logic entirely — BinaryWatcher now simply returns early when binary is undefined, and uses binary.path directly when it is resolved.
…ed binary Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com> Agent-Logs-Url: https://github.com/oxc-project/oxc-vscode/sessions/a7727b89-e5e7-4125-bc95-6bdada572d87
|
Does this resolve one of the core issues which is that the extension locks the binaries? There is no use in adding a watcher if you can't update the binaries. |
|
@Dykam I guess you are on Windows? I could not find an issue in this repo. Could you please create one. |
|
@copilot this will not work as expected. When we found the binary, we have for pnpm a path like: We should search from the found binary the projects package.json or the lock file (respect yarn, pnpm, bun lock files too). |
…e layout Agent-Logs-Url: https://github.com/oxc-project/oxc-vscode/sessions/d80116ea-7625-4678-bb53-fbf2160baf37 Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com>
Done in When a binary is found, When no binary is found yet (initial install), all workspace folders are watched so the first |
|
@copilot does global installed modules have a lock file? We need to have a way to watch for them too if not. |
… watching Agent-Logs-Url: https://github.com/oxc-project/oxc-vscode/sessions/b2a4dba3-cdf0-42c3-a187-dba8196bb294 Co-authored-by: Sysix <3897725+Sysix@users.noreply.github.com>
Done in
A small |
Has it been considered that some projects already have |
|
#181 restart lint server after npm i |
Watches dependency lock files (
package-lock.json,yarn.lock,pnpm-lock.yaml,bun.lockb,bun.lock) for changes so that tools are restarted automatically afternpm install,pnpm install,yarn install, orbun install— without requiring a VS Code restart. For globally installed or settings-specified binaries that have no project lock file, the binary file itself is watched directly.Changes Made
client/findBinary.ts— addedwatcherPath?: stringtoBinarySearchResult. When set,BinaryWatcherwatches that specific file instead of searching for a lock file.searchGlobalNodeModulesBinandsearchSettingsBinset this to the resolved binary path; project-local search functions (searchProjectNodeModulesBin,searchYarnPnpBin) leave it unset so lock-file walking handles them.client/tools/BinaryWatcher.ts— new class with two watching strategies:watcherPathset): watches that exact file for creation, change, and deletion — since global installs have no project lock file.watcherPathnot set): walks up from the resolved binary path to the first ancestor directory containing a lock file and watches that directory. This correctly handles pnpm's versioned store layout (.pnpm/pkg@version/node_modules/…) where updating a package creates a brand-new directory instead of modifying the existing binary. Falls back to all workspace folders when no binary is found yet (initial install) or no lock file is found on the walk.client/extension.ts— passes theBinarySearchResultfromfindBinarytoBinaryWatcher..gitignore—package-lock.jsonadded.Testing
Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.