From d9548446ff989b3846b059f2e2756f92da8da3b1 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 19 Apr 2017 10:40:39 -0700 Subject: [PATCH] Fix td extension. --- editor/extension.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/editor/extension.ts b/editor/extension.ts index aa508dc0..8656e7d4 100644 --- a/editor/extension.ts +++ b/editor/extension.ts @@ -13,15 +13,16 @@ namespace pxt.editor { }, name: data.meta.name }) }, { - id: "td", - canImport: data => data.meta.cloudId == "microbit.co.uk" && data.meta.editor == "touchdevelop", - importAsync: (project, data) => - project.createProjectAsync({ - filesOverride: { "main.blocks": "", "main.ts": " " }, - name: data.meta.name - }).then(() => project.convertTouchDevelopToTypeScriptAsync(data.source)) - .then(text => this.textEditor.overrideFile(text)) - }] + id: "td", + canImport: data => data.meta.cloudId == "microbit.co.uk" && data.meta.editor == "touchdevelop", + importAsync: (project, data) => + project.createProjectAsync({ + filesOverride: { "main.blocks": "", "main.ts": " " }, + name: data.meta.name + }) + .then(() => project.convertTouchDevelopToTypeScriptAsync(data.source)) + .then(text => project.overrideTypescriptFile(text)) + }] }; return Promise.resolve(res); }