Skip to content

Commit 2b5ebe5

Browse files
authored
refactor: convert client.start() promise chain to async/await (#13)
1 parent 65d638f commit 2b5ebe5

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/extension.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,14 @@ export async function activate(_context: ExtensionContext) {
105105

106106
outputChannel.appendLine("Pony language server client starting…");
107107
// Start the client. This will also launch the server
108-
return client
109-
.start()
110-
.then(() => {
111-
outputChannel.appendLine("Pony language server client ready");
112-
})
113-
.catch((reason) => {
114-
window.showWarningMessage(`Pony language server client failed: ${reason}`);
115-
showPony(false);
116-
client = undefined;
117-
});
108+
try {
109+
await client.start();
110+
outputChannel.appendLine("Pony language server client ready");
111+
} catch (reason) {
112+
window.showWarningMessage(`Pony language server client failed: ${reason}`);
113+
showPony(false);
114+
client = undefined;
115+
}
118116
}
119117

120118
export async function deactivate(): Promise<void> {

0 commit comments

Comments
 (0)