Skip to content

Commit

Permalink
Rename onRestart -> onBeforeRestart
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinbyrne committed Oct 17, 2024
1 parent ced7c9a commit 8a697e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/services/processWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ProcessWatcher implements vscode.Disposable {

protected _onError: vscode.EventEmitter<Error> = new vscode.EventEmitter<Error>();
protected _onAbort: vscode.EventEmitter<Error> = new vscode.EventEmitter<Error>();
protected _onRestart: vscode.EventEmitter<void> = new vscode.EventEmitter<void>();
protected _onBeforeRestart: vscode.EventEmitter<void> = new vscode.EventEmitter<void>();

protected shouldRun = false;
protected hasAborted = false;
Expand All @@ -103,8 +103,8 @@ export class ProcessWatcher implements vscode.Disposable {
}

// Fired when the process is restarted.
public get onRestart(): vscode.Event<void> {
return this._onRestart.event;
public get onBeforeRestart(): vscode.Event<void> {
return this._onBeforeRestart.event;
}

public get id(): ProcessId {
Expand Down Expand Up @@ -175,7 +175,7 @@ export class ProcessWatcher implements vscode.Disposable {
}

async restart(): Promise<void> {
this._onRestart.fire();
this._onBeforeRestart.fire();
await this.stop();
await this.start();
}
Expand Down
4 changes: 2 additions & 2 deletions src/services/rpcProcessService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export default class RpcProcessService implements Disposable {
);
}

get onRestart(): vscode.Event<void> {
return this.processWatcher.onRestart;
get onBeforeRestart(): vscode.Event<void> {
return this.processWatcher.onBeforeRestart;
}

// Provides some internal state access, primarily for testing purposes.
Expand Down
2 changes: 1 addition & 1 deletion src/webviews/chatSearchWebview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default class ChatSearchWebview {
type: 'navie-restarted',
});
}),
this.rpcService.onRestart(() => {
this.rpcService.onBeforeRestart(() => {
panel.webview.postMessage({
type: 'navie-restarting',
});
Expand Down

0 comments on commit 8a697e0

Please sign in to comment.