Merge #3072
3072: vscode: removed unnecessary awaits feature r=matklad a=Veetaha Found a feature that when the user has no internet connection the whole extension is blocked by waiting for the user to dismiss the error message and for making a sanity-check dns resolution. Co-authored-by: Veetaha <gerzoh1@gmail.com>
This commit is contained in:
commit
c48c0f370a
@ -100,15 +100,21 @@ export async function ensureLanguageServerBinary(
|
|||||||
try {
|
try {
|
||||||
await downloadLatestLanguageServer(langServerSource);
|
await downloadLatestLanguageServer(langServerSource);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
await vscode.window.showErrorMessage(
|
vscode.window.showErrorMessage(
|
||||||
`Failed to download language server from ${langServerSource.repo.name} ` +
|
`Failed to download language server from ${langServerSource.repo.name} ` +
|
||||||
`GitHub repository: ${err.message}`
|
`GitHub repository: ${err.message}`
|
||||||
);
|
);
|
||||||
|
|
||||||
await dns.resolve('www.google.com').catch(err => {
|
dns.resolve('example.com').then(
|
||||||
console.error("DNS resolution failed, there might be an issue with Internet availability");
|
addrs => console.log("DNS resolution for example.com was successful", addrs),
|
||||||
|
err => {
|
||||||
|
console.error(
|
||||||
|
"DNS resolution for example.com failed, " +
|
||||||
|
"there might be an issue with Internet availability"
|
||||||
|
);
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user