Forráskód Böngészése

Update the fileeditor extension

Steven Silvester 8 éve
szülő
commit
5a6eaacb71
1 módosított fájl, 11 hozzáadás és 3 törlés
  1. 11 3
      packages/fileeditor-extension/src/index.ts

+ 11 - 3
packages/fileeditor-extension/src/index.ts

@@ -250,9 +250,17 @@ function activate(app: JupyterLab, registry: IDocumentRegistry, restorer: ILayou
   // Add a launcher item if the launcher is available.
   if (launcher) {
     launcher.add({
-      args: { creatorName: 'Text File' },
-      command: 'file-operations:create-from',
-      name: 'Text Editor'
+      displayName: 'Text Editor',
+      iconClass: EDITOR_ICON_CLASS,
+      callback: cwd => {
+        return commands.execute('file-operations:new-untitled', {
+          path: cwd, type: 'file'
+        }).then(model => {
+          return commands.execute('file-operations:open', {
+            path: model.path, factory: FACTORY
+          });
+        });
+      }
     });
   }