Skip to content

Commit 055652f

Browse files
Use async/await in OmniSharpServer._start()
1 parent 22fa49f commit 055652f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/omnisharp/server.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,24 +325,24 @@ export class OmniSharpServer {
325325
this.eventStream.post(new ObservableEvents.OmnisharpInitialisation(new Date(), solutionPath));
326326
this._fireEvent(Events.BeforeServerStart, solutionPath);
327327

328-
return launchOmniSharp(cwd, args, launchInfo).then(async launchResult => {
328+
try {
329+
let launchResult = await launchOmniSharp(cwd, args, launchInfo);
329330
this.eventStream.post(new ObservableEvents.OmnisharpLaunch(launchResult.monoVersion, launchResult.command, launchResult.process.pid));
330331

331332
this._serverProcess = launchResult.process;
332333
this._delayTrackers = {};
333334
this._setState(ServerState.Started);
334335
this._fireEvent(Events.ServerStart, solutionPath);
335336

336-
return this._doConnect();
337-
}).then(() => {
338-
// Start telemetry reporting
337+
await this._doConnect();
338+
339339
this._telemetryIntervalId = setInterval(() => this._reportTelemetry(), TelemetryReportingDelay);
340-
}).then(() => {
341340
this._requestQueue.drain();
342-
}).catch(async err => {
341+
}
342+
catch (err) {
343343
this._fireEvent(Events.ServerError, err);
344344
return this.stop();
345-
});
345+
}
346346
}
347347

348348
private debounceUpdateProjectWithLeadingTrue = () => {

0 commit comments

Comments
 (0)