Skip to content

Commit

Permalink
Fix broken installation of TS definition files for Deno.
Browse files Browse the repository at this point in the history
Fix wrong VS Code Extension ID.
Explicitly `await` (and catch) `deno.generateDtsForDeno`, so all definition files are in place, before the extension finishes activation phase.

fixes denoland#74, denoland#66, denoland#62, denoland#48
  • Loading branch information
denisbrodbeck committed Jun 6, 2020
1 parent 87d2c94 commit 43d96a6
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {

import { deno } from "./deno";

const denoExtensionId = "denoland.deno";
const denoExtensionId = "denoland.vscode-deno";
const pluginId = "typescript-deno-plugin";
const configurationSection = "deno";

Expand Down Expand Up @@ -252,10 +252,16 @@ export async function activate(context: vscode.ExtensionContext) {
outputChannel.appendLine("Found deno, version:");
outputChannel.appendLine(deno.versions.raw);
const config = vscode.workspace.getConfiguration();
deno.generateDtsForDeno(
getExtensionPath(denoExtensionId),
config.get("deno.unstable"),
);
try {
await deno.generateDtsForDeno(
getExtensionPath(denoExtensionId),
config.get("deno.unstable"),
);
} catch (error) {
outputChannel.appendLine(
`failed to generate Definition files for Deno: ${error}`,
);
}
}

function showStatusBarItem(show: boolean): void {
Expand Down

0 comments on commit 43d96a6

Please sign in to comment.