Use the global monaco only in the AMD case (see microsoft/monaco-editor#1974)

This commit is contained in:
Alex Dima 2020-09-08 13:40:42 +02:00
parent 1af07d9cdb
commit d7cc098c48
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
80 changed files with 347 additions and 387 deletions

View file

@ -3,14 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration;
import ILanguage = monaco.languages.IMonarchLanguage;
import { languages } from '../fillers/monaco-editor-core';
// Allow for running under nodejs/requirejs in tests
const _monaco: typeof monaco =
typeof monaco === 'undefined' ? (<any>self).monaco : monaco;
export const conf: IRichLanguageConfiguration = {
export const conf: languages.LanguageConfiguration = {
comments: {
lineComment: '#',
blockComment: ["'''", "'''"]
@ -39,7 +34,7 @@ export const conf: IRichLanguageConfiguration = {
beforeText: new RegExp(
'^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\\s*$'
),
action: { indentAction: _monaco.languages.IndentAction.Indent }
action: { indentAction: languages.IndentAction.Indent }
}
],
folding: {
@ -51,7 +46,7 @@ export const conf: IRichLanguageConfiguration = {
}
};
export const language = <ILanguage>{
export const language = <languages.IMonarchLanguage>{
defaultToken: '',
tokenPostfix: '.python',