src/language/LanguageManager.js
function _patchCodeMirror() {
        var _original_CodeMirror_defineMode = CodeMirror.defineMode;
        function _wrapped_CodeMirror_defineMode(name) {
            if (CodeMirror.modes[name]) {
                console.error("There already is a CodeMirror mode with the name \"" + name + "\"");
                return;
            }
            _original_CodeMirror_defineMode.apply(CodeMirror, arguments);
        }
        CodeMirror.defineMode = _wrapped_CodeMirror_defineMode;
    }
function _patchCodeMirror() {
        var _original_CodeMirror_defineMode = CodeMirror.defineMode;
        function _wrapped_CodeMirror_defineMode(name) {
            if (CodeMirror.modes[name]) {
                console.error("There already is a CodeMirror mode with the name \"" + name + "\"");
                return;
            }
            _original_CodeMirror_defineMode.apply(CodeMirror, arguments);
        }
        CodeMirror.defineMode = _wrapped_CodeMirror_defineMode;
    }
function _patchCodeMirror ( ) { var _original_CodeMirror_defineMode = CodeMirror . defineMode ; function _wrapped_CodeMirror_defineMode ( name ) { if ( CodeMirror . modes [ name ] ) { console . error ( "There already is a CodeMirror mode with the name \"" + name + "\"" ) ; return ; } _original_CodeMirror_defineMode . apply ( CodeMirror , arguments ) ; } CodeMirror . defineMode = _wrapped_CodeMirror_defineMode ; }
Monkey-patch CodeMirror to prevent modes from being overwritten by extensions.
We may rely on the tokens provided by some of these modes.
Monkey - patch CodeMirror to prevent modes from being overwritten by extensions . We may rely on the tokens provided by some of these modes .