mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Auto-reload core changes in dev mode (#3284)
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
This commit is contained in:
parent
42832629a9
commit
8614405144
1 changed files with 15 additions and 0 deletions
|
|
@ -128,6 +128,21 @@ export async function activate(context: vscode.ExtensionContext) {
|
|||
// Implements the `RooCodeAPI` interface.
|
||||
const socketPath = process.env.ROO_CODE_IPC_SOCKET_PATH
|
||||
const enableLogging = typeof socketPath === "string"
|
||||
|
||||
// Watch the core files and automatically reload the extension host
|
||||
const enableCoreAutoReload = process.env?.NODE_ENV === "development"
|
||||
if (enableCoreAutoReload) {
|
||||
console.log(`♻️♻️♻️ Core auto-reloading is ENABLED!`)
|
||||
const watcher = vscode.workspace.createFileSystemWatcher(
|
||||
new vscode.RelativePattern(context.extensionPath, "src/**/*.ts"),
|
||||
)
|
||||
watcher.onDidChange((uri) => {
|
||||
console.log(`♻️ File changed: ${uri.fsPath}. Reloading host…`)
|
||||
vscode.commands.executeCommand("workbench.action.reloadWindow")
|
||||
})
|
||||
context.subscriptions.push(watcher)
|
||||
}
|
||||
|
||||
return new API(outputChannel, provider, socketPath, enableLogging)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue