From 8a697e0c16a2fd362122c0fda2f0b8d5fa8676b9 Mon Sep 17 00:00:00 2001 From: Dustin Byrne Date: Wed, 16 Oct 2024 16:36:18 -0400 Subject: [PATCH] Rename `onRestart` -> `onBeforeRestart` --- src/services/processWatcher.ts | 8 ++++---- src/services/rpcProcessService.ts | 4 ++-- src/webviews/chatSearchWebview.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/services/processWatcher.ts b/src/services/processWatcher.ts index 393ac885..8905e64d 100644 --- a/src/services/processWatcher.ts +++ b/src/services/processWatcher.ts @@ -76,7 +76,7 @@ export class ProcessWatcher implements vscode.Disposable { protected _onError: vscode.EventEmitter = new vscode.EventEmitter(); protected _onAbort: vscode.EventEmitter = new vscode.EventEmitter(); - protected _onRestart: vscode.EventEmitter = new vscode.EventEmitter(); + protected _onBeforeRestart: vscode.EventEmitter = new vscode.EventEmitter(); protected shouldRun = false; protected hasAborted = false; @@ -103,8 +103,8 @@ export class ProcessWatcher implements vscode.Disposable { } // Fired when the process is restarted. - public get onRestart(): vscode.Event { - return this._onRestart.event; + public get onBeforeRestart(): vscode.Event { + return this._onBeforeRestart.event; } public get id(): ProcessId { @@ -175,7 +175,7 @@ export class ProcessWatcher implements vscode.Disposable { } async restart(): Promise { - this._onRestart.fire(); + this._onBeforeRestart.fire(); await this.stop(); await this.start(); } diff --git a/src/services/rpcProcessService.ts b/src/services/rpcProcessService.ts index d861f8ff..d03165e9 100644 --- a/src/services/rpcProcessService.ts +++ b/src/services/rpcProcessService.ts @@ -82,8 +82,8 @@ export default class RpcProcessService implements Disposable { ); } - get onRestart(): vscode.Event { - return this.processWatcher.onRestart; + get onBeforeRestart(): vscode.Event { + return this.processWatcher.onBeforeRestart; } // Provides some internal state access, primarily for testing purposes. diff --git a/src/webviews/chatSearchWebview.ts b/src/webviews/chatSearchWebview.ts index 9fbe9a7d..a122e3fa 100644 --- a/src/webviews/chatSearchWebview.ts +++ b/src/webviews/chatSearchWebview.ts @@ -178,7 +178,7 @@ export default class ChatSearchWebview { type: 'navie-restarted', }); }), - this.rpcService.onRestart(() => { + this.rpcService.onBeforeRestart(() => { panel.webview.postMessage({ type: 'navie-restarting', });