Make editor requirejs friendly

pull/60354/head
Alex Dima 2016-05-26 19:23:30 +02:00
parent ccefbe5aa9
commit 8302cd721a
3 changed files with 10 additions and 6 deletions

View File

@ -64,13 +64,13 @@ Monaco.Editor.ContentWidgetPositionPreference = ContentWidgetPositionPreference;
Monaco.Editor.OverlayWidgetPositionPreference = OverlayWidgetPositionPreference;
// Register all built-in standalone languages
let MonacoEditorLanguages: ILanguageDef[] = this.MonacoEditorLanguages || [];
let MonacoEditorLanguages: ILanguageDef[] = global.MonacoEditorLanguages || [];
MonacoEditorLanguages.forEach((language) => {
standaloneCodeEditor.registerStandaloneLanguage(language, language.defModule);
});
// Register all built-in standalone JSON schemas
let MonacoEditorSchemas: { [url:string]: IJSONSchema } = this.MonacoEditorSchemas || {};
let MonacoEditorSchemas: { [url:string]: IJSONSchema } = global.MonacoEditorSchemas || {};
for (var uri in MonacoEditorSchemas) {
standaloneCodeEditor.registerStandaloneSchema(uri, MonacoEditorSchemas[uri]);
}

View File

@ -8,8 +8,10 @@
import * as nls from 'vs/nls';
import {IJSONSchema} from 'vs/base/common/jsonSchema';
this.MonacoEditorSchemas = this.MonacoEditorSchemas || {};
let MonacoEditorSchemas: { [uri:string]:IJSONSchema } = this.MonacoEditorSchemas;
var global:any = self;
global.MonacoEditorSchemas = global.MonacoEditorSchemas || {};
let MonacoEditorSchemas: { [uri:string]:IJSONSchema } = global.MonacoEditorSchemas;
MonacoEditorSchemas['http://json.schemastore.org/project'] = {
'title': nls.localize('project.json.title', 'JSON schema for ASP.NET project.json files'),

View File

@ -7,8 +7,10 @@
import {ILanguageDef} from './types';
this.MonacoEditorLanguages = this.MonacoEditorLanguages || [];
let MonacoEditorLanguages: ILanguageDef[] = this.MonacoEditorLanguages;
var global:any = self;
global.MonacoEditorLanguages = global.MonacoEditorLanguages || [];
let MonacoEditorLanguages: ILanguageDef[] = global.MonacoEditorLanguages;
MonacoEditorLanguages.push({
id: 'bat',