diff --git a/src/contents.ts b/src/contents.ts index 08f864a..8aa0640 100644 --- a/src/contents.ts +++ b/src/contents.ts @@ -302,7 +302,7 @@ export class Drive implements Contents.IDrive { mimetype: '', size: undefined, writable: true, - type: 'directory' + type: 'drive' }); } } catch (err) { diff --git a/src/plugins/driveBrowserPlugin.ts b/src/plugins/driveBrowserPlugin.ts index 2d3fe78..deb727d 100644 --- a/src/plugins/driveBrowserPlugin.ts +++ b/src/plugins/driveBrowserPlugin.ts @@ -162,7 +162,7 @@ export const driveFileBrowser: JupyterFrontEndPlugin = { console.log( 'JupyterLab extension jupyter-drives:drives-file-browser is activated!' ); - const { commands } = app; + const { commands, docRegistry } = app; // create drive for drive file browser const drive = new Drive({ @@ -196,6 +196,18 @@ export const driveFileBrowser: JupyterFrontEndPlugin = { restorer.add(driveBrowser, 'drive-file-browser'); } + // Registering the custom directory file type + docRegistry.addFileType({ + name: 'drive', + displayName: 'Drive', + contentType: 'directory', + fileFormat: 'json', + mimeTypes: ['text/directory'], + extensions: [], + icon: driveBrowserIcon, + pattern: '^' + }); + // Register status bar widget if (statusBar) { const driveStatusWidget = new DriveStatusWidget();