File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,21 @@ export async function activate(context: vscode.ExtensionContext) {
128128 // Implements the `RooCodeAPI` interface.
129129 const socketPath = process . env . ROO_CODE_IPC_SOCKET_PATH
130130 const enableLogging = typeof socketPath === "string"
131+
132+ // Watch the core files and automatically reload the extension host
133+ const enableCoreAutoReload = process . env ?. NODE_ENV === "development"
134+ if ( enableCoreAutoReload ) {
135+ console . log ( `♻️♻️♻️ Core auto-reloading is ENABLED!` )
136+ const watcher = vscode . workspace . createFileSystemWatcher (
137+ new vscode . RelativePattern ( context . extensionPath , "src/**/*.ts" ) ,
138+ )
139+ watcher . onDidChange ( ( uri ) => {
140+ console . log ( `♻️ File changed: ${ uri . fsPath } . Reloading host…` )
141+ vscode . commands . executeCommand ( "workbench.action.reloadWindow" )
142+ } )
143+ context . subscriptions . push ( watcher )
144+ }
145+
131146 return new API ( outputChannel , provider , socketPath , enableLogging )
132147}
133148
You can’t perform that action at this time.
0 commit comments