Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
don't directly activate .NET Interactive (#39)
Browse files Browse the repository at this point in the history
* don't directly activate .NET Interactive

* update version
  • Loading branch information
brettfo authored Feb 3, 2022
1 parent 1cc8194 commit 8cb5818
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 41 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vscode-dotnet-pack",
"version": "1.0.6",
"version": "1.0.7",
"preview": true,
"publisher": "ms-dotnettools",
"author": "Microsoft Corporation",
Expand Down
40 changes: 0 additions & 40 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ async function initializeExtension(_operationId: string, context: vscode.Extensi
initUtils(context);
initCommands(context);
initExp(context);
initializeDependencies();

const config = vscode.workspace.getConfiguration("dotnet.help");

Expand All @@ -56,44 +55,6 @@ async function initializeExtension(_operationId: string, context: vscode.Extensi
}
}

async function initializeDependencies() {
// Acquire status for .NET SDK
// TODO: Once we have an automated pipeline to have the latest SDK bundled with the education pack installer, we can change the below command to "dotnet-sdk.acquire", to get the latest SDK update.
let sdkResult = await initializeDependency("ms-dotnettools.vscode-dotnet-sdk", "dotnet-sdk.acquireStatus", { version: dotnetSdkVersion, requestingExtensionId: 'ms-dotnettools.vscode-dotnet-pack' });
if (!sdkResult?.dotnetPath) {
const acquirePromise = initializeDependency("ms-dotnettools.vscode-dotnet-sdk", "dotnet-sdk.acquire", { version: dotnetSdkVersion, requestingExtensionId: 'ms-dotnettools.vscode-dotnet-pack' });
sdkResult = await vscode.window.withProgress(
{ location: vscode.ProgressLocation.Notification, title: 'Acquiring latest .NET SDK...' },
(_progress, _token) => acquirePromise
);
}

// Acquire .NET Interactive
initializeDependency("ms-dotnettools.dotnet-interactive-vscode", "dotnet-interactive.acquire", sdkResult?.dotnetPath);
}

async function initializeDependency(extensionName: string, command: string, commandArgs?: any): Promise<any> {
const extension = vscode.extensions.getExtension(extensionName);
if (extension === undefined) {
return Promise.resolve();
}

// is the ext loaded and ready?
if (!extension.isActive) {
return extension.activate().then(
function () {
console.log("Extension activated");
return vscode.commands.executeCommand(command, commandArgs);
},
function () {
console.log("Extension activation failed");
}
);
} else {
return vscode.commands.executeCommand(command, commandArgs);
}
}

async function presentFirstView(context: vscode.ExtensionContext) {
const config = vscode.workspace.getConfiguration("dotnet.help");
const firstView = config.get("firstView");
Expand All @@ -111,7 +72,6 @@ async function showGettingStartedView(context: vscode.ExtensionContext, _isForce
}

await vscode.commands.executeCommand("dotnet.gettingStarted");
await initializeDependencies();
context.globalState.update(isDotnetGettingStartedPresented, true);
}

Expand Down

0 comments on commit 8cb5818

Please sign in to comment.