Skip to content

Commit bb0b76c

Browse files
committed
Fix O# integration tests by not blocking activation on server start
1 parent 59f1303 commit bb0b76c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/omnisharp/omnisharpLanguageServer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ async function activate(
310310
);
311311

312312
if (omnisharpOptions.autoStart) {
313-
await server.autoStart(context.workspaceState.get<string>('lastSolutionPathOrFolder', ''));
313+
// We intentionally do not await this as we don't want to block activation on the server starting.
314+
server.autoStart(context.workspaceState.get<string>('lastSolutionPathOrFolder', '')).catch((err) => {
315+
throw err;
316+
});
314317
}
315318

316319
// stop server on deactivate

test/omnisharp/omnisharpIntegrationTests/integrationHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export async function restartOmniSharpServer(): Promise<void> {
5757
resolve();
5858
}
5959
});
60+
vscode.commands.executeCommand('o.restart');
6061
});
61-
await vscode.commands.executeCommand('o.restart');
6262
console.log('OmniSharp restarted');
6363
} catch (err) {
6464
console.log(JSON.stringify(err));

0 commit comments

Comments
 (0)