mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add static logger class for azdata extension (#11939)
* Add static logger class for arc extension * Fix compile errors * Fix test
This commit is contained in:
@@ -4,15 +4,13 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdataExt from 'azdata-ext';
|
||||
import * as vscode from 'vscode';
|
||||
import { findAzdata, IAzdataTool } from './azdata';
|
||||
import * as loc from './localizedConstants';
|
||||
|
||||
let localAzdata: IAzdataTool | undefined = undefined;
|
||||
|
||||
export async function activate(): Promise<azdataExt.IExtension> {
|
||||
const outputChannel = vscode.window.createOutputChannel('azdata');
|
||||
localAzdata = await checkForAzdata(outputChannel);
|
||||
localAzdata = await checkForAzdata();
|
||||
return {
|
||||
azdata: {
|
||||
arc: {
|
||||
@@ -85,24 +83,24 @@ function throwIfNoAzdata(): void {
|
||||
}
|
||||
}
|
||||
|
||||
async function checkForAzdata(outputChannel: vscode.OutputChannel): Promise<IAzdataTool | undefined> {
|
||||
async function checkForAzdata(): Promise<IAzdataTool | undefined> {
|
||||
try {
|
||||
return await findAzdata(outputChannel);
|
||||
return await findAzdata();
|
||||
} catch (err) {
|
||||
// Don't block on this since we want the extension to finish activating without needing user input.
|
||||
// Calls will be made to handle azdata not being installed
|
||||
promptToInstallAzdata(outputChannel).catch(e => console.log(`Unexpected error prompting to install azdata ${e}`));
|
||||
promptToInstallAzdata().catch(e => console.log(`Unexpected error prompting to install azdata ${e}`));
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
async function promptToInstallAzdata(_outputChannel: vscode.OutputChannel): Promise<void> {
|
||||
async function promptToInstallAzdata(): Promise<void> {
|
||||
//TODO: Figure out better way to display/prompt
|
||||
/*
|
||||
const response = await vscode.window.showErrorMessage(loc.couldNotFindAzdataWithPrompt, loc.install, loc.cancel);
|
||||
if (response === loc.install) {
|
||||
try {
|
||||
await downloadAndInstallAzdata(outputChannel);
|
||||
await downloadAndInstallAzdata();
|
||||
vscode.window.showInformationMessage(loc.azdataInstalled);
|
||||
} catch (err) {
|
||||
// Windows: 1602 is User Cancelling installation - not unexpected so don't display
|
||||
|
||||
Reference in New Issue
Block a user