How to use the @jupyterlab/docmanager.getOpenPath function in @jupyterlab/docmanager

To help you get started, we’ve selected a few @jupyterlab/docmanager 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 / docmanager-extension / src / index.ts View on Github external
execute: () => {
      return getOpenPath(docManager.services.contents).then(path => {
        if (!path) {
          return;
        }
        docManager.services.contents.get(path, { content: false }).then(
          args => {
            // exists
            return commands.execute(CommandIDs.open, { path: path });
          },
          () => {
            // does not exist
            return showDialog({
              title: 'Cannot open',
              body: 'File not found',
              buttons: [Dialog.okButton()]
            });
          }