Make editor requirejs friendly
parent
ccefbe5aa9
commit
8302cd721a
|
@ -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]);
|
||||
}
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue