diff --git a/src/vs/code/browser/workbench/workbench.html b/src/vs/code/browser/workbench/workbench.html index 5fead4265ffe69d9f2a121fbc78b637c1e958c3a..d62f3fa77d71e24faf17ec384a51b54767975d8d 100644 --- a/src/vs/code/browser/workbench/workbench.html +++ b/src/vs/code/browser/workbench/workbench.html @@ -37,7 +37,6 @@ - diff --git a/src/vs/workbench/services/textMate/browser/textMateService.ts b/src/vs/workbench/services/textMate/browser/textMateService.ts index 37e0f97252f04e559259c67ff32f09c54782fd1f..8fb8d84099c981bb8c839b14feb211f61dfb40f5 100644 --- a/src/vs/workbench/services/textMate/browser/textMateService.ts +++ b/src/vs/workbench/services/textMate/browser/textMateService.ts @@ -6,8 +6,7 @@ import { ITextMateService } from 'vs/workbench/services/textMate/common/textMateService'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { AbstractTextMateService } from 'vs/workbench/services/textMate/browser/abstractTextMateService'; -import * as vscodeTextmate from 'vscode-textmate'; -import * as onigasm from 'onigasm-umd'; +import { IOnigLib } from 'vscode-textmate'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IFileService } from 'vs/platform/files/common/files'; import { ILogService } from 'vs/platform/log/common/log'; @@ -34,21 +33,25 @@ export class TextMateService extends AbstractTextMateService { return import('vscode-textmate'); } - protected _loadOnigLib(): Promise | undefined { + protected _loadOnigLib(): Promise | undefined { return loadOnigasm(); } } -let onigasmPromise: Promise | null = null; -async function loadOnigasm(): Promise { +let onigasmPromise: Promise | null = null; +async function loadOnigasm(): Promise { if (!onigasmPromise) { onigasmPromise = doLoadOnigasm(); } return onigasmPromise; } -async function doLoadOnigasm(): Promise { - const wasmBytes = await loadOnigasmWASM(); +async function doLoadOnigasm(): Promise { + const [wasmBytes, onigasm] = await Promise.all([ + loadOnigasmWASM(), + import('onigasm-umd') + ]); + await onigasm.loadWASM(wasmBytes); return { createOnigScanner(patterns: string[]) { return new onigasm.OnigScanner(patterns); },