diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index eef69c410e2..a2366ec1720 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -93,7 +93,7 @@ gulp.task('clean-minified-editor', util.rimraf('out-editor-min')); gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor')); gulp.task('clean-editor-esm', util.rimraf('out-editor-esm')); -gulp.task('extract-editor-esm', ['clean-editor-esm'], function() { +gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro'], function() { standalone.createESMSourcesAndResources({ entryPoints: [ 'vs/editor/editor.main', diff --git a/build/lib/standalone.js b/build/lib/standalone.js index d0cb2c8c0c3..12511b01d36 100644 --- a/build/lib/standalone.js +++ b/build/lib/standalone.js @@ -112,15 +112,6 @@ function createESMSourcesAndResources(options) { } var fileContents = fs.readFileSync(filename).toString(); var info = ts.preProcessFile(fileContents); - if (info.isLibFile) { - console.log("1. oh no, what does this mean!!!"); - } - if (info.typeReferenceDirectives.length > 0) { - console.log("2. oh no, what does this mean!!!"); - } - if (info.referencedFiles.length > 0) { - console.log("3. oh no, what does this mean!!!"); - } for (var i = info.importedFiles.length - 1; i >= 0; i--) { var importedFilename = info.importedFiles[i].fileName; var pos = info.importedFiles[i].pos; diff --git a/build/lib/standalone.ts b/build/lib/standalone.ts index 256c3091752..a402cf68405 100644 --- a/build/lib/standalone.ts +++ b/build/lib/standalone.ts @@ -130,15 +130,6 @@ export function createESMSourcesAndResources(options: IOptions): void { let fileContents = fs.readFileSync(filename).toString(); const info = ts.preProcessFile(fileContents); - if (info.isLibFile) { - console.log(`1. oh no, what does this mean!!!`); - } - if (info.typeReferenceDirectives.length > 0) { - console.log(`2. oh no, what does this mean!!!`); - } - if (info.referencedFiles.length > 0) { - console.log(`3. oh no, what does this mean!!!`); - } for (let i = info.importedFiles.length - 1; i >= 0; i--) { const importedFilename = info.importedFiles[i].fileName; diff --git a/build/monaco/LICENSE b/build/monaco/LICENSE index 9f66f02b0e0..76fdc58a0d7 100644 --- a/build/monaco/LICENSE +++ b/build/monaco/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Microsoft Corporation +Copyright (c) 2016 - present Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/build/monaco/package.json b/build/monaco/package.json index 40cd4f1e272..baf01394f7b 100644 --- a/build/monaco/package.json +++ b/build/monaco/package.json @@ -1,10 +1,11 @@ { "name": "monaco-editor-core", "private": true, - "version": "0.9.0", + "version": "0.11.0", "description": "A browser based code editor", "author": "Microsoft Corporation", "license": "MIT", + "module": "./esm/vs/editor/editor.main.js", "repository": { "type": "git", "url": "https://github.com/Microsoft/vscode" diff --git a/src/vs/editor/common/services/editorSimpleWorker.ts b/src/vs/editor/common/services/editorSimpleWorker.ts index 846a4fbf567..574001a8601 100644 --- a/src/vs/editor/common/services/editorSimpleWorker.ts +++ b/src/vs/editor/common/services/editorSimpleWorker.ts @@ -288,14 +288,23 @@ class MirrorModel extends BaseMirrorModel implements ICommonModel { } } +/** + * @internal + */ +export interface IForeignModuleFactory { + (ctx: IWorkerContext, createData: any): any; +} + /** * @internal */ export abstract class BaseEditorSimpleWorker { + private _foreignModuleFactory: IForeignModuleFactory; private _foreignModule: any; - constructor(foreignModule: any) { - this._foreignModule = foreignModule; + constructor(foreignModuleFactory: IForeignModuleFactory) { + this._foreignModuleFactory = foreignModuleFactory; + this._foreignModule = null; } protected abstract _getModel(uri: string): ICommonModel; @@ -474,7 +483,14 @@ export abstract class BaseEditorSimpleWorker { // ---- BEGIN foreign module support -------------------------------------------------------------------------- public loadForeignModule(moduleId: string, createData: any): TPromise { - if (this._foreignModule) { + let ctx: IWorkerContext = { + getMirrorModels: (): IMirrorModel[] => { + return this._getModels(); + } + }; + + if (this._foreignModuleFactory) { + this._foreignModule = this._foreignModuleFactory(ctx, createData); // static foreing module let methods: string[] = []; for (let prop in this._foreignModule) { @@ -486,12 +502,7 @@ export abstract class BaseEditorSimpleWorker { } return new TPromise((c, e) => { // Use the global require to be sure to get the global config - (self).require([moduleId], (foreignModule: { create: (ctx: IWorkerContext, createData: any) => any; }) => { - let ctx: IWorkerContext = { - getMirrorModels: (): IMirrorModel[] => { - return this._getModels(); - } - }; + (self).require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { this._foreignModule = foreignModule.create(ctx, createData); let methods: string[] = []; @@ -531,8 +542,8 @@ export class EditorSimpleWorkerImpl extends BaseEditorSimpleWorker implements IR private _models: { [uri: string]: MirrorModel; }; - constructor(foreignModule: any) { - super(foreignModule); + constructor(foreignModuleFactory: IForeignModuleFactory) { + super(foreignModuleFactory); this._models = Object.create(null); }