Improve discovery/upgrade messages (#12003)

This commit is contained in:
Arvind Ranasaria
2020-08-28 16:53:18 -07:00
committed by GitHub
parent e9b00062a4
commit 48e437c4a5
3 changed files with 31 additions and 19 deletions

View File

@@ -13,11 +13,14 @@ let localAzdata: IAzdataTool | undefined = undefined;
export async function activate(): Promise<azdataExt.IExtension> {
localAzdata = await checkForAzdata();
// Don't block on this since we want the extension to finish activating without needing user input
// upgrade if available and user wants it.
checkAndUpgradeAzdata(localAzdata)
.then(async () => {
localAzdata = await findAzdata(); // now again find and return the currently installed azdata
.then(async upgradePerformed => {
if (upgradePerformed) { // If upgrade was performed then find and save the new azdata
localAzdata = await findAzdata();
}
})
.catch(err => vscode.window.showWarningMessage(loc.updateError(err))); //update if available and user wants it.
.catch(err => vscode.window.showWarningMessage(loc.upgradeError(err)));
return {
azdata: {
arc: {