How to use the @jupyterlab/codeeditor.IEditorMimeTypeService function in @jupyterlab/codeeditor

To help you get started, we’ve selected a few @jupyterlab/codeeditor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vscosta / yap-6.3 / misc / editors / codemirror / mode.js View on Github external
function findBest(mode) {
        var modename = (typeof mode === 'string') ? mode :
            mode.mode || mode.name;
        var mimetype = (typeof mode !== 'string') ? mode.mime : modename;
        var ext = (typeof mode !== 'string') ? mode.ext : [];
        return (CodeMirror.findModeByName(modename || '') ||
            CodeMirror.findModeByMIME(mimetype || '') ||
            findByExtension(ext) ||
            CodeMirror.findModeByMIME(codeeditor_1.IEditorMimeTypeService.defaultMimeType) ||
            CodeMirror.findModeByMIME('text/plain'));
    }
    Mode.findBest = findBest;