How to use the @jupyterlab/codemirror.Mode.findByName function in @jupyterlab/codemirror

To help you get started, we’ve selected a few @jupyterlab/codemirror 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 jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / codemirror-extension / src / index.ts View on Github external
execute: args => {
      let name = args['name'] as string;
      let widget = tracker.currentWidget;
      if (name && widget) {
        let spec = Mode.findByName(name);
        if (spec) {
          widget.content.model.mimeType = spec.mime;
        }
      }
    },
    isEnabled,
github jupyterlab / jupyterlab / packages / codemirror-extension / src / index.ts View on Github external
execute: args => {
      let name = args['name'] as string;
      let widget = tracker.currentWidget;
      if (name && widget) {
        let spec = Mode.findByName(name);
        if (spec) {
          widget.content.model.mimeType = spec.mime;
        }
      }
    },
    isEnabled,
github yuvipanda / simplest-notebook / packages / codemirror-extension / src / index.ts View on Github external
execute: args => {
        let mode = args['mode'] as string;
        if (mode) {
          let widget = tracker.currentWidget;
          let spec = Mode.findByName(mode);
          if (spec) {
            widget.model.mimeType = spec.mime;
          }
        }
      },
      isEnabled: hasWidget,