Browse Source

Refactor command palette plugin to have token and interface defined in implementation instead of in plugin.

Afshin Darian 8 years ago
parent
commit
6da5149d83

+ 1 - 1
examples/lab/index.js

@@ -14,7 +14,7 @@ var lab = new JupyterLab();
 lab.registerPlugins([
   require('jupyterlab/lib/about/plugin').aboutExtension,
   require('jupyterlab/lib/clipboard/plugin').clipboardProvider,
-  require('jupyterlab/lib/commandpalette/plugin').commandPaletteExtension,
+  require('jupyterlab/lib/commandpalette/plugin').commandPaletteProvider,
   require('jupyterlab/lib/console/plugin').consoleExtension,
   require('jupyterlab/lib/docregistry/plugin').docRegistryProvider,
   require('jupyterlab/lib/editorwidget/plugin').editorHandlerExtension,

+ 1 - 1
jupyterlab/index.js

@@ -15,7 +15,7 @@ var lab = new JupyterLab();
 lab.registerPlugins([
   require('jupyterlab/lib/about/plugin').aboutExtension,
   require('jupyterlab/lib/clipboard/plugin').clipboardProvider,
-  require('jupyterlab/lib/commandpalette/plugin').commandPaletteExtension,
+  require('jupyterlab/lib/commandpalette/plugin').commandPaletteProvider,
   require('jupyterlab/lib/console/plugin').consoleExtension,
   require('jupyterlab/lib/csvwidget/plugin').csvHandlerExtension,
   require('jupyterlab/lib/docregistry/plugin').docRegistryProvider,

+ 1 - 1
src/about/plugin.ts

@@ -11,7 +11,7 @@ import {
 
 import {
   ICommandPalette
-} from '../commandpalette/plugin';
+} from '../commandpalette';
 
 import {
   html

+ 24 - 0
src/commandpalette/index.ts

@@ -0,0 +1,24 @@
+/*-----------------------------------------------------------------------------
+| Copyright (c) Jupyter Development Team.
+| Distributed under the terms of the Modified BSD License.
+|----------------------------------------------------------------------------*/
+
+import {
+  Token
+} from 'phosphor/lib/core/token';
+
+import {
+  CommandPalette
+} from 'phosphor/lib/ui/commandpalette';
+
+
+/* tslint:disable */
+/**
+ * The command palette token.
+ */
+export
+const ICommandPalette = new Token<ICommandPalette>('jupyter.services.commandpalette');
+/* tslint:enable */
+
+export
+interface ICommandPalette extends CommandPalette {}

+ 4 - 15
src/commandpalette/plugin.ts

@@ -3,10 +3,6 @@
 | Distributed under the terms of the Modified BSD License.
 |----------------------------------------------------------------------------*/
 
-import {
-  Token
-} from 'phosphor/lib/core/token';
-
 import {
   CommandPalette
 } from 'phosphor/lib/ui/commandpalette';
@@ -15,30 +11,23 @@ import {
   JupyterLab, JupyterLabPlugin
 } from '../application';
 
+import {
+  ICommandPalette
+} from './';
 
-/* tslint:disable */
-/**
- * The command palette token.
- */
-export
-const ICommandPalette = new Token<ICommandPalette>('jupyter.services.commandpalette');
-/* tslint:enable */
 
 
 /**
  * The default commmand palette extension.
  */
 export
-const commandPaletteExtension: JupyterLabPlugin<ICommandPalette> = {
+const commandPaletteProvider: JupyterLabPlugin<ICommandPalette> = {
   id: 'jupyter.services.commandpalette',
   provides: ICommandPalette,
   activate: activateCommandPalette,
   autoStart: true
 };
 
-export
-interface ICommandPalette extends CommandPalette {}
-
 
 /**
  * Activate the command palette.

+ 1 - 1
src/console/plugin.ts

@@ -15,7 +15,7 @@ import {
 
 import {
   ICommandPalette
-} from '../commandpalette/plugin';
+} from '../commandpalette';
 
 import {
   selectKernel

+ 1 - 1
src/editorwidget/plugin.ts

@@ -23,7 +23,7 @@ import {
 
 import {
   ICommandPalette
-} from '../commandpalette/plugin';
+} from '../commandpalette';
 
 import {
   IMainMenu

+ 1 - 1
src/faq/plugin.ts

@@ -17,7 +17,7 @@ import {
 
 import {
   ICommandPalette
-} from '../commandpalette/plugin';
+} from '../commandpalette';
 
 
 /**

+ 1 - 1
src/filebrowser/plugin.ts

@@ -27,7 +27,7 @@ import {
 
 import {
   ICommandPalette
-} from '../commandpalette/plugin';
+} from '../commandpalette';
 
 import {
   IChangedArgs

+ 1 - 1
src/help/plugin.ts

@@ -15,7 +15,7 @@ import {
 
 import {
   ICommandPalette
-} from '../commandpalette/plugin';
+} from '../commandpalette';
 
 import {
   IFrame

+ 1 - 1
src/imagewidget/plugin.ts

@@ -7,7 +7,7 @@ import {
 
 import {
   ICommandPalette
-} from '../commandpalette/plugin';
+} from '../commandpalette';
 
 import {
   IDocumentRegistry

+ 1 - 1
src/landing/plugin.ts

@@ -11,7 +11,7 @@ import {
 
 import {
   ICommandPalette
-} from '../commandpalette/plugin';
+} from '../commandpalette';
 
 import {
   IPathTracker

+ 1 - 1
src/notebook/plugin.ts

@@ -19,7 +19,7 @@ import {
 
 import {
   ICommandPalette
-} from '../commandpalette/plugin';
+} from '../commandpalette';
 
 import {
   IMainMenu

+ 1 - 1
src/terminal/plugin.ts

@@ -11,7 +11,7 @@ import {
 
 import {
   ICommandPalette
-} from '../commandpalette/plugin';
+} from '../commandpalette';
 
 import {
   IMainMenu