Skip to content

Commit 5c3236c

Browse files
committed
async/awaitify
1 parent a91b4cc commit 5c3236c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/omnisharp/utils.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export async function requestWorkspaceInformation(server: OmniSharpServer) {
105105
}
106106

107107
if (blazorWebAssemblyProjectFound && !vscode.extensions.getExtension('ms-dotnettools.blazorwasm-companion')) {
108+
// No need to await this call, we don't depend on the prompt being shown.
108109
showBlazorDebuggingExtensionPrompt(server);
109110
}
110111
}
@@ -248,18 +249,16 @@ function isWebProject(project: MSBuildProject): boolean {
248249
return projectFileText.toLowerCase().indexOf('sdk="microsoft.net.sdk.web"') >= 0;
249250
}
250251

251-
function showBlazorDebuggingExtensionPrompt(server: OmniSharpServer) {
252+
async function showBlazorDebuggingExtensionPrompt(server: OmniSharpServer) {
252253
const promptShownKey = 'blazor_debugging_extension_prompt_shown';
253254
if (!server.sessionProperties[promptShownKey]) {
254255
server.sessionProperties[promptShownKey] = true;
255256

256257
const msg = 'The Blazor WASM Debugging Extension is required to debug Blazor WASM apps in VS Code.';
257-
vscode.window.showInformationMessage(msg, 'Install Extension', 'Close')
258-
.then(async result => {
259-
if (result === 'Install Extension') {
260-
const uriToOpen = vscode.Uri.parse('vscode:extension/ms-dotnettools.blazorwasm-companion');
261-
await vscode.commands.executeCommand('vscode.open', uriToOpen);
262-
}
263-
});
258+
const result = await vscode.window.showInformationMessage(msg, 'Install Extension', 'Close');
259+
if (result === 'Install Extension') {
260+
const uriToOpen = vscode.Uri.parse('vscode:extension/ms-dotnettools.blazorwasm-companion');
261+
await vscode.commands.executeCommand('vscode.open', uriToOpen);
262+
}
264263
}
265264
}

0 commit comments

Comments
 (0)