Skip to content

Conversation

@hassoncs
Copy link
Contributor

@hassoncs hassoncs commented May 7, 2025

Until now, it was necessary to halt the debugging process, terminate all tasks, and restart the extension host to see core changes. Now, with this change, we now monitor the files within the core directory. If any changes are detected, we trigger a reload command within the extension, effectively enabling hot reloading within the extension

Dev notes

  • I was originally going to make this a new env var something like ENABLE_CORE_AUTO_RESTART, but instead just based it on the NODE_ENV. Let me know if you think the env var would be better! (or something else!)
  • implement file system watcher for core files
  • automatically reload extension host on changes
  • enhance development experience by eliminating manual restarts

📝 docs(DEVELOPMENT.md): update hot reloading instructions

  • clarify auto-reload behavior for core extension changes
  • specify development mode requirements for auto-reloading

@hassoncs hassoncs force-pushed the auto-restart-ext-host-watcher branch from 81a0f8d to 1be2eb0 Compare May 7, 2025 20:42
@changeset-bot
Copy link

changeset-bot bot commented May 7, 2025

⚠️ No Changeset found

Latest commit: cff7fd7bff4937e9613beabec7457ce6f3bafce8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hassoncs hassoncs force-pushed the auto-restart-ext-host-watcher branch from 1be2eb0 to cff7fd7 Compare May 7, 2025 20:45
@hassoncs hassoncs marked this pull request as ready for review May 7, 2025 20:46
Copy link
Contributor

@janpaul123 janpaul123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me! Maybe make a PR to Roo as well?

- implement file system watcher for core files
- automatically reload extension host on changes
- enhance development experience by eliminating manual restarts

📝 docs(DEVELOPMENT.md): update hot reloading instructions

- clarify auto-reload behavior for core extension changes
- specify development mode requirements for auto-reloading
@hassoncs hassoncs force-pushed the auto-restart-ext-host-watcher branch from cff7fd7 to d170fc8 Compare May 7, 2025 21:03
Copy link
Collaborator

@kevinvandijk kevinvandijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Can we also provide this to Roo Code?

@janpaul123
Copy link
Contributor

Haha jinx @kevinvandijk

@hassoncs
Copy link
Contributor Author

hassoncs commented May 7, 2025

Opened a PR on Roo here: RooCodeInc/Roo-Code#3284

@hassoncs hassoncs merged commit 8649438 into main May 7, 2025
9 checks passed
@hassoncs hassoncs deleted the auto-restart-ext-host-watcher branch May 7, 2025 21:22
if (enableCoreAutoReload) {
console.log(`♻️♻️♻️ Core auto-reloading is ENABLED!`)
const watcher = vscode.workspace.createFileSystemWatcher(
new vscode.RelativePattern(context.extensionPath, "src/**/*.ts"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if we change.a different file; e.g. one of the translation .json files?

@HadesArchitect
Copy link
Contributor

I love it. @hassoncs Thanks for updating the docs!!! ❤️

@HadesArchitect
Copy link
Contributor

HadesArchitect commented May 8, 2025

Is there a chance we will want to have it more flexible? Like, keep the DEV environment but disable auto-reload? Just asking.

@janpaul123
Copy link
Contributor

Is there a chance we will want to have it more flexible? Like, keep the DEV environment but disable auto-reload? Just asking.

I'd wait for someone tell us about an actual use case for that. As a workaround this is easy to find and comment out (bc of the console logs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants