Skip to content

Commit

Permalink
feat: Show a message when Navie is starting (and when it can't start)
Browse files Browse the repository at this point in the history
  • Loading branch information
dividedmind authored and dustinbyrne committed Aug 23, 2024
1 parent 7dbff69 commit 9d9aae4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/services/rpcProcessWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,29 @@ export default class RpcProcessWatcher extends ProcessWatcher {
if (portStr) consumeRpcPort(portStr);
}

async start(): Promise<void> {
const disposables: vscode.Disposable[] = [];
try {
await vscode.window.withProgress(
{
location: vscode.ProgressLocation.Window,
cancellable: false,
title: 'Starting Navie…',
},
() =>
new Promise<void>((resolve, reject) => {
disposables.push(this.onRpcPortChange(() => resolve()));
disposables.push(this.onAbort(reject));
super.start();
})
);
} catch (e) {
vscode.window.showErrorMessage(`Navie failed to start: ${e}`);
} finally {
disposables.forEach((d) => d.dispose());
}
}

dispose(): void {
this._onRpcPortChange.dispose();
super.dispose();
Expand Down

0 comments on commit 9d9aae4

Please sign in to comment.