소스 검색

Apply lint again

Steven Silvester 4 년 전
부모
커밋
78da974e1d
100개의 변경된 파일1797개의 추가작업 그리고 1797개의 파일을 삭제
  1. 9 9
      buildutils/src/ensure-package.ts
  2. 6 6
      buildutils/src/utils.ts
  3. 16 16
      packages/application-extension/src/index.tsx
  4. 1 1
      packages/application/src/lab.ts
  5. 4 4
      packages/application/src/layoutrestorer.ts
  6. 2 2
      packages/application/src/mimerenderers.ts
  7. 54 54
      packages/application/src/shell.ts
  8. 2 2
      packages/apputils-extension/src/settingconnector.ts
  9. 1 1
      packages/apputils/src/clipboard.ts
  10. 5 5
      packages/apputils/src/collapse.ts
  11. 5 5
      packages/apputils/src/commandlinker.ts
  12. 34 34
      packages/apputils/src/dialog.ts
  13. 1 1
      packages/apputils/src/domutils.ts
  14. 4 4
      packages/apputils/src/hoverbox.ts
  15. 39 39
      packages/apputils/src/sessioncontext.tsx
  16. 5 5
      packages/apputils/src/toolbar.tsx
  17. 2 2
      packages/apputils/src/vdom.ts
  18. 1 1
      packages/apputils/src/widgettracker.ts
  19. 65 65
      packages/cells/src/widget.ts
  20. 14 14
      packages/celltags/src/addwidget.ts
  21. 11 11
      packages/celltags/src/widget.ts
  22. 8 8
      packages/codeeditor/src/jsoneditor.ts
  23. 14 14
      packages/codeeditor/src/widget.ts
  24. 1 1
      packages/codemirror-extension/src/index.ts
  25. 96 96
      packages/codemirror/src/editor.ts
  26. 3 3
      packages/completer/src/connector.ts
  27. 3 3
      packages/completer/src/contextconnector.ts
  28. 14 14
      packages/completer/src/handler.ts
  29. 3 3
      packages/completer/src/kernelconnector.ts
  30. 3 3
      packages/completer/src/tokens.ts
  31. 49 49
      packages/completer/src/widget.ts
  32. 2 2
      packages/console-extension/src/foreign.ts
  33. 32 32
      packages/console/src/foreign.ts
  34. 1 1
      packages/console/src/panel.ts
  35. 14 14
      packages/console/src/widget.ts
  36. 4 4
      packages/coreutils/src/activitymonitor.ts
  37. 22 22
      packages/csvviewer/src/model.ts
  38. 173 173
      packages/csvviewer/src/parse.ts
  39. 5 5
      packages/csvviewer/src/toolbar.ts
  40. 4 4
      packages/csvviewer/src/widget.ts
  41. 1 1
      packages/docmanager-extension/src/index.ts
  42. 2 2
      packages/docmanager/src/manager.ts
  43. 19 19
      packages/docmanager/src/widgetmanager.ts
  44. 1 1
      packages/docregistry/src/context.ts
  45. 2 2
      packages/docregistry/src/default.ts
  46. 22 22
      packages/docregistry/src/registry.ts
  47. 1 1
      packages/documentsearch/src/providers/codemirrorsearchprovider.ts
  48. 9 9
      packages/documentsearch/src/searchoverlay.tsx
  49. 2 2
      packages/documentsearch/src/searchproviderregistry.ts
  50. 2 2
      packages/extensionmanager/src/model.ts
  51. 47 47
      packages/extensionmanager/src/widget.tsx
  52. 4 4
      packages/filebrowser-extension/src/index.ts
  53. 17 17
      packages/filebrowser/src/crumbs.ts
  54. 104 104
      packages/filebrowser/src/listing.ts
  55. 2 2
      packages/filebrowser/src/model.ts
  56. 7 7
      packages/filebrowser/src/opendialog.ts
  57. 3 3
      packages/fileeditor-extension/src/commands.ts
  58. 8 8
      packages/fileeditor/src/widget.ts
  59. 2 2
      packages/help-extension/src/index.tsx
  60. 2 2
      packages/htmlviewer/src/index.tsx
  61. 1 1
      packages/imageviewer/src/widget.ts
  62. 3 3
      packages/inspector/src/handler.ts
  63. 3 3
      packages/inspector/src/kernelconnector.ts
  64. 1 1
      packages/launcher-extension/src/index.ts
  65. 2 2
      packages/launcher/src/index.tsx
  66. 8 8
      packages/logconsole-extension/src/index.tsx
  67. 21 21
      packages/logconsole/src/logger.ts
  68. 4 4
      packages/logconsole/src/tokens.ts
  69. 4 4
      packages/logconsole/src/widget.ts
  70. 24 24
      packages/markdownviewer/src/widget.ts
  71. 13 13
      packages/notebook-extension/src/index.ts
  72. 104 104
      packages/notebook/src/actions.tsx
  73. 9 9
      packages/notebook/src/celllist.ts
  74. 32 32
      packages/notebook/src/model.ts
  75. 1 1
      packages/notebook/src/modelfactory.ts
  76. 24 24
      packages/notebook/src/notebooktools.ts
  77. 1 1
      packages/notebook/src/truststatus.tsx
  78. 147 147
      packages/notebook/src/widget.ts
  79. 2 2
      packages/notebook/src/widgetfactory.ts
  80. 1 1
      packages/observables/src/observablejson.ts
  81. 45 45
      packages/observables/src/undoablelist.ts
  82. 64 64
      packages/outputarea/src/widget.ts
  83. 20 20
      packages/property-inspector/src/index.ts
  84. 11 11
      packages/rendermime-extension/src/index.ts
  85. 2 2
      packages/rendermime-interfaces/src/index.ts
  86. 4 4
      packages/rendermime/src/attachmentmodel.ts
  87. 13 13
      packages/rendermime/src/outputmodel.ts
  88. 87 87
      packages/rendermime/src/renderers.ts
  89. 69 69
      packages/services/src/kernel/default.ts
  90. 17 17
      packages/services/src/kernel/future.ts
  91. 8 8
      packages/services/src/kernel/kernel.ts
  92. 2 2
      packages/services/src/kernel/manager.ts
  93. 6 6
      packages/services/src/session/default.ts
  94. 4 4
      packages/services/src/session/manager.ts
  95. 15 15
      packages/services/src/session/session.ts
  96. 2 2
      packages/services/src/setting/index.ts
  97. 2 2
      packages/services/src/terminal/default.ts
  98. 16 16
      packages/services/src/validate.ts
  99. 11 11
      packages/settingeditor/src/inspector.ts
  100. 5 5
      packages/settingeditor/src/pluginlist.tsx

+ 9 - 9
buildutils/src/ensure-package.ts

@@ -274,8 +274,8 @@ export async function ensurePackage(
   const published = new Set<string>(
     data.files
       ? data.files.reduce((acc: string[], curr: string) => {
-        return acc.concat(glob.sync(path.join(pkgPath, curr)));
-      }, [])
+          return acc.concat(glob.sync(path.join(pkgPath, curr)));
+        }, [])
       : []
   );
 
@@ -570,13 +570,13 @@ function getImports(sourceFile: ts.SourceFile): string[] {
 
   function handleNode(node: any): void {
     switch (node.kind) {
-    case ts.SyntaxKind.ImportDeclaration:
-      imports.push(node.moduleSpecifier.text);
-      break;
-    case ts.SyntaxKind.ImportEqualsDeclaration:
-      imports.push(node.moduleReference.expression.text);
-      break;
-    default:
+      case ts.SyntaxKind.ImportDeclaration:
+        imports.push(node.moduleSpecifier.text);
+        break;
+      case ts.SyntaxKind.ImportEqualsDeclaration:
+        imports.push(node.moduleReference.expression.text);
+        break;
+      default:
       // no-op
     }
     ts.forEachChild(node, handleNode);

+ 6 - 6
buildutils/src/utils.ts

@@ -92,12 +92,12 @@ export function writeJSONFile(filePath: string, data: any): boolean {
       ? Array.isArray(value)
         ? value.map(sortObjByKey)
         : Object.keys(value)
-          .sort()
-          .reduce((o: any, key) => {
-            const v = value[key];
-            o[key] = sortObjByKey(v);
-            return o;
-          }, {})
+            .sort()
+            .reduce((o: any, key) => {
+              const v = value[key];
+              o[key] = sortObjByKey(v);
+              return o;
+            }, {})
       : value;
   }
   const text = JSON.stringify(data, sortObjByKey(data), 2) + '\n';

+ 16 - 16
packages/application-extension/src/index.tsx

@@ -522,22 +522,22 @@ function addCommands(app: JupyterLab, palette: ICommandPalette | null): void {
     widget: Widget
   ): DockLayout.ITabAreaConfig | null => {
     switch (area.type) {
-    case 'split-area':
-      const iterator = iter(area.children);
-      let tab: DockLayout.ITabAreaConfig | null = null;
-      let value: DockLayout.AreaConfig | undefined;
-      do {
-        value = iterator.next();
-        if (value) {
-          tab = findTab(value, widget);
-        }
-      } while (!tab && value);
-      return tab;
-    case 'tab-area':
-      const { id } = widget;
-      return area.widgets.some(widget => widget.id === id) ? area : null;
-    default:
-      return null;
+      case 'split-area':
+        const iterator = iter(area.children);
+        let tab: DockLayout.ITabAreaConfig | null = null;
+        let value: DockLayout.AreaConfig | undefined;
+        do {
+          value = iterator.next();
+          if (value) {
+            tab = findTab(value, widget);
+          }
+        } while (!tab && value);
+        return tab;
+      case 'tab-area':
+        const { id } = widget;
+        return area.widgets.some(widget => widget.id === id) ? area : null;
+      default:
+        return null;
     }
   };
 

+ 1 - 1
packages/application/src/lab.ts

@@ -177,7 +177,7 @@ export namespace JupyterLab {
    */
   export interface IOptions
     extends JupyterFrontEnd.IOptions<LabShell>,
-    Partial<IInfo> {
+      Partial<IInfo> {
     paths?: Partial<JupyterFrontEnd.IPaths>;
   }
 

+ 4 - 4
packages/application/src/layoutrestorer.ts

@@ -366,10 +366,10 @@ export class LayoutRestorer implements ILayoutRestorer {
     const widgets = !Array.isArray(area.widgets)
       ? null
       : area.widgets
-        .map(name =>
-          internal.has(`${name}`) ? internal.get(`${name}`) : null
-        )
-        .filter(widget => !!widget);
+          .map(name =>
+            internal.has(`${name}`) ? internal.get(`${name}`) : null
+          )
+          .filter(widget => !!widget);
     return {
       collapsed,
       currentWidget: currentWidget!,

+ 2 - 2
packages/application/src/mimerenderers.ts

@@ -174,8 +174,8 @@ namespace Private {
    * that was used to create a mimedocument.
    */
   export const factoryNameProperty = new AttachedProperty<
-  MimeDocument,
-  string | undefined
+    MimeDocument,
+    string | undefined
   >({
     name: 'factoryName',
     create: () => undefined

+ 54 - 54
packages/application/src/shell.ts

@@ -528,20 +528,20 @@ export class LabShell extends Widget implements JupyterFrontEnd.IShell {
     options?: DocumentRegistry.IOpenOptions
   ): void {
     switch (area || 'main') {
-    case 'main':
-      return this._addToMainArea(widget, options);
-    case 'left':
-      return this._addToLeftArea(widget, options);
-    case 'right':
-      return this._addToRightArea(widget, options);
-    case 'header':
-      return this._addToHeaderArea(widget, options);
-    case 'top':
-      return this._addToTopArea(widget, options);
-    case 'bottom':
-      return this._addToBottomArea(widget, options);
-    default:
-      throw new Error(`Invalid area: ${area}`);
+      case 'main':
+        return this._addToMainArea(widget, options);
+      case 'left':
+        return this._addToLeftArea(widget, options);
+      case 'right':
+        return this._addToRightArea(widget, options);
+      case 'header':
+        return this._addToHeaderArea(widget, options);
+      case 'top':
+        return this._addToTopArea(widget, options);
+      case 'bottom':
+        return this._addToBottomArea(widget, options);
+      default:
+        throw new Error(`Invalid area: ${area}`);
     }
   }
 
@@ -611,20 +611,20 @@ export class LabShell extends Widget implements JupyterFrontEnd.IShell {
    */
   isEmpty(area: ILabShell.Area): boolean {
     switch (area) {
-    case 'left':
-      return this._leftHandler.stackedPanel.widgets.length === 0;
-    case 'main':
-      return this._dockPanel.isEmpty;
-    case 'header':
-      return this._headerPanel.widgets.length === 0;
-    case 'top':
-      return this._topHandler.panel.widgets.length === 0;
-    case 'bottom':
-      return this._bottomPanel.widgets.length === 0;
-    case 'right':
-      return this._rightHandler.stackedPanel.widgets.length === 0;
-    default:
-      return true;
+      case 'left':
+        return this._leftHandler.stackedPanel.widgets.length === 0;
+      case 'main':
+        return this._dockPanel.isEmpty;
+      case 'header':
+        return this._headerPanel.widgets.length === 0;
+      case 'top':
+        return this._topHandler.panel.widgets.length === 0;
+      case 'bottom':
+        return this._bottomPanel.widgets.length === 0;
+      case 'right':
+        return this._rightHandler.stackedPanel.widgets.length === 0;
+      default:
+        return true;
     }
   }
 
@@ -693,20 +693,20 @@ export class LabShell extends Widget implements JupyterFrontEnd.IShell {
    */
   widgets(area?: ILabShell.Area): IIterator<Widget> {
     switch (area || 'main') {
-    case 'main':
-      return this._dockPanel.widgets();
-    case 'left':
-      return iter(this._leftHandler.sideBar.titles.map(t => t.owner));
-    case 'right':
-      return iter(this._rightHandler.sideBar.titles.map(t => t.owner));
-    case 'header':
-      return this._headerPanel.children();
-    case 'top':
-      return this._topHandler.panel.children();
-    case 'bottom':
-      return this._bottomPanel.children();
-    default:
-      throw new Error(`Invalid area: ${area}`);
+      case 'main':
+        return this._dockPanel.widgets();
+      case 'left':
+        return iter(this._leftHandler.sideBar.titles.map(t => t.owner));
+      case 'right':
+        return iter(this._rightHandler.sideBar.titles.map(t => t.owner));
+      case 'header':
+        return this._headerPanel.children();
+      case 'top':
+        return this._topHandler.panel.children();
+      case 'bottom':
+        return this._bottomPanel.children();
+      default:
+        throw new Error(`Invalid area: ${area}`);
     }
   }
 
@@ -910,8 +910,8 @@ export class LabShell extends Widget implements JupyterFrontEnd.IShell {
     return index < len - 1
       ? bars[index + 1]
       : index === len - 1
-        ? bars[0]
-        : null;
+      ? bars[0]
+      : null;
   }
 
   /*
@@ -982,16 +982,16 @@ export class LabShell extends Widget implements JupyterFrontEnd.IShell {
     msg: Message
   ): boolean => {
     switch (msg.type) {
-    case 'child-added':
-      (msg as Widget.ChildMessage).child.addClass(ACTIVITY_CLASS);
-      this._tracker.add((msg as Widget.ChildMessage).child);
-      break;
-    case 'child-removed':
-      (msg as Widget.ChildMessage).child.removeClass(ACTIVITY_CLASS);
-      this._tracker.remove((msg as Widget.ChildMessage).child);
-      break;
-    default:
-      break;
+      case 'child-added':
+        (msg as Widget.ChildMessage).child.addClass(ACTIVITY_CLASS);
+        this._tracker.add((msg as Widget.ChildMessage).child);
+        break;
+      case 'child-removed':
+        (msg as Widget.ChildMessage).child.removeClass(ACTIVITY_CLASS);
+        this._tracker.remove((msg as Widget.ChildMessage).child);
+        break;
+      default:
+        break;
     }
     return true;
   };

+ 2 - 2
packages/apputils-extension/src/settingconnector.ts

@@ -13,8 +13,8 @@ import { Throttler } from '@lumino/polling';
  * This connector adds a query parameter to the base services setting manager.
  */
 export class SettingConnector extends DataConnector<
-ISettingRegistry.IPlugin,
-string
+  ISettingRegistry.IPlugin,
+  string
 > {
   constructor(connector: IDataConnector<ISettingRegistry.IPlugin, string>) {
     super();

+ 1 - 1
packages/apputils/src/clipboard.ts

@@ -103,5 +103,5 @@ namespace Private {
   /**
    * The application clipboard instance.
    */
-  export let instance = new MimeData();
+  export const instance = new MimeData();
 }

+ 5 - 5
packages/apputils/src/collapse.ts

@@ -107,11 +107,11 @@ export class Collapse<T extends Widget = Widget> extends Widget {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'click':
-      this._evtClick(event as MouseEvent);
-      break;
-    default:
-      break;
+      case 'click':
+        this._evtClick(event as MouseEvent);
+        break;
+      default:
+        break;
     }
   }
 

+ 5 - 5
packages/apputils/src/commandlinker.ts

@@ -115,11 +115,11 @@ export class CommandLinker implements IDisposable {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'click':
-      this._evtClick(event as MouseEvent);
-      break;
-    default:
-      return;
+      case 'click':
+        this._evtClick(event as MouseEvent);
+        break;
+      default:
+        return;
     }
   }
 

+ 34 - 34
packages/apputils/src/dialog.ts

@@ -197,21 +197,21 @@ export class Dialog<T> extends Widget {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'keydown':
-      this._evtKeydown(event as KeyboardEvent);
-      break;
-    case 'click':
-      this._evtClick(event as MouseEvent);
-      break;
-    case 'focus':
-      this._evtFocus(event as FocusEvent);
-      break;
-    case 'contextmenu':
-      event.preventDefault();
-      event.stopPropagation();
-      break;
-    default:
-      break;
+      case 'keydown':
+        this._evtKeydown(event as KeyboardEvent);
+        break;
+      case 'click':
+        this._evtClick(event as MouseEvent);
+        break;
+      case 'focus':
+        this._evtFocus(event as FocusEvent);
+        break;
+      case 'contextmenu':
+        event.preventDefault();
+        event.stopPropagation();
+        break;
+      default:
+        break;
     }
   }
 
@@ -290,27 +290,27 @@ export class Dialog<T> extends Widget {
   protected _evtKeydown(event: KeyboardEvent): void {
     // Check for escape key
     switch (event.keyCode) {
-    case 27: // Escape.
-      event.stopPropagation();
-      event.preventDefault();
-      this.reject();
-      break;
-    case 9: // Tab.
-      // Handle a tab on the last button.
-      const node = this._buttonNodes[this._buttons.length - 1];
-      if (document.activeElement === node && !event.shiftKey) {
+      case 27: // Escape.
         event.stopPropagation();
         event.preventDefault();
-        this._first.focus();
-      }
-      break;
-    case 13: // Enter.
-      event.stopPropagation();
-      event.preventDefault();
-      this.resolve();
-      break;
-    default:
-      break;
+        this.reject();
+        break;
+      case 9: // Tab.
+        // Handle a tab on the last button.
+        const node = this._buttonNodes[this._buttons.length - 1];
+        if (document.activeElement === node && !event.shiftKey) {
+          event.stopPropagation();
+          event.preventDefault();
+          this._first.focus();
+        }
+        break;
+      case 13: // Enter.
+        event.stopPropagation();
+        event.preventDefault();
+        this.resolve();
+        break;
+      default:
+        break;
     }
   }
 

+ 1 - 1
packages/apputils/src/domutils.ts

@@ -42,7 +42,7 @@ export namespace DOMUtils {
     className: string
   ): HTMLCollectionOf<HTMLElement> {
     return parent.getElementsByClassName(className) as HTMLCollectionOf<
-    HTMLElement
+      HTMLElement
     >;
   }
 

+ 4 - 4
packages/apputils/src/hoverbox.ts

@@ -133,10 +133,10 @@ export namespace HoverBox {
       privilege === 'forceAbove'
         ? false
         : privilege === 'forceBelow'
-          ? true
-          : privilege === 'above'
-            ? spaceAbove < maxHeight && spaceAbove < spaceBelow
-            : spaceBelow >= maxHeight || spaceBelow >= spaceAbove;
+        ? true
+        : privilege === 'above'
+        ? spaceAbove < maxHeight && spaceAbove < spaceBelow
+        : spaceBelow >= maxHeight || spaceBelow >= spaceAbove;
 
     if (renderBelow) {
       maxHeight = Math.min(spaceBelow - marginTop, maxHeight);

+ 39 - 39
packages/apputils/src/sessioncontext.tsx

@@ -69,12 +69,12 @@ export interface ISessionContext extends IObservableDisposable {
    * A signal emitted when the session connection changes.
    */
   readonly sessionChanged: ISignal<
-  this,
-  IChangedArgs<
-  Session.ISessionConnection | null,
-  Session.ISessionConnection | null,
-  'session'
-  >
+    this,
+    IChangedArgs<
+      Session.ISessionConnection | null,
+      Session.ISessionConnection | null,
+      'session'
+    >
   >;
 
   // Signals proxied from the session connection for convenience.
@@ -83,12 +83,12 @@ export interface ISessionContext extends IObservableDisposable {
    * A signal emitted when the kernel changes, proxied from the session connection.
    */
   readonly kernelChanged: ISignal<
-  this,
-  IChangedArgs<
-  Kernel.IKernelConnection | null,
-  Kernel.IKernelConnection | null,
-  'kernel'
-  >
+    this,
+    IChangedArgs<
+      Kernel.IKernelConnection | null,
+      Kernel.IKernelConnection | null,
+      'kernel'
+    >
   >;
 
   /**
@@ -340,8 +340,8 @@ export class SessionContext implements ISessionContext {
    * A signal emitted when the kernel connection changes, proxied from the session connection.
    */
   get kernelChanged(): ISignal<
-  this,
-  Session.ISessionConnection.IKernelChangedArgs
+    this,
+    Session.ISessionConnection.IKernelChangedArgs
   > {
     return this._kernelChanged;
   }
@@ -350,12 +350,12 @@ export class SessionContext implements ISessionContext {
    * A signal emitted when the session connection changes.
    */
   get sessionChanged(): ISignal<
-  this,
-  IChangedArgs<
-  Session.ISessionConnection | null,
-  Session.ISessionConnection | null,
-  'session'
-  >
+    this,
+    IChangedArgs<
+      Session.ISessionConnection | null,
+      Session.ISessionConnection | null,
+      'session'
+    >
   > {
     return this._sessionChanged;
   }
@@ -885,17 +885,17 @@ export class SessionContext implements ISessionContext {
     property: 'path' | 'name' | 'type'
   ) {
     switch (property) {
-    case 'path':
-      this._path = sender.path;
-      break;
-    case 'name':
-      this._name = sender.name;
-      break;
-    case 'type':
-      this._type = sender.type;
-      break;
-    default:
-      throw new Error(`unrecognized property ${property}`);
+      case 'path':
+        this._path = sender.path;
+        break;
+      case 'name':
+        this._name = sender.name;
+        break;
+      case 'type':
+        this._type = sender.type;
+        break;
+      default:
+        throw new Error(`unrecognized property ${property}`);
     }
     this._propertyChanged.emit(property);
   }
@@ -982,16 +982,16 @@ export class SessionContext implements ISessionContext {
   private _initPromise = new PromiseDelegate<boolean>();
   private _isReady = false;
   private _kernelChanged = new Signal<
-  this,
-  Session.ISessionConnection.IKernelChangedArgs
+    this,
+    Session.ISessionConnection.IKernelChangedArgs
   >(this);
   private _sessionChanged = new Signal<
-  this,
-  IChangedArgs<
-  Session.ISessionConnection | null,
-  Session.ISessionConnection | null,
-  'session'
-  >
+    this,
+    IChangedArgs<
+      Session.ISessionConnection | null,
+      Session.ISessionConnection | null,
+      'session'
+    >
   >(this);
   private _statusChanged = new Signal<this, Kernel.Status>(this);
   private _connectionStatusChanged = new Signal<this, Kernel.ConnectionStatus>(

+ 5 - 5
packages/apputils/src/toolbar.tsx

@@ -309,11 +309,11 @@ export class Toolbar<T extends Widget = Widget> extends Widget {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'click':
-      this.handleClick(event);
-      break;
-    default:
-      break;
+      case 'click':
+        this.handleClick(event);
+        break;
+      default:
+        break;
     }
   }
 

+ 2 - 2
packages/apputils/src/vdom.ts

@@ -233,8 +233,8 @@ export interface IUseSignalState<SENDER, ARGS> {
  * ```
  */
 export class UseSignal<SENDER, ARGS> extends React.Component<
-IUseSignalProps<SENDER, ARGS>,
-IUseSignalState<SENDER, ARGS>
+  IUseSignalProps<SENDER, ARGS>,
+  IUseSignalState<SENDER, ARGS>
 > {
   constructor(props: IUseSignalProps<SENDER, ARGS>) {
     super(props);

+ 1 - 1
packages/apputils/src/widgettracker.ts

@@ -113,7 +113,7 @@ export interface IWidgetTracker<T extends Widget = Widget> extends IDisposable {
  * internally by plugins to restore state as well.
  */
 export class WidgetTracker<T extends Widget = Widget>
-implements IWidgetTracker<T>, IRestorable<T> {
+  implements IWidgetTracker<T>, IRestorable<T> {
   /**
    * Create a new widget tracker.
    *

+ 65 - 65
packages/cells/src/widget.ts

@@ -513,18 +513,18 @@ export class Cell extends Widget {
     args: IObservableMap.IChangedArgs<PartialJSONValue | undefined>
   ): void {
     switch (args.key) {
-    case 'jupyter':
-      if (this.syncCollapse) {
-        this.loadCollapseState();
-      }
-      break;
-    case 'editable':
-      if (this.syncEditable) {
-        this.loadEditableState();
-      }
-      break;
-    default:
-      break;
+      case 'jupyter':
+        if (this.syncCollapse) {
+          this.loadCollapseState();
+        }
+        break;
+      case 'editable':
+        if (this.syncEditable) {
+          this.loadEditableState();
+        }
+        break;
+      default:
+        break;
     }
   }
 
@@ -578,7 +578,7 @@ export namespace Cell {
    */
   export interface IContentFactory
     extends OutputArea.IContentFactory,
-    InputArea.IContentFactory {
+      InputArea.IContentFactory {
     /**
      * Create a new cell header for the parent widget.
      */
@@ -951,11 +951,11 @@ export class CodeCell extends Cell {
    */
   protected onStateChanged(model: ICellModel, args: IChangedArgs<any>): void {
     switch (args.name) {
-    case 'executionCount':
-      this.setPrompt(`${(model as ICodeCellModel).executionCount || ''}`);
-      break;
-    default:
-      break;
+      case 'executionCount':
+        this.setPrompt(`${(model as ICodeCellModel).executionCount || ''}`);
+        break;
+      default:
+        break;
     }
   }
 
@@ -971,18 +971,18 @@ export class CodeCell extends Cell {
       return;
     }
     switch (args.key) {
-    case 'scrolled':
-      if (this.syncScrolled) {
-        this.loadScrolledState();
-      }
-      break;
-    case 'collapsed':
-      if (this.syncCollapse) {
-        this.loadCollapseState();
-      }
-      break;
-    default:
-      break;
+      case 'scrolled':
+        if (this.syncScrolled) {
+          this.loadScrolledState();
+        }
+        break;
+      case 'collapsed':
+        if (this.syncCollapse) {
+          this.loadCollapseState();
+        }
+        break;
+      default:
+        break;
     }
     super.onMetadataChanged(model, args);
   }
@@ -1050,11 +1050,11 @@ export namespace CodeCell {
     cell.setPrompt('*');
     model.trusted = true;
     let future:
-    | Kernel.IFuture<
-    KernelMessage.IExecuteRequestMsg,
-    KernelMessage.IExecuteReplyMsg
-    >
-    | undefined;
+      | Kernel.IFuture<
+          KernelMessage.IExecuteRequestMsg,
+          KernelMessage.IExecuteReplyMsg
+        >
+      | undefined;
     try {
       const msgPromise = OutputArea.execute(
         code,
@@ -1067,16 +1067,16 @@ export namespace CodeCell {
         const recordTimingHook = (msg: KernelMessage.IIOPubMessage) => {
           let label: string;
           switch (msg.header.msg_type) {
-          case 'status':
-            label = `status.${
-              (msg as KernelMessage.IStatusMsg).content.execution_state
-            }`;
-            break;
-          case 'execute_input':
-            label = 'execute_input';
-            break;
-          default:
-            return true;
+            case 'status':
+              label = `status.${
+                (msg as KernelMessage.IStatusMsg).content.execution_state
+              }`;
+              break;
+            case 'execute_input':
+              label = 'execute_input';
+              break;
+            default:
+              return true;
           }
           const value = msg.header.date;
           if (!value) {
@@ -1142,26 +1142,26 @@ export abstract class AttachmentsCell extends Cell {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'paste':
-      this._evtPaste(event as ClipboardEvent);
-      break;
-    case 'dragenter':
-      event.preventDefault();
-      break;
-    case 'dragover':
-      event.preventDefault();
-      break;
-    case 'drop':
-      this._evtNativeDrop(event as DragEvent);
-      break;
-    case 'lm-dragover':
-      this._evtDragOver(event as IDragEvent);
-      break;
-    case 'lm-drop':
-      this._evtDrop(event as IDragEvent);
-      break;
-    default:
-      break;
+      case 'paste':
+        this._evtPaste(event as ClipboardEvent);
+        break;
+      case 'dragenter':
+        event.preventDefault();
+        break;
+      case 'dragover':
+        event.preventDefault();
+        break;
+      case 'drop':
+        this._evtNativeDrop(event as DragEvent);
+        break;
+      case 'lm-dragover':
+        this._evtDragOver(event as IDragEvent);
+        break;
+      case 'lm-drop':
+        this._evtDrop(event as IDragEvent);
+        break;
+      default:
+        break;
     }
   }
 

+ 14 - 14
packages/celltags/src/addwidget.ts

@@ -76,20 +76,20 @@ export class AddWidget extends Widget {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'mousedown':
-      this._evtMouseDown(event as MouseEvent);
-      break;
-    case 'keydown':
-      this._evtKeyDown(event as KeyboardEvent);
-      break;
-    case 'blur':
-      this._evtBlur();
-      break;
-    case 'focus':
-      this._evtFocus();
-      break;
-    default:
-      break;
+      case 'mousedown':
+        this._evtMouseDown(event as MouseEvent);
+        break;
+      case 'keydown':
+        this._evtKeyDown(event as KeyboardEvent);
+        break;
+      case 'blur':
+        this._evtBlur();
+        break;
+      case 'focus':
+        this._evtFocus();
+        break;
+      default:
+        break;
     }
   }
 

+ 11 - 11
packages/celltags/src/widget.ts

@@ -77,17 +77,17 @@ export class TagWidget extends Widget {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'mousedown':
-      this._evtClick();
-      break;
-    case 'mouseover':
-      this._evtMouseOver();
-      break;
-    case 'mouseout':
-      this._evtMouseOut();
-      break;
-    default:
-      break;
+      case 'mousedown':
+        this._evtClick();
+        break;
+      case 'mouseover':
+        this._evtMouseOver();
+        break;
+      case 'mouseout':
+        this._evtMouseOut();
+        break;
+      default:
+        break;
     }
   }
 

+ 8 - 8
packages/codeeditor/src/jsoneditor.ts

@@ -149,14 +149,14 @@ export class JSONEditor extends Widget {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'blur':
-      this._evtBlur(event as FocusEvent);
-      break;
-    case 'click':
-      this._evtClick(event as MouseEvent);
-      break;
-    default:
-      break;
+      case 'blur':
+        this._evtBlur(event as FocusEvent);
+        break;
+      case 'click':
+        this._evtClick(event as MouseEvent);
+        break;
+      default:
+        break;
     }
   }
 

+ 14 - 14
packages/codeeditor/src/widget.ts

@@ -87,20 +87,20 @@ export class CodeEditorWrapper extends Widget {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'lm-dragenter':
-      this._evtDragEnter(event as IDragEvent);
-      break;
-    case 'lm-dragleave':
-      this._evtDragLeave(event as IDragEvent);
-      break;
-    case 'lm-dragover':
-      this._evtDragOver(event as IDragEvent);
-      break;
-    case 'lm-drop':
-      this._evtDrop(event as IDragEvent);
-      break;
-    default:
-      break;
+      case 'lm-dragenter':
+        this._evtDragEnter(event as IDragEvent);
+        break;
+      case 'lm-dragleave':
+        this._evtDragLeave(event as IDragEvent);
+        break;
+      case 'lm-dragover':
+        this._evtDragOver(event as IDragEvent);
+        break;
+      case 'lm-drop':
+        this._evtDrop(event as IDragEvent);
+        break;
+      default:
+        break;
     }
   }
 

+ 1 - 1
packages/codemirror-extension/src/index.ts

@@ -88,7 +88,7 @@ export const editorSyntaxStatus: JupyterFrontEndPlugin<void> = {
       const current = labShell.currentWidget;
       if (current && tracker.has(current) && item.model) {
         item.model.editor = (current as IDocumentWidget<
-        FileEditor
+          FileEditor
         >).content.editor;
       }
     });

+ 96 - 96
packages/codemirror/src/editor.ts

@@ -875,26 +875,26 @@ export class CodeMirrorEditor implements CodeEditor.IEditor {
     this._changeGuard = true;
     const doc = this.doc;
     switch (args.type) {
-    case 'insert':
-      const pos = doc.posFromIndex(args.start);
-      // Replace the range, including a '+input' orign,
-      // which indicates that CodeMirror may merge changes
-      // for undo/redo purposes.
-      doc.replaceRange(args.value, pos, pos, '+input');
-      break;
-    case 'remove':
-      const from = doc.posFromIndex(args.start);
-      const to = doc.posFromIndex(args.end);
-      // Replace the range, including a '+input' orign,
-      // which indicates that CodeMirror may merge changes
-      // for undo/redo purposes.
-      doc.replaceRange('', from, to, '+input');
-      break;
-    case 'set':
-      doc.setValue(args.value);
-      break;
-    default:
-      break;
+      case 'insert':
+        const pos = doc.posFromIndex(args.start);
+        // Replace the range, including a '+input' orign,
+        // which indicates that CodeMirror may merge changes
+        // for undo/redo purposes.
+        doc.replaceRange(args.value, pos, pos, '+input');
+        break;
+      case 'remove':
+        const from = doc.posFromIndex(args.start);
+        const to = doc.posFromIndex(args.end);
+        // Replace the range, including a '+input' orign,
+        // which indicates that CodeMirror may merge changes
+        // for undo/redo purposes.
+        doc.replaceRange('', from, to, '+input');
+        break;
+      case 'set':
+        doc.setValue(args.value);
+        break;
+      default:
+        break;
     }
     this._changeGuard = false;
   }
@@ -936,17 +936,17 @@ export class CodeMirrorEditor implements CodeEditor.IEditor {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'focus':
-      this._evtFocus(event as FocusEvent);
-      break;
-    case 'blur':
-      this._evtBlur(event as FocusEvent);
-      break;
-    case 'scroll':
-      this._evtScroll();
-      break;
-    default:
-      break;
+      case 'focus':
+        this._evtFocus(event as FocusEvent);
+        break;
+      case 'blur':
+        this._evtBlur(event as FocusEvent);
+        break;
+      case 'scroll':
+        this._evtScroll();
+        break;
+      default:
+        break;
     }
   }
 
@@ -1441,73 +1441,73 @@ namespace Private {
   ): void {
     const el = editor.getWrapperElement();
     switch (option) {
-    case 'lineWrap':
-      const lineWrapping = value === 'off' ? false : true;
-      const lines = el.querySelector('.CodeMirror-lines') as HTMLDivElement;
-      const maxWidth =
+      case 'lineWrap':
+        const lineWrapping = value === 'off' ? false : true;
+        const lines = el.querySelector('.CodeMirror-lines') as HTMLDivElement;
+        const maxWidth =
           value === 'bounded' ? `${config.wordWrapColumn}ch` : null;
-      const width =
+        const width =
           value === 'wordWrapColumn' ? `${config.wordWrapColumn}ch` : null;
-      lines.style.setProperty('max-width', maxWidth);
-      lines.style.setProperty('width', width);
-      editor.setOption('lineWrapping', lineWrapping);
-      break;
-    case 'wordWrapColumn':
-      const { lineWrap } = config;
-      if (lineWrap === 'wordWrapColumn' || lineWrap === 'bounded') {
-        const lines = el.querySelector('.CodeMirror-lines') as HTMLDivElement;
-        const prop = lineWrap === 'wordWrapColumn' ? 'width' : 'maxWidth';
-        lines.style[prop] = `${value}ch`;
-      }
-      break;
-    case 'tabSize':
-      editor.setOption('indentUnit', value);
-      break;
-    case 'insertSpaces':
-      editor.setOption('indentWithTabs', !value);
-      break;
-    case 'autoClosingBrackets':
-      editor.setOption('autoCloseBrackets', value);
-      break;
-    case 'rulers':
-      const rulers = value as Array<number>;
-      editor.setOption(
-        'rulers',
-        rulers.map(column => {
-          return {
-            column,
-            className: 'jp-CodeMirror-ruler'
-          };
-        })
-      );
-      break;
-    case 'readOnly':
-      el.classList.toggle(READ_ONLY_CLASS, value);
-      editor.setOption(option, value);
-      break;
-    case 'fontFamily':
-      el.style.fontFamily = value;
-      break;
-    case 'fontSize':
-      el.style.setProperty('font-size', value ? value + 'px' : null);
-      break;
-    case 'lineHeight':
-      el.style.lineHeight = value ? value.toString() : null;
-      break;
-    case 'gutters':
-      editor.setOption(option, getActiveGutters(config));
-      break;
-    case 'lineNumbers':
-      editor.setOption(option, value);
-      editor.setOption('gutters', getActiveGutters(config));
-      break;
-    case 'codeFolding':
-      editor.setOption('foldGutter', value);
-      editor.setOption('gutters', getActiveGutters(config));
-      break;
-    default:
-      editor.setOption(option, value);
-      break;
+        lines.style.setProperty('max-width', maxWidth);
+        lines.style.setProperty('width', width);
+        editor.setOption('lineWrapping', lineWrapping);
+        break;
+      case 'wordWrapColumn':
+        const { lineWrap } = config;
+        if (lineWrap === 'wordWrapColumn' || lineWrap === 'bounded') {
+          const lines = el.querySelector('.CodeMirror-lines') as HTMLDivElement;
+          const prop = lineWrap === 'wordWrapColumn' ? 'width' : 'maxWidth';
+          lines.style[prop] = `${value}ch`;
+        }
+        break;
+      case 'tabSize':
+        editor.setOption('indentUnit', value);
+        break;
+      case 'insertSpaces':
+        editor.setOption('indentWithTabs', !value);
+        break;
+      case 'autoClosingBrackets':
+        editor.setOption('autoCloseBrackets', value);
+        break;
+      case 'rulers':
+        const rulers = value as Array<number>;
+        editor.setOption(
+          'rulers',
+          rulers.map(column => {
+            return {
+              column,
+              className: 'jp-CodeMirror-ruler'
+            };
+          })
+        );
+        break;
+      case 'readOnly':
+        el.classList.toggle(READ_ONLY_CLASS, value);
+        editor.setOption(option, value);
+        break;
+      case 'fontFamily':
+        el.style.fontFamily = value;
+        break;
+      case 'fontSize':
+        el.style.setProperty('font-size', value ? value + 'px' : null);
+        break;
+      case 'lineHeight':
+        el.style.lineHeight = value ? value.toString() : null;
+        break;
+      case 'gutters':
+        editor.setOption(option, getActiveGutters(config));
+        break;
+      case 'lineNumbers':
+        editor.setOption(option, value);
+        editor.setOption('gutters', getActiveGutters(config));
+        break;
+      case 'codeFolding':
+        editor.setOption('foldGutter', value);
+        editor.setOption('gutters', getActiveGutters(config));
+        break;
+      default:
+        editor.setOption(option, value);
+        break;
     }
   }
 }

+ 3 - 3
packages/completer/src/connector.ts

@@ -13,9 +13,9 @@ import { CompletionHandler } from './handler';
  * A context+kernel connector for completion handlers.
  */
 export class CompletionConnector extends DataConnector<
-CompletionHandler.IReply,
-void,
-CompletionHandler.IRequest
+  CompletionHandler.IReply,
+  void,
+  CompletionHandler.IRequest
 > {
   /**
    * Create a new connector for completion requests.

+ 3 - 3
packages/completer/src/contextconnector.ts

@@ -11,9 +11,9 @@ import { CompletionHandler } from './handler';
  * A context connector for completion handlers.
  */
 export class ContextConnector extends DataConnector<
-CompletionHandler.IReply,
-void,
-CompletionHandler.IRequest
+  CompletionHandler.IReply,
+  void,
+  CompletionHandler.IRequest
 > {
   /**
    * Create a new context connector for completion requests.

+ 14 - 14
packages/completer/src/handler.ts

@@ -55,17 +55,17 @@ export class CompletionHandler implements IDisposable {
    * rejected promises.
    */
   get connector(): IDataConnector<
-  CompletionHandler.IReply,
-  void,
-  CompletionHandler.IRequest
+    CompletionHandler.IReply,
+    void,
+    CompletionHandler.IRequest
   > {
     return this._connector;
   }
   set connector(
     connector: IDataConnector<
-    CompletionHandler.IReply,
-    void,
-    CompletionHandler.IRequest
+      CompletionHandler.IReply,
+      void,
+      CompletionHandler.IRequest
     >
   ) {
     this._connector = connector;
@@ -141,11 +141,11 @@ export class CompletionHandler implements IDisposable {
    */
   processMessage(msg: Message): void {
     switch (msg.type) {
-    case CompletionHandler.Msg.InvokeRequest.type:
-      this.onInvokeRequest(msg);
-      break;
-    default:
-      break;
+      case CompletionHandler.Msg.InvokeRequest.type:
+        this.onInvokeRequest(msg);
+        break;
+      default:
+        break;
     }
   }
 
@@ -443,9 +443,9 @@ export class CompletionHandler implements IDisposable {
   }
 
   private _connector: IDataConnector<
-  CompletionHandler.IReply,
-  void,
-  CompletionHandler.IRequest
+    CompletionHandler.IReply,
+    void,
+    CompletionHandler.IRequest
   >;
   private _editor: CodeEditor.IEditor | null = null;
   private _enabled = false;

+ 3 - 3
packages/completer/src/kernelconnector.ts

@@ -11,9 +11,9 @@ import { CompletionHandler } from './handler';
  * A kernel connector for completion handlers.
  */
 export class KernelConnector extends DataConnector<
-CompletionHandler.IReply,
-void,
-CompletionHandler.IRequest
+  CompletionHandler.IReply,
+  void,
+  CompletionHandler.IRequest
 > {
   /**
    * Create a new kernel connector for completion requests.

+ 3 - 3
packages/completer/src/tokens.ts

@@ -51,9 +51,9 @@ export namespace ICompletionManager {
      * The data connector used to populate the completer.
      */
     connector: IDataConnector<
-    CompletionHandler.IReply,
-    void,
-    CompletionHandler.IRequest
+      CompletionHandler.IReply,
+      void,
+      CompletionHandler.IRequest
     >;
   }
 

+ 49 - 49
packages/completer/src/widget.ts

@@ -141,17 +141,17 @@ export class Completer extends Widget {
       return;
     }
     switch (event.type) {
-    case 'keydown':
-      this._evtKeydown(event as KeyboardEvent);
-      break;
-    case 'mousedown':
-      this._evtMousedown(event as MouseEvent);
-      break;
-    case 'scroll':
-      this._evtScroll(event as MouseEvent);
-      break;
-    default:
-      break;
+      case 'keydown':
+        this._evtKeydown(event as KeyboardEvent);
+        break;
+      case 'mousedown':
+        this._evtMousedown(event as MouseEvent);
+        break;
+      case 'scroll':
+        this._evtScroll(event as MouseEvent);
+        break;
+      default:
+        break;
     }
   }
 
@@ -343,45 +343,45 @@ export class Completer extends Widget {
       return;
     }
     switch (event.keyCode) {
-    case 9: // Tab key
-      event.preventDefault();
-      event.stopPropagation();
-      event.stopImmediatePropagation();
-      const model = this._model;
-      if (!model) {
+      case 9: // Tab key
+        event.preventDefault();
+        event.stopPropagation();
+        event.stopImmediatePropagation();
+        const model = this._model;
+        if (!model) {
+          return;
+        }
+        const populated = this._populateSubset();
+        // If there is a common subset in the options,
+        // then emit a completion signal with that subset.
+        if (model.query) {
+          model.subsetMatch = true;
+          this._selected.emit(model.query);
+          model.subsetMatch = false;
+        }
+        // If the query changed, update rendering of the options.
+        if (populated) {
+          this.update();
+        }
+        return;
+      case 27: // Esc key
+        event.preventDefault();
+        event.stopPropagation();
+        event.stopImmediatePropagation();
+        this.reset();
+        return;
+      case 33: // PageUp
+      case 34: // PageDown
+      case 38: // Up arrow key
+      case 40: // Down arrow key
+        event.preventDefault();
+        event.stopPropagation();
+        event.stopImmediatePropagation();
+        const cycle = Private.keyCodeMap[event.keyCode];
+        this._cycle(cycle);
+        return;
+      default:
         return;
-      }
-      const populated = this._populateSubset();
-      // If there is a common subset in the options,
-      // then emit a completion signal with that subset.
-      if (model.query) {
-        model.subsetMatch = true;
-        this._selected.emit(model.query);
-        model.subsetMatch = false;
-      }
-      // If the query changed, update rendering of the options.
-      if (populated) {
-        this.update();
-      }
-      return;
-    case 27: // Esc key
-      event.preventDefault();
-      event.stopPropagation();
-      event.stopImmediatePropagation();
-      this.reset();
-      return;
-    case 33: // PageUp
-    case 34: // PageDown
-    case 38: // Up arrow key
-    case 40: // Down arrow key
-      event.preventDefault();
-      event.stopPropagation();
-      event.stopImmediatePropagation();
-      const cycle = Private.keyCodeMap[event.keyCode];
-      this._cycle(cycle);
-      return;
-    default:
-      return;
     }
   }
 

+ 2 - 2
packages/console-extension/src/foreign.ts

@@ -108,8 +108,8 @@ namespace Private {
    * An attached property for a console's foreign handler.
    */
   export const foreignHandlerProperty = new AttachedProperty<
-  CodeConsole,
-  ForeignHandler | undefined
+    CodeConsole,
+    ForeignHandler | undefined
   >({
     name: 'foreignHandler',
     create: () => undefined

+ 32 - 32
packages/console/src/foreign.ts

@@ -99,39 +99,39 @@ export class ForeignHandler implements IDisposable {
     const parentMsgId = parentHeader.msg_id as string;
     let cell: CodeCell | undefined;
     switch (msgType) {
-    case 'execute_input':
-      const inputMsg = msg as KernelMessage.IExecuteInputMsg;
-      cell = this._newCell(parentMsgId);
-      const model = cell.model;
-      model.executionCount = inputMsg.content.execution_count;
-      model.value.text = inputMsg.content.code;
-      model.trusted = true;
-      parent.update();
-      return true;
-    case 'execute_result':
-    case 'display_data':
-    case 'stream':
-    case 'error':
-      cell = this._parent.getCell(parentMsgId);
-      if (!cell) {
+      case 'execute_input':
+        const inputMsg = msg as KernelMessage.IExecuteInputMsg;
+        cell = this._newCell(parentMsgId);
+        const model = cell.model;
+        model.executionCount = inputMsg.content.execution_count;
+        model.value.text = inputMsg.content.code;
+        model.trusted = true;
+        parent.update();
+        return true;
+      case 'execute_result':
+      case 'display_data':
+      case 'stream':
+      case 'error':
+        cell = this._parent.getCell(parentMsgId);
+        if (!cell) {
+          return false;
+        }
+        const output: nbformat.IOutput = {
+          ...msg.content,
+          output_type: msgType
+        };
+        cell.model.outputs.add(output);
+        parent.update();
+        return true;
+      case 'clear_output':
+        const wait = (msg as KernelMessage.IClearOutputMsg).content.wait;
+        cell = this._parent.getCell(parentMsgId);
+        if (cell) {
+          cell.model.outputs.clear(wait);
+        }
+        return true;
+      default:
         return false;
-      }
-      const output: nbformat.IOutput = {
-        ...msg.content,
-        output_type: msgType
-      };
-      cell.model.outputs.add(output);
-      parent.update();
-      return true;
-    case 'clear_output':
-      const wait = (msg as KernelMessage.IClearOutputMsg).content.wait;
-      cell = this._parent.getCell(parentMsgId);
-      if (cell) {
-        cell.model.outputs.clear(wait);
-      }
-      return true;
-    default:
-      return false;
     }
   }
 

+ 1 - 1
packages/console/src/panel.ts

@@ -283,7 +283,7 @@ namespace Private {
   /**
    * The counter for new consoles.
    */
-  export let count = 1;
+  export const count = 1;
 
   /**
    * Update the title of a console panel.

+ 14 - 14
packages/console/src/widget.ts

@@ -526,20 +526,20 @@ export class CodeConsole extends Widget {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'keydown':
-      this._evtKeyDown(event as KeyboardEvent);
-      break;
-    case 'mousedown':
-      this._evtMouseDown(event as MouseEvent);
-      break;
-    case 'mousemove':
-      this._evtMouseMove(event as MouseEvent);
-      break;
-    case 'mouseup':
-      this._evtMouseUp(event as MouseEvent);
-      break;
-    default:
-      break;
+      case 'keydown':
+        this._evtKeyDown(event as KeyboardEvent);
+        break;
+      case 'mousedown':
+        this._evtMouseDown(event as MouseEvent);
+        break;
+      case 'mousemove':
+        this._evtMouseMove(event as MouseEvent);
+        break;
+      case 'mouseup':
+        this._evtMouseUp(event as MouseEvent);
+        break;
+      default:
+        break;
     }
   }
 

+ 4 - 4
packages/coreutils/src/activitymonitor.ts

@@ -21,8 +21,8 @@ export class ActivityMonitor<Sender, Args> implements IDisposable {
    * A signal emitted when activity has ceased.
    */
   get activityStopped(): ISignal<
-  this,
-  ActivityMonitor.IArguments<Sender, Args>
+    this,
+    ActivityMonitor.IArguments<Sender, Args>
   > {
     return this._activityStopped;
   }
@@ -79,8 +79,8 @@ export class ActivityMonitor<Sender, Args> implements IDisposable {
   private _args: Args;
   private _isDisposed = false;
   private _activityStopped = new Signal<
-  this,
-  ActivityMonitor.IArguments<Sender, Args>
+    this,
+    ActivityMonitor.IArguments<Sender, Args>
   >(this);
 }
 

+ 22 - 22
packages/csvviewer/src/model.ts

@@ -154,28 +154,28 @@ export class DSVModel extends DataModel implements IDisposable {
 
     // Look up the field and value for the region.
     switch (region) {
-    case 'body':
-      if (this._header.length === 0) {
-        value = this._getField(row, column);
-      } else {
-        value = this._getField(row + 1, column);
-      }
-      break;
-    case 'column-header':
-      if (this._header.length === 0) {
-        value = (column + 1).toString();
-      } else {
-        value = this._header[column];
-      }
-      break;
-    case 'row-header':
-      value = (row + 1).toString();
-      break;
-    case 'corner-header':
-      value = '';
-      break;
-    default:
-      throw 'unreachable';
+      case 'body':
+        if (this._header.length === 0) {
+          value = this._getField(row, column);
+        } else {
+          value = this._getField(row + 1, column);
+        }
+        break;
+      case 'column-header':
+        if (this._header.length === 0) {
+          value = (column + 1).toString();
+        } else {
+          value = this._header[column];
+        }
+        break;
+      case 'row-header':
+        value = (row + 1).toString();
+        break;
+      case 'corner-header':
+        value = '';
+        break;
+      default:
+        throw 'unreachable';
     }
 
     // Return the final value.

+ 173 - 173
packages/csvviewer/src/parse.ts

@@ -191,8 +191,8 @@ export function parseDSV(options: IParser.IOptions): IParser.IResults {
     rowDelimiter === '\r\n'
       ? [CRLF, 2]
       : rowDelimiter === '\r'
-        ? [CR, 1]
-        : [LF, 1];
+      ? [CR, 1]
+      : [LF, 1];
 
   // Always start off at the beginning of a row.
   let state = NEW_ROW;
@@ -232,165 +232,165 @@ export function parseDSV(options: IParser.IOptions): IParser.IResults {
     // after the switch statement). In some situations, we may increment i
     // inside this loop to skip over indices as a shortcut.
     switch (state) {
-    // At the beginning of a row or field, we can have a quote, row delimiter, or field delimiter.
-    case NEW_ROW:
-    case NEW_FIELD:
-      switch (char) {
-      // If we have a quote, we are starting an escaped field.
-      case CH_QUOTE:
-        state = QUOTED_FIELD;
-        break;
-
-        // A field delimiter means we are starting a new field.
-      case CH_DELIMITER:
-        state = NEW_FIELD;
-        break;
-
-        // A row delimiter means we are starting a new row.
-      case CH_CR:
-        if (rowDelimiterCode === CR) {
-          state = NEW_ROW;
-        } else if (
-          rowDelimiterCode === CRLF &&
+      // At the beginning of a row or field, we can have a quote, row delimiter, or field delimiter.
+      case NEW_ROW:
+      case NEW_FIELD:
+        switch (char) {
+          // If we have a quote, we are starting an escaped field.
+          case CH_QUOTE:
+            state = QUOTED_FIELD;
+            break;
+
+          // A field delimiter means we are starting a new field.
+          case CH_DELIMITER:
+            state = NEW_FIELD;
+            break;
+
+          // A row delimiter means we are starting a new row.
+          case CH_CR:
+            if (rowDelimiterCode === CR) {
+              state = NEW_ROW;
+            } else if (
+              rowDelimiterCode === CRLF &&
               data.charCodeAt(i + 1) === CH_LF
-        ) {
-          // If we see an expected \r\n, then increment to the end of the delimiter.
-          i++;
-          state = NEW_ROW;
-        } else {
-          throw `string index ${i} (in row ${nrows}, column ${col}): carriage return found, but not as part of a row delimiter C ${data.charCodeAt(
-            i + 1
-          )}`;
-        }
-        break;
-      case CH_LF:
-        if (rowDelimiterCode === LF) {
-          state = NEW_ROW;
-        } else {
-          throw `string index ${i} (in row ${nrows}, column ${col}): line feed found, but row delimiter starts with a carriage return`;
+            ) {
+              // If we see an expected \r\n, then increment to the end of the delimiter.
+              i++;
+              state = NEW_ROW;
+            } else {
+              throw `string index ${i} (in row ${nrows}, column ${col}): carriage return found, but not as part of a row delimiter C ${data.charCodeAt(
+                i + 1
+              )}`;
+            }
+            break;
+          case CH_LF:
+            if (rowDelimiterCode === LF) {
+              state = NEW_ROW;
+            } else {
+              throw `string index ${i} (in row ${nrows}, column ${col}): line feed found, but row delimiter starts with a carriage return`;
+            }
+            break;
+
+          // Otherwise, we are starting an unquoted field.
+          default:
+            state = UNQUOTED_FIELD;
+            break;
         }
         break;
 
-        // Otherwise, we are starting an unquoted field.
-      default:
-        state = UNQUOTED_FIELD;
-        break;
-      }
-      break;
-
       // We are in a quoted field.
-    case QUOTED_FIELD:
-      // Skip ahead until we see another quote, which either ends the quoted
-      // field or starts an escaped quote.
-      i = data.indexOf(quote, i);
-      if (i < 0) {
-        throw `string index ${i} (in row ${nrows}, column ${col}): mismatched quote`;
-      }
-      state = QUOTED_FIELD_QUOTE;
-      break;
+      case QUOTED_FIELD:
+        // Skip ahead until we see another quote, which either ends the quoted
+        // field or starts an escaped quote.
+        i = data.indexOf(quote, i);
+        if (i < 0) {
+          throw `string index ${i} (in row ${nrows}, column ${col}): mismatched quote`;
+        }
+        state = QUOTED_FIELD_QUOTE;
+        break;
 
       // We just saw a quote in a quoted field. This could be the end of the
       // field, or it could be a repeated quote (i.e., an escaped quote according
       // to RFC 4180).
-    case QUOTED_FIELD_QUOTE:
-      switch (char) {
-      // Another quote means we just saw an escaped quote, so we are still in
-      // the quoted field.
-      case CH_QUOTE:
-        state = QUOTED_FIELD;
-        break;
-
-        // A field or row delimiter means the quoted field just ended and we are
-        // going into a new field or new row.
-      case CH_DELIMITER:
-        state = NEW_FIELD;
-        break;
-
-        // A row delimiter means we are starting a new row in the next index.
-      case CH_CR:
-        if (rowDelimiterCode === CR) {
-          state = NEW_ROW;
-        } else if (
-          rowDelimiterCode === CRLF &&
+      case QUOTED_FIELD_QUOTE:
+        switch (char) {
+          // Another quote means we just saw an escaped quote, so we are still in
+          // the quoted field.
+          case CH_QUOTE:
+            state = QUOTED_FIELD;
+            break;
+
+          // A field or row delimiter means the quoted field just ended and we are
+          // going into a new field or new row.
+          case CH_DELIMITER:
+            state = NEW_FIELD;
+            break;
+
+          // A row delimiter means we are starting a new row in the next index.
+          case CH_CR:
+            if (rowDelimiterCode === CR) {
+              state = NEW_ROW;
+            } else if (
+              rowDelimiterCode === CRLF &&
               data.charCodeAt(i + 1) === CH_LF
-        ) {
-          // If we see an expected \r\n, then increment to the end of the delimiter.
-          i++;
-          state = NEW_ROW;
-        } else {
-          throw `string index ${i} (in row ${nrows}, column ${col}): carriage return found, but not as part of a row delimiter C ${data.charCodeAt(
-            i + 1
-          )}`;
+            ) {
+              // If we see an expected \r\n, then increment to the end of the delimiter.
+              i++;
+              state = NEW_ROW;
+            } else {
+              throw `string index ${i} (in row ${nrows}, column ${col}): carriage return found, but not as part of a row delimiter C ${data.charCodeAt(
+                i + 1
+              )}`;
+            }
+            break;
+          case CH_LF:
+            if (rowDelimiterCode === LF) {
+              state = NEW_ROW;
+            } else {
+              throw `string index ${i} (in row ${nrows}, column ${col}): line feed found, but row delimiter starts with a carriage return`;
+            }
+            break;
+
+          default:
+            throw `string index ${i} (in row ${nrows}, column ${col}): quote in escaped field not followed by quote, delimiter, or row delimiter`;
         }
         break;
-      case CH_LF:
-        if (rowDelimiterCode === LF) {
-          state = NEW_ROW;
-        } else {
-          throw `string index ${i} (in row ${nrows}, column ${col}): line feed found, but row delimiter starts with a carriage return`;
-        }
-        break;
-
-      default:
-        throw `string index ${i} (in row ${nrows}, column ${col}): quote in escaped field not followed by quote, delimiter, or row delimiter`;
-      }
-      break;
 
       // We are in an unquoted field, so the only thing we look for is the next
       // row or field delimiter.
-    case UNQUOTED_FIELD:
-      // Skip ahead to either the next field delimiter or possible start of a
-      // row delimiter (CR or LF).
-      while (i < endIndex) {
-        char = data.charCodeAt(i);
-        if (char === CH_DELIMITER || char === CH_LF || char === CH_CR) {
-          break;
+      case UNQUOTED_FIELD:
+        // Skip ahead to either the next field delimiter or possible start of a
+        // row delimiter (CR or LF).
+        while (i < endIndex) {
+          char = data.charCodeAt(i);
+          if (char === CH_DELIMITER || char === CH_LF || char === CH_CR) {
+            break;
+          }
+          i++;
         }
-        i++;
-      }
-
-      // Process the character we're seeing in an unquoted field.
-      switch (char) {
-      // A field delimiter means we are starting a new field.
-      case CH_DELIMITER:
-        state = NEW_FIELD;
-        break;
 
-        // A row delimiter means we are starting a new row in the next index.
-      case CH_CR:
-        if (rowDelimiterCode === CR) {
-          state = NEW_ROW;
-        } else if (
-          rowDelimiterCode === CRLF &&
+        // Process the character we're seeing in an unquoted field.
+        switch (char) {
+          // A field delimiter means we are starting a new field.
+          case CH_DELIMITER:
+            state = NEW_FIELD;
+            break;
+
+          // A row delimiter means we are starting a new row in the next index.
+          case CH_CR:
+            if (rowDelimiterCode === CR) {
+              state = NEW_ROW;
+            } else if (
+              rowDelimiterCode === CRLF &&
               data.charCodeAt(i + 1) === CH_LF
-        ) {
-          // If we see an expected \r\n, then increment to the end of the delimiter.
-          i++;
-          state = NEW_ROW;
-        } else {
-          throw `string index ${i} (in row ${nrows}, column ${col}): carriage return found, but not as part of a row delimiter C ${data.charCodeAt(
-            i + 1
-          )}`;
-        }
-        break;
-      case CH_LF:
-        if (rowDelimiterCode === LF) {
-          state = NEW_ROW;
-        } else {
-          throw `string index ${i} (in row ${nrows}, column ${col}): line feed found, but row delimiter starts with a carriage return`;
+            ) {
+              // If we see an expected \r\n, then increment to the end of the delimiter.
+              i++;
+              state = NEW_ROW;
+            } else {
+              throw `string index ${i} (in row ${nrows}, column ${col}): carriage return found, but not as part of a row delimiter C ${data.charCodeAt(
+                i + 1
+              )}`;
+            }
+            break;
+          case CH_LF:
+            if (rowDelimiterCode === LF) {
+              state = NEW_ROW;
+            } else {
+              throw `string index ${i} (in row ${nrows}, column ${col}): line feed found, but row delimiter starts with a carriage return`;
+            }
+            break;
+
+          // Otherwise, we continue on in the unquoted field.
+          default:
+            continue;
         }
         break;
 
-        // Otherwise, we continue on in the unquoted field.
-      default:
-        continue;
-      }
-      break;
-
       // We should never reach this point since the parser state is handled above,
       // so throw an error if we do.
-    default:
-      throw `string index ${i} (in row ${nrows}, column ${col}): state not recognized`;
+      default:
+        throw `string index ${i} (in row ${nrows}, column ${col}): state not recognized`;
     }
 
     // Increment i to the next character index
@@ -398,50 +398,50 @@ export function parseDSV(options: IParser.IOptions): IParser.IResults {
 
     // Update return values based on state.
     switch (state) {
-    case NEW_ROW:
-      nrows++;
+      case NEW_ROW:
+        nrows++;
 
-      // If ncols is undefined, set it to the number of columns in this row (first row implied).
-      if (ncols === undefined) {
-        if (nrows !== 1) {
-          throw new Error('Error parsing default number of columns');
+        // If ncols is undefined, set it to the number of columns in this row (first row implied).
+        if (ncols === undefined) {
+          if (nrows !== 1) {
+            throw new Error('Error parsing default number of columns');
+          }
+          ncols = col;
         }
-        ncols = col;
-      }
 
-      // Pad or truncate the column offsets in the previous row if we are
-      // returning them.
-      if (columnOffsets === true) {
-        if (col < ncols) {
-          // We didn't have enough columns, so add some more column offsets that
-          // point to just before the row delimiter we just saw.
-          for (; col < ncols; col++) {
-            offsets.push(i - rowDelimiterLength);
+        // Pad or truncate the column offsets in the previous row if we are
+        // returning them.
+        if (columnOffsets === true) {
+          if (col < ncols) {
+            // We didn't have enough columns, so add some more column offsets that
+            // point to just before the row delimiter we just saw.
+            for (; col < ncols; col++) {
+              offsets.push(i - rowDelimiterLength);
+            }
+          } else if (col > ncols) {
+            // We had too many columns, so truncate them.
+            offsets.length = offsets.length - (col - ncols);
           }
-        } else if (col > ncols) {
-          // We had too many columns, so truncate them.
-          offsets.length = offsets.length - (col - ncols);
         }
-      }
 
-      // Shortcut return if nrows reaches the maximum rows we are to parse.
-      if (nrows === maxRows) {
-        return { nrows, ncols: columnOffsets ? ncols : 0, offsets };
-      }
-      break;
+        // Shortcut return if nrows reaches the maximum rows we are to parse.
+        if (nrows === maxRows) {
+          return { nrows, ncols: columnOffsets ? ncols : 0, offsets };
+        }
+        break;
 
-    case NEW_FIELD:
-      // If we are returning column offsets, log the current index.
-      if (columnOffsets === true) {
-        offsets.push(i);
-      }
+      case NEW_FIELD:
+        // If we are returning column offsets, log the current index.
+        if (columnOffsets === true) {
+          offsets.push(i);
+        }
 
-      // Update the column counter.
-      col++;
-      break;
+        // Update the column counter.
+        col++;
+        break;
 
-    default:
-      break;
+      default:
+        break;
     }
   }
 

+ 5 - 5
packages/csvviewer/src/toolbar.ts

@@ -71,11 +71,11 @@ export class CSVDelimiter extends Widget {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'change':
-      this._delimiterChanged.emit(this.selectNode.value);
-      break;
-    default:
-      break;
+      case 'change':
+        this._delimiterChanged.emit(this.selectNode.value);
+        break;
+      default:
+        break;
     }
   }
 

+ 4 - 4
packages/csvviewer/src/widget.ts

@@ -405,8 +405,8 @@ export class CSVViewer extends Widget {
   private _grid: DataGrid;
   private _searchService: GridSearchService;
   private _monitor: ActivityMonitor<
-  DocumentRegistry.IModel,
-  void
+    DocumentRegistry.IModel,
+    void
   > | null = null;
   private _delimiter = ',';
   private _revealed = new PromiseDelegate<void>();
@@ -499,7 +499,7 @@ namespace Private {
  * A widget factory for CSV widgets.
  */
 export class CSVViewerFactory extends ABCWidgetFactory<
-IDocumentWidget<CSVViewer>
+  IDocumentWidget<CSVViewer>
 > {
   /**
    * Create a new widget given a context.
@@ -515,7 +515,7 @@ IDocumentWidget<CSVViewer>
  * A widget factory for TSV widgets.
  */
 export class TSVViewerFactory extends ABCWidgetFactory<
-IDocumentWidget<CSVViewer>
+  IDocumentWidget<CSVViewer>
 > {
   /**
    * Create a new widget given a context.

+ 1 - 1
packages/docmanager-extension/src/index.ts

@@ -832,7 +832,7 @@ namespace Private {
   /**
    * A counter for unique IDs.
    */
-  export let id = 0;
+  export const id = 0;
 
   export function createRevertConfirmNode(
     checkpoint: Contents.ICheckpointModel,

+ 2 - 2
packages/docmanager/src/manager.ts

@@ -666,8 +666,8 @@ namespace Private {
    * An attached property for a context save handler.
    */
   export const saveHandlerProperty = new AttachedProperty<
-  DocumentRegistry.Context,
-  SaveHandler | undefined
+    DocumentRegistry.Context,
+    SaveHandler | undefined
   >({
     name: 'saveHandler',
     create: () => undefined

+ 19 - 19
packages/docmanager/src/widgetmanager.ts

@@ -232,17 +232,17 @@ export class DocumentWidgetManager implements IDisposable {
    */
   messageHook(handler: IMessageHandler, msg: Message): boolean {
     switch (msg.type) {
-    case 'close-request':
-      void this.onClose(handler as Widget);
-      return false;
-    case 'activate-request':
-      const context = this.contextForWidget(handler as Widget);
-      if (context) {
-        this._activateRequested.emit(context.path);
-      }
-      break;
-    default:
-      break;
+      case 'close-request':
+        void this.onClose(handler as Widget);
+        return false;
+      case 'activate-request':
+        const context = this.contextForWidget(handler as Widget);
+        if (context) {
+          this._activateRequested.emit(context.path);
+        }
+        break;
+      default:
+        break;
     }
     return true;
   }
@@ -434,8 +434,8 @@ namespace Private {
    * A private attached property for a widget context.
    */
   export const contextProperty = new AttachedProperty<
-  Widget,
-  DocumentRegistry.Context | undefined
+    Widget,
+    DocumentRegistry.Context | undefined
   >({
     name: 'context',
     create: () => undefined
@@ -445,8 +445,8 @@ namespace Private {
    * A private attached property for a widget factory.
    */
   export const factoryProperty = new AttachedProperty<
-  Widget,
-  DocumentRegistry.WidgetFactory | undefined
+    Widget,
+    DocumentRegistry.WidgetFactory | undefined
   >({
     name: 'factory',
     create: () => undefined
@@ -456,8 +456,8 @@ namespace Private {
    * A private attached property for the widgets associated with a context.
    */
   export const widgetsProperty = new AttachedProperty<
-  DocumentRegistry.Context,
-  IDocumentWidget[]
+    DocumentRegistry.Context,
+    IDocumentWidget[]
   >({
     name: 'widgets',
     create: () => []
@@ -467,8 +467,8 @@ namespace Private {
    * A private attached property for a widget's disposables.
    */
   export const disposablesProperty = new AttachedProperty<
-  Widget,
-  DisposableSet
+    Widget,
+    DisposableSet
   >({
     name: 'disposables',
     create: () => new DisposableSet()

+ 1 - 1
packages/docregistry/src/context.ts

@@ -40,7 +40,7 @@ import { DocumentRegistry } from './registry';
  * This class is typically instantiated by the document manager.
  */
 export class Context<T extends DocumentRegistry.IModel>
-implements DocumentRegistry.IContext<T> {
+  implements DocumentRegistry.IContext<T> {
   /**
    * Construct a new document context.
    */

+ 2 - 2
packages/docregistry/src/default.ts

@@ -427,8 +427,8 @@ export abstract class ABCWidgetFactory<
   }
 
   private _toolbarFactory:
-  | ((widget: T) => DocumentRegistry.IToolbarItem[])
-  | undefined;
+    | ((widget: T) => DocumentRegistry.IToolbarItem[])
+    | undefined;
   private _isDisposed = false;
   private _name: string;
   private _readOnly: boolean;

+ 22 - 22
packages/docregistry/src/registry.ts

@@ -617,26 +617,26 @@ export class DocumentRegistry implements IDisposable {
     model: Partial<Contents.IModel>
   ): DocumentRegistry.IFileType {
     switch (model.type) {
-    case 'directory':
-      return (
-        find(this._fileTypes, ft => ft.contentType === 'directory') ||
+      case 'directory':
+        return (
+          find(this._fileTypes, ft => ft.contentType === 'directory') ||
           DocumentRegistry.defaultDirectoryFileType
-      );
-    case 'notebook':
-      return (
-        find(this._fileTypes, ft => ft.contentType === 'notebook') ||
+        );
+      case 'notebook':
+        return (
+          find(this._fileTypes, ft => ft.contentType === 'notebook') ||
           DocumentRegistry.defaultNotebookFileType
-      );
-    default:
-      // Find the best matching extension.
-      if (model.name || model.path) {
-        const name = model.name || PathExt.basename(model.path!);
-        const fts = this.getFileTypesForPath(name);
-        if (fts.length > 0) {
-          return fts[0];
+        );
+      default:
+        // Find the best matching extension.
+        if (model.name || model.path) {
+          const name = model.name || PathExt.basename(model.path!);
+          const fts = this.getFileTypesForPath(name);
+          if (fts.length > 0) {
+            return fts[0];
+          }
         }
-      }
-      return this.getFileType('text') || DocumentRegistry.defaultTextFileType;
+        return this.getFileType('text') || DocumentRegistry.defaultTextFileType;
     }
   }
 
@@ -1068,7 +1068,7 @@ export namespace DocumentRegistry {
    */
   export interface IWidgetFactory<T extends IDocumentWidget, U extends IModel>
     extends IDisposable,
-    IWidgetFactoryOptions {
+      IWidgetFactoryOptions {
     /**
      * A signal emitted when a new widget is created.
      */
@@ -1224,10 +1224,10 @@ export namespace DocumentRegistry {
      * The type of the changed item.
      */
     readonly type:
-    | 'widgetFactory'
-    | 'modelFactory'
-    | 'widgetExtension'
-    | 'fileType';
+      | 'widgetFactory'
+      | 'modelFactory'
+      | 'widgetExtension'
+      | 'fileType';
 
     /**
      * The name of the item or the widget factory being extended.

+ 1 - 1
packages/documentsearch/src/providers/codemirrorsearchprovider.ts

@@ -49,7 +49,7 @@ export type CMMainAreaWidget = MainAreaWidget<FileEditor> & {
 type MatchMap = { [key: number]: { [key: number]: ISearchMatch } };
 
 export class CodeMirrorSearchProvider
-implements ISearchProvider<CMMainAreaWidget> {
+  implements ISearchProvider<CMMainAreaWidget> {
   /**
    * Get an initial query value if applicable so that it can be entered
    * into the search box as an initial query

+ 9 - 9
packages/documentsearch/src/searchoverlay.tsx

@@ -238,8 +238,8 @@ function SearchIndices(props: ISearchIndexProps) {
       {props.totalMatches === 0
         ? '-/-'
         : `${props.currentIndex === null ? '-' : props.currentIndex + 1}/${
-          props.totalMatches
-        }`}
+            props.totalMatches
+          }`}
     </div>
   );
 }
@@ -252,8 +252,8 @@ interface IFilterToggleProps {
 interface IFilterToggleState {}
 
 class FilterToggle extends React.Component<
-IFilterToggleProps,
-IFilterToggleState
+  IFilterToggleProps,
+  IFilterToggleState
 > {
   render() {
     let className = `${ELLIPSES_BUTTON_CLASS} ${BUTTON_CONTENT_CLASS}`;
@@ -286,8 +286,8 @@ interface IFilterSelectionProps {
 interface IFilterSelectionState {}
 
 class FilterSelection extends React.Component<
-IFilterSelectionProps,
-IFilterSelectionState
+  IFilterSelectionProps,
+  IFilterSelectionState
 > {
   render() {
     return (
@@ -324,8 +324,8 @@ interface ISearchOverlayProps {
 }
 
 class SearchOverlay extends React.Component<
-ISearchOverlayProps,
-IDisplayState
+  ISearchOverlayProps,
+  IDisplayState
 > {
   constructor(props: ISearchOverlayProps) {
     super(props);
@@ -558,7 +558,7 @@ IDisplayState
     ];
   }
 
-  private replaceEntryRef: React.RefObect<ReplaceEntry>;
+  private replaceEntryRef: React.RefObject<ReplaceEntry>;
 
   private _debouncedStartSearch = new Debouncer(() => {
     this._executeSearch(true, this.state.searchText);

+ 2 - 2
packages/documentsearch/src/searchproviderregistry.ts

@@ -63,8 +63,8 @@ export class SearchProviderRegistry implements ISearchProviderRegistry {
 
   private _changed = new Signal<this, void>(this);
   private _providerMap: Private.ProviderMap = new Map<
-  string,
-  ISearchProviderConstructor<any>
+    string,
+    ISearchProviderConstructor<any>
   >();
 }
 

+ 2 - 2
packages/extensionmanager/src/model.ts

@@ -494,8 +494,8 @@ export class ListModel extends VDomModel {
           'homepage' in pkg.links
             ? pkg.links.homepage
             : 'repository' in pkg.links
-              ? pkg.links.repository
-              : pkg.links.npm,
+            ? pkg.links.repository
+            : pkg.links.npm,
         installed: false,
         enabled: false,
         status: null,

+ 47 - 47
packages/extensionmanager/src/widget.tsx

@@ -43,8 +43,8 @@ const badgeQuerySize = Math.floor(devicePixelRatio * badgeSize);
  * Search bar VDOM component.
  */
 export class SearchBar extends React.Component<
-SearchBar.IProperties,
-SearchBar.IState
+  SearchBar.IProperties,
+  SearchBar.IState
 > {
   constructor(props: SearchBar.IProperties) {
     super(props);
@@ -233,16 +233,16 @@ function ListEntry(props: ListEntry.IProperties): React.ReactElement<any> {
           {!entry.whitelistEntry &&
             viewType === 'installed' &&
             listMode === 'white' && (
-            <ToolbarButtonComponent
-              icon={listingsInfoIcon}
-              iconLabel={`${entry.name} extension has been removed from the whitelist since installation. Please uninstall immediately and contact your whitelist administrator.`}
-              onClick={() =>
-                window.open(
-                  'https://jupyterlab.readthedocs.io/en/stable/user/extensions.html'
-                )
-              }
-            />
-          )}
+              <ToolbarButtonComponent
+                icon={listingsInfoIcon}
+                iconLabel={`${entry.name} extension has been removed from the whitelist since installation. Please uninstall immediately and contact your whitelist administrator.`}
+                onClick={() =>
+                  window.open(
+                    'https://jupyterlab.readthedocs.io/en/stable/user/extensions.html'
+                  )
+                }
+              />
+            )}
           {entryIsJupyterOrg && (
             <jupyterIcon.react
               className="jp-extensionmanager-is-jupyter-org"
@@ -261,26 +261,26 @@ function ListEntry(props: ListEntry.IProperties): React.ReactElement<any> {
               !entry.blacklistEntry &&
               !(!entry.whitelistEntry && listMode === 'white') &&
               ListModel.isDisclaimed() && (
-              <Button
-                onClick={() => props.performAction('install', entry)}
-                minimal
-                small
-              >
+                <Button
+                  onClick={() => props.performAction('install', entry)}
+                  minimal
+                  small
+                >
                   Install
-              </Button>
-            )}
+                </Button>
+              )}
             {ListModel.entryHasUpdate(entry) &&
               !entry.blacklistEntry &&
               !(!entry.whitelistEntry && listMode === 'white') &&
               ListModel.isDisclaimed() && (
-              <Button
-                onClick={() => props.performAction('install', entry)}
-                minimal
-                small
-              >
+                <Button
+                  onClick={() => props.performAction('install', entry)}
+                  minimal
+                  small
+                >
                   Update
-              </Button>
-            )}
+                </Button>
+              )}
             {entry.installed && (
               <Button
                 onClick={() => props.performAction('uninstall', entry)}
@@ -451,8 +451,8 @@ namespace ErrorMessage {
  *
  */
 export class CollapsibleSection extends React.Component<
-CollapsibleSection.IProperties,
-CollapsibleSection.IState
+  CollapsibleSection.IProperties,
+  CollapsibleSection.IState
 > {
   constructor(props: CollapsibleSection.IProperties) {
     super(props);
@@ -866,16 +866,16 @@ export class ExtensionView extends VDomRenderer<ListModel> {
    */
   onAction(action: Action, entry: IEntry) {
     switch (action) {
-    case 'install':
-      return this.model!.install(entry);
-    case 'uninstall':
-      return this.model!.uninstall(entry);
-    case 'enable':
-      return this.model!.enable(entry);
-    case 'disable':
-      return this.model!.disable(entry);
-    default:
-      throw new Error(`Invalid action: ${action}`);
+      case 'install':
+        return this.model!.install(entry);
+      case 'uninstall':
+        return this.model!.uninstall(entry);
+      case 'enable':
+        return this.model!.enable(entry);
+      case 'disable':
+        return this.model!.disable(entry);
+      default:
+        throw new Error(`Invalid action: ${action}`);
     }
   }
 
@@ -891,15 +891,15 @@ export class ExtensionView extends VDomRenderer<ListModel> {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'input':
-      this.onSearch(this.inputNode.value);
-      break;
-    case 'focus':
-    case 'blur':
-      this._toggleFocused();
-      break;
-    default:
-      break;
+      case 'input':
+        this.onSearch(this.inputNode.value);
+        break;
+      case 'focus':
+      case 'blur':
+        this._toggleFocused();
+        break;
+      default:
+        break;
     }
   }
 

+ 4 - 4
packages/filebrowser-extension/src/index.ts

@@ -844,10 +844,10 @@ function addCommands(
       // in the current filebrowser selection
       const factories = tracker.currentWidget
         ? OpenWithMenu._intersection(
-          map(tracker.currentWidget.selectedItems(), i => {
-            return OpenWithMenu._getFactories(i);
-          })
-        )
+            map(tracker.currentWidget.selectedItems(), i => {
+              return OpenWithMenu._getFactories(i);
+            })
+          )
         : undefined;
 
       if (factories) {

+ 17 - 17
packages/filebrowser/src/crumbs.ts

@@ -82,23 +82,23 @@ export class BreadCrumbs extends Widget {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'click':
-      this._evtClick(event as MouseEvent);
-      break;
-    case 'lm-dragenter':
-      this._evtDragEnter(event as IDragEvent);
-      break;
-    case 'lm-dragleave':
-      this._evtDragLeave(event as IDragEvent);
-      break;
-    case 'lm-dragover':
-      this._evtDragOver(event as IDragEvent);
-      break;
-    case 'lm-drop':
-      this._evtDrop(event as IDragEvent);
-      break;
-    default:
-      return;
+      case 'click':
+        this._evtClick(event as MouseEvent);
+        break;
+      case 'lm-dragenter':
+        this._evtDragEnter(event as IDragEvent);
+        break;
+      case 'lm-dragleave':
+        this._evtDragLeave(event as IDragEvent);
+        break;
+      case 'lm-dragover':
+        this._evtDragOver(event as IDragEvent);
+        break;
+      case 'lm-drop':
+        this._evtDrop(event as IDragEvent);
+        break;
+      default:
+        return;
     }
   }
 

+ 104 - 104
packages/filebrowser/src/listing.ts

@@ -614,54 +614,54 @@ export class DirListing extends Widget {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'mousedown':
-      this._evtMousedown(event as MouseEvent);
-      break;
-    case 'mouseup':
-      this._evtMouseup(event as MouseEvent);
-      break;
-    case 'mousemove':
-      this._evtMousemove(event as MouseEvent);
-      break;
-    case 'keydown':
-      this._evtKeydown(event as KeyboardEvent);
-      break;
-    case 'click':
-      this._evtClick(event as MouseEvent);
-      break;
-    case 'dblclick':
-      this._evtDblClick(event as MouseEvent);
-      break;
-    case 'dragenter':
-    case 'dragover':
-      this.addClass('jp-mod-native-drop');
-      event.preventDefault();
-      break;
-    case 'dragleave':
-    case 'dragend':
-      this.removeClass('jp-mod-native-drop');
-      break;
-    case 'drop':
-      this.removeClass('jp-mod-native-drop');
-      this._evtNativeDrop(event as DragEvent);
-      break;
-    case 'scroll':
-      this._evtScroll(event as MouseEvent);
-      break;
-    case 'lm-dragenter':
-      this._evtDragEnter(event as IDragEvent);
-      break;
-    case 'lm-dragleave':
-      this._evtDragLeave(event as IDragEvent);
-      break;
-    case 'lm-dragover':
-      this._evtDragOver(event as IDragEvent);
-      break;
-    case 'lm-drop':
-      this._evtDrop(event as IDragEvent);
-      break;
-    default:
-      break;
+      case 'mousedown':
+        this._evtMousedown(event as MouseEvent);
+        break;
+      case 'mouseup':
+        this._evtMouseup(event as MouseEvent);
+        break;
+      case 'mousemove':
+        this._evtMousemove(event as MouseEvent);
+        break;
+      case 'keydown':
+        this._evtKeydown(event as KeyboardEvent);
+        break;
+      case 'click':
+        this._evtClick(event as MouseEvent);
+        break;
+      case 'dblclick':
+        this._evtDblClick(event as MouseEvent);
+        break;
+      case 'dragenter':
+      case 'dragover':
+        this.addClass('jp-mod-native-drop');
+        event.preventDefault();
+        break;
+      case 'dragleave':
+      case 'dragend':
+        this.removeClass('jp-mod-native-drop');
+        break;
+      case 'drop':
+        this.removeClass('jp-mod-native-drop');
+        this._evtNativeDrop(event as DragEvent);
+        break;
+      case 'scroll':
+        this._evtScroll(event as MouseEvent);
+        break;
+      case 'lm-dragenter':
+        this._evtDragEnter(event as IDragEvent);
+        break;
+      case 'lm-dragleave':
+        this._evtDragLeave(event as IDragEvent);
+        break;
+      case 'lm-dragover':
+        this._evtDragOver(event as IDragEvent);
+        break;
+      case 'lm-drop':
+        this._evtDrop(event as IDragEvent);
+        break;
+      default:
+        break;
     }
   }
 
@@ -955,37 +955,37 @@ export class DirListing extends Widget {
    */
   private _evtKeydown(event: KeyboardEvent): void {
     switch (event.keyCode) {
-    case 13: // Enter
-      // Do nothing if any modifier keys are pressed.
-      if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) {
-        return;
-      }
-      event.preventDefault();
-      event.stopPropagation();
-
-      const selected = Object.keys(this._selection);
-      const name = selected[0];
-      const items = this._sortedItems;
-      const i = ArrayExt.findFirstIndex(items, value => value.name === name);
-      if (i === -1) {
-        return;
-      }
+      case 13: // Enter
+        // Do nothing if any modifier keys are pressed.
+        if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) {
+          return;
+        }
+        event.preventDefault();
+        event.stopPropagation();
+
+        const selected = Object.keys(this._selection);
+        const name = selected[0];
+        const items = this._sortedItems;
+        const i = ArrayExt.findFirstIndex(items, value => value.name === name);
+        if (i === -1) {
+          return;
+        }
 
-      const item = this._sortedItems[i];
-      this._handleOpen(item);
-      break;
-    case 38: // Up arrow
-      this.selectPrevious(event.shiftKey);
-      event.stopPropagation();
-      event.preventDefault();
-      break;
-    case 40: // Down arrow
-      this.selectNext(event.shiftKey);
-      event.stopPropagation();
-      event.preventDefault();
-      break;
-    default:
-      break;
+        const item = this._sortedItems[i];
+        this._handleOpen(item);
+        break;
+      case 38: // Up arrow
+        this.selectPrevious(event.shiftKey);
+        event.stopPropagation();
+        event.preventDefault();
+        break;
+      case 40: // Down arrow
+        this.selectNext(event.shiftKey);
+        event.stopPropagation();
+        event.preventDefault();
+        break;
+      default:
+        break;
     }
 
     // Detects printable characters typed by the user.
@@ -2005,32 +2005,32 @@ namespace Private {
       };
       edit.onkeydown = (event: KeyboardEvent) => {
         switch (event.keyCode) {
-        case 13: // Enter
-          event.stopPropagation();
-          event.preventDefault();
-          edit.blur();
-          break;
-        case 27: // Escape
-          event.stopPropagation();
-          event.preventDefault();
-          edit.blur();
-          break;
-        case 38: // Up arrow
-          event.stopPropagation();
-          event.preventDefault();
-          if (edit.selectionStart !== edit.selectionEnd) {
-            edit.selectionStart = edit.selectionEnd = 0;
-          }
-          break;
-        case 40: // Down arrow
-          event.stopPropagation();
-          event.preventDefault();
-          if (edit.selectionStart !== edit.selectionEnd) {
-            edit.selectionStart = edit.selectionEnd = edit.value.length;
-          }
-          break;
-        default:
-          break;
+          case 13: // Enter
+            event.stopPropagation();
+            event.preventDefault();
+            edit.blur();
+            break;
+          case 27: // Escape
+            event.stopPropagation();
+            event.preventDefault();
+            edit.blur();
+            break;
+          case 38: // Up arrow
+            event.stopPropagation();
+            event.preventDefault();
+            if (edit.selectionStart !== edit.selectionEnd) {
+              edit.selectionStart = edit.selectionEnd = 0;
+            }
+            break;
+          case 40: // Down arrow
+            event.stopPropagation();
+            event.preventDefault();
+            if (edit.selectionStart !== edit.selectionEnd) {
+              edit.selectionStart = edit.selectionEnd = edit.value.length;
+            }
+            break;
+          default:
+            break;
         }
       };
     });

+ 2 - 2
packages/filebrowser/src/model.ts

@@ -593,8 +593,8 @@ export class FileBrowserModel implements IDisposable {
       oldValue && oldValue.path && PathExt.dirname(oldValue.path) === path
         ? oldValue
         : newValue && newValue.path && PathExt.dirname(newValue.path) === path
-          ? newValue
-          : undefined;
+        ? newValue
+        : undefined;
 
     // If either the old value or the new value is in the current path, update.
     if (value) {

+ 7 - 7
packages/filebrowser/src/opendialog.ts

@@ -27,13 +27,13 @@ export namespace FileDialog {
    */
   export interface IDirectoryOptions
     extends Partial<
-    Pick<
-    Dialog.IOptions<Promise<Contents.IModel[]>>,
-    Exclude<
-    keyof Dialog.IOptions<Promise<Contents.IModel[]>>,
-    'body' | 'buttons' | 'defaultButton'
-    >
-    >
+      Pick<
+        Dialog.IOptions<Promise<Contents.IModel[]>>,
+        Exclude<
+          keyof Dialog.IOptions<Promise<Contents.IModel[]>>,
+          'body' | 'buttons' | 'defaultButton'
+        >
+      >
     > {
     /**
      * Document manager

+ 3 - 3
packages/fileeditor-extension/src/commands.ts

@@ -91,9 +91,9 @@ export namespace Commands {
   function getCreateConsoleFunction(
     commands: CommandRegistry
   ): (
-      widget: IDocumentWidget<FileEditor>,
-      args?: ReadonlyPartialJSONObject
-    ) => Promise<void> {
+    widget: IDocumentWidget<FileEditor>,
+    args?: ReadonlyPartialJSONObject
+  ) => Promise<void> {
     return async function createConsole(
       widget: IDocumentWidget<FileEditor>,
       args?: ReadonlyPartialJSONObject

+ 8 - 8
packages/fileeditor/src/widget.ts

@@ -212,11 +212,11 @@ export class FileEditor extends Widget {
       return;
     }
     switch (event.type) {
-    case 'mousedown':
-      this._ensureFocus();
-      break;
-    default:
-      break;
+      case 'mousedown':
+        this._ensureFocus();
+        break;
+      default:
+        break;
     }
   }
 
@@ -301,8 +301,8 @@ export namespace FileEditor {
  * A widget factory for editors.
  */
 export class FileEditorFactory extends ABCWidgetFactory<
-IDocumentWidget<FileEditor>,
-DocumentRegistry.ICodeModel
+  IDocumentWidget<FileEditor>,
+  DocumentRegistry.ICodeModel
 > {
   /**
    * Construct a new editor widget factory.
@@ -354,7 +354,7 @@ export namespace FileEditorFactory {
      * The factory options associated with the factory.
      */
     factoryOptions: DocumentRegistry.IWidgetFactoryOptions<
-    IDocumentWidget<FileEditor>
+      IDocumentWidget<FileEditor>
     >;
   }
 }

+ 2 - 2
packages/help-extension/src/index.tsx

@@ -178,8 +178,8 @@ function activate(
 
   // Generate a cache of the kernel help links.
   const kernelInfoCache = new Map<
-  string,
-  KernelMessage.IInfoReplyMsg['content']
+    string,
+    KernelMessage.IInfoReplyMsg['content']
   >();
   serviceManager.sessions.runningChanged.connect((m, sessions) => {
     // If a new session has been added, it is at the back

+ 2 - 2
packages/htmlviewer/src/index.tsx

@@ -209,8 +209,8 @@ export class HTMLViewer extends DocumentWidget<IFrame>
   private _renderPending = false;
   private _parser = new DOMParser();
   private _monitor: ActivityMonitor<
-  DocumentRegistry.IModel,
-  void
+    DocumentRegistry.IModel,
+    void
   > | null = null;
   private _objectUrl: string = '';
   private _trustedChanged = new Signal<this, boolean>(this);

+ 1 - 1
packages/imageviewer/src/widget.ts

@@ -209,7 +209,7 @@ export class ImageViewer extends Widget implements Printing.IPrintable {
  * A widget factory for images.
  */
 export class ImageViewerFactory extends ABCWidgetFactory<
-IDocumentWidget<ImageViewer>
+  IDocumentWidget<ImageViewer>
 > {
   /**
    * Create a new widget given a context.

+ 3 - 3
packages/inspector/src/handler.ts

@@ -176,9 +176,9 @@ export class InspectionHandler implements IDisposable, IInspector.IInspectable {
 
   private _cleared = new Signal<InspectionHandler, void>(this);
   private _connector: IDataConnector<
-  InspectionHandler.IReply,
-  void,
-  InspectionHandler.IRequest
+    InspectionHandler.IReply,
+    void,
+    InspectionHandler.IRequest
   >;
   private _disposed = new Signal<this, void>(this);
   private _editor: CodeEditor.IEditor | null = null;

+ 3 - 3
packages/inspector/src/kernelconnector.ts

@@ -13,9 +13,9 @@ import { InspectionHandler } from './handler';
  * The default connector for making inspection requests from the Jupyter API.
  */
 export class KernelConnector extends DataConnector<
-InspectionHandler.IReply,
-void,
-InspectionHandler.IRequest
+  InspectionHandler.IReply,
+  void,
+  InspectionHandler.IRequest
 > {
   /**
    * Create a new kernel connector for inspection requests.

+ 1 - 1
packages/launcher-extension/src/index.ts

@@ -94,5 +94,5 @@ namespace Private {
   /**
    * The incrementing id used for launcher widgets.
    */
-  export let id = 0;
+  export const id = 0;
 }

+ 2 - 2
packages/launcher/src/index.tsx

@@ -457,8 +457,8 @@ namespace Private {
    * An attached property for an item's key.
    */
   export const keyProperty = new AttachedProperty<
-  ILauncher.IItemOptions,
-  number
+    ILauncher.IItemOptions,
+    number
   >({
     name: 'key',
     create: () => id++

+ 8 - 8
packages/logconsole-extension/src/index.tsx

@@ -143,8 +143,8 @@ function activateLogConsole(
       options.source !== undefined
         ? options.source
         : nbtracker.currentWidget
-          ? nbtracker.currentWidget.context.path
-          : null;
+        ? nbtracker.currentWidget.context.path
+        : null;
 
     logConsoleWidget = new MainAreaWidget({ content: logConsolePanel });
     logConsoleWidget.addClass('jp-LogConsole');
@@ -388,12 +388,12 @@ export class LogLevelSwitcher extends ReactWidget {
             logger === null
               ? []
               : [
-                'Critical',
-                'Error',
-                'Warning',
-                'Info',
-                'Debug'
-              ].map(label => ({ label, value: label.toLowerCase() }))
+                  'Critical',
+                  'Error',
+                  'Warning',
+                  'Info',
+                  'Debug'
+                ].map(label => ({ label, value: label.toLowerCase() }))
           }
         />
       </>

+ 21 - 21
packages/logconsole/src/logger.ts

@@ -314,27 +314,27 @@ export class Logger implements ILogger {
     }
     let output: nbformat.IOutput | null = null;
     switch (log.type) {
-    case 'text':
-      output = {
-        output_type: 'display_data',
-        data: {
-          'text/plain': log.data
-        }
-      };
-      break;
-    case 'html':
-      output = {
-        output_type: 'display_data',
-        data: {
-          'text/html': log.data
-        }
-      };
-      break;
-    case 'output':
-      output = log.data;
-      break;
-    default:
-      break;
+      case 'text':
+        output = {
+          output_type: 'display_data',
+          data: {
+            'text/plain': log.data
+          }
+        };
+        break;
+      case 'html':
+        output = {
+          output_type: 'display_data',
+          data: {
+            'text/html': log.data
+          }
+        };
+        break;
+      case 'output':
+        output = log.data;
+        break;
+      default:
+        break;
     }
 
     if (output) {

+ 4 - 4
packages/logconsole/src/tokens.ts

@@ -125,10 +125,10 @@ export type IContentChange = 'append' | 'clear';
 
 export type IStateChange =
   | IChangedArgs<
-  IRenderMimeRegistry | null,
-  IRenderMimeRegistry | null,
-  'rendermime'
-  >
+      IRenderMimeRegistry | null,
+      IRenderMimeRegistry | null,
+      'rendermime'
+    >
   | IChangedArgs<LogLevel, LogLevel, 'level'>;
 
 export interface ILoggerOutputAreaModel extends IOutputAreaModel {

+ 4 - 4
packages/logconsole/src/widget.ts

@@ -308,8 +308,8 @@ export class LogConsolePanel extends StackedPanel {
    * Signal for source changes
    */
   get sourceChanged(): ISignal<
-  this,
-  IChangedArgs<string | null, string | null, 'source'>
+    this,
+    IChangedArgs<string | null, string | null, 'source'>
   > {
     return this._sourceChanged;
   }
@@ -474,8 +474,8 @@ export class LogConsolePanel extends StackedPanel {
   private _outputAreas = new Map<string, LogConsoleOutputArea>();
   private _source: string | null = null;
   private _sourceChanged = new Signal<
-  this,
-  IChangedArgs<string | null, string | null, 'source'>
+    this,
+    IChangedArgs<string | null, string | null, 'source'>
   >(this);
   private _sourceDisplayed = new Signal<this, ISourceDisplayed>(this);
   private _placeholder: Widget;

+ 24 - 24
packages/markdownviewer/src/widget.ts

@@ -94,30 +94,30 @@ export class MarkdownViewer extends Widget {
     this._config[option] = value;
     const { style } = this.renderer.node;
     switch (option) {
-    case 'fontFamily':
-      style.setProperty('font-family', value as string | null);
-      break;
-    case 'fontSize':
-      style.setProperty('font-size', value ? value + 'px' : null);
-      break;
-    case 'hideFrontMatter':
-      this.update();
-      break;
-    case 'lineHeight':
-      style.setProperty('line-height', value ? value.toString() : null);
-      break;
-    case 'lineWidth':
-      const padding = value ? `calc(50% - ${(value as number) / 2}ch)` : null;
-      style.setProperty('padding-left', padding);
-      style.setProperty('padding-right', padding);
-      break;
-    case 'renderTimeout':
-      if (this._monitor) {
-        this._monitor.timeout = value as number;
-      }
-      break;
-    default:
-      break;
+      case 'fontFamily':
+        style.setProperty('font-family', value as string | null);
+        break;
+      case 'fontSize':
+        style.setProperty('font-size', value ? value + 'px' : null);
+        break;
+      case 'hideFrontMatter':
+        this.update();
+        break;
+      case 'lineHeight':
+        style.setProperty('line-height', value ? value.toString() : null);
+        break;
+      case 'lineWidth':
+        const padding = value ? `calc(50% - ${(value as number) / 2}ch)` : null;
+        style.setProperty('padding-left', padding);
+        style.setProperty('padding-right', padding);
+        break;
+      case 'renderTimeout':
+        if (this._monitor) {
+          this._monitor.timeout = value as number;
+        }
+        break;
+      default:
+        break;
     }
   }
 

+ 13 - 13
packages/notebook-extension/src/index.ts

@@ -443,15 +443,15 @@ function activateNotebookTools(
   // Create message hook for triggers to save to the database.
   const hook = (sender: any, message: Message): boolean => {
     switch (message.type) {
-    case 'activate-request':
-      void state.save(id, { open: true });
-      break;
-    case 'after-hide':
-    case 'close-request':
-      void state.remove(id);
-      break;
-    default:
-      break;
+      case 'activate-request':
+        void state.save(id, { open: true });
+        break;
+      case 'after-hide':
+      case 'close-request':
+        void state.remove(id);
+        break;
+      default:
+        break;
     }
     return true;
   };
@@ -549,7 +549,7 @@ function activateNotebookHandler(
   const { commands } = app;
   const tracker = new NotebookTracker({ namespace: 'notebook' });
   const clonedOutputs = new WidgetTracker<
-  MainAreaWidget<Private.ClonedOutputArea>
+    MainAreaWidget<Private.ClonedOutputArea>
   >({
     namespace: 'cloned-outputs'
   });
@@ -2383,9 +2383,9 @@ namespace Private {
     get index(): number {
       return this._cell
         ? ArrayExt.findFirstIndex(
-          this._notebook.content.widgets,
-          c => c === this._cell
-        )
+            this._notebook.content.widgets,
+            c => c === this._cell
+          )
         : this._index;
     }
 

+ 104 - 104
packages/notebook/src/actions.tsx

@@ -906,12 +906,12 @@ export namespace NotebookActions {
 
     const newCells = values.map(cell => {
       switch (cell.cell_type) {
-      case 'code':
-        return model.contentFactory.createCodeCell({ cell });
-      case 'markdown':
-        return model.contentFactory.createMarkdownCell({ cell });
-      default:
-        return model.contentFactory.createRawCell({ cell });
+        case 'code':
+          return model.contentFactory.createCodeCell({ cell });
+        case 'markdown':
+          return model.contentFactory.createMarkdownCell({ cell });
+        default:
+          return model.contentFactory.createRawCell({ cell });
       }
     });
 
@@ -922,35 +922,35 @@ export namespace NotebookActions {
 
     // Set the starting index of the paste operation depending upon the mode.
     switch (mode) {
-    case 'below':
-      index = notebook.activeCellIndex;
-      break;
-    case 'above':
-      index = notebook.activeCellIndex - 1;
-      break;
-    case 'replace':
-      // Find the cells to delete.
-      const toDelete: number[] = [];
-
-      notebook.widgets.forEach((child, index) => {
-        const deletable = child.model.metadata.get('deletable') !== false;
-
-        if (notebook.isSelectedOrActive(child) && deletable) {
-          toDelete.push(index);
-        }
-      });
-
-      // If cells are not deletable, we may not have anything to delete.
-      if (toDelete.length > 0) {
-        // Delete the cells as one undo event.
-        toDelete.reverse().forEach(i => {
-          cells.remove(i);
+      case 'below':
+        index = notebook.activeCellIndex;
+        break;
+      case 'above':
+        index = notebook.activeCellIndex - 1;
+        break;
+      case 'replace':
+        // Find the cells to delete.
+        const toDelete: number[] = [];
+
+        notebook.widgets.forEach((child, index) => {
+          const deletable = child.model.metadata.get('deletable') !== false;
+
+          if (notebook.isSelectedOrActive(child) && deletable) {
+            toDelete.push(index);
+          }
         });
-      }
-      index = toDelete[0];
-      break;
-    default:
-      break;
+
+        // If cells are not deletable, we may not have anything to delete.
+        if (toDelete.length > 0) {
+          // Delete the cells as one undo event.
+          toDelete.reverse().forEach(i => {
+            cells.remove(i);
+          });
+        }
+        index = toDelete[0];
+        break;
+      default:
+        break;
     }
 
     newCells.forEach(cell => {
@@ -1479,15 +1479,15 @@ namespace Private {
     cell: ICellModel
   ): ICellModel {
     switch (cell.type) {
-    case 'code':
-      // TODO why isn't modeldb or id passed here?
-      return model.contentFactory.createCodeCell({ cell: cell.toJSON() });
-    case 'markdown':
-      // TODO why isn't modeldb or id passed here?
-      return model.contentFactory.createMarkdownCell({ cell: cell.toJSON() });
-    default:
-      // TODO why isn't modeldb or id passed here?
-      return model.contentFactory.createRawCell({ cell: cell.toJSON() });
+      case 'code':
+        // TODO why isn't modeldb or id passed here?
+        return model.contentFactory.createCodeCell({ cell: cell.toJSON() });
+      case 'markdown':
+        // TODO why isn't modeldb or id passed here?
+        return model.contentFactory.createMarkdownCell({ cell: cell.toJSON() });
+      default:
+        // TODO why isn't modeldb or id passed here?
+        return model.contentFactory.createRawCell({ cell: cell.toJSON() });
     }
   }
 
@@ -1557,58 +1557,58 @@ namespace Private {
     sessionContext?: ISessionContext
   ): Promise<boolean> {
     switch (cell.model.type) {
-    case 'markdown':
-      (cell as MarkdownCell).rendered = true;
-      cell.inputHidden = false;
-      executed.emit({ notebook, cell });
-      break;
-    case 'code':
-      if (sessionContext) {
-        const deletedCells = notebook.model?.deletedCells ?? [];
-        return CodeCell.execute(cell as CodeCell, sessionContext, {
-          deletedCells,
-          recordTiming: notebook.notebookConfig.recordTiming
-        })
-          .then(reply => {
-            deletedCells.splice(0, deletedCells.length);
-            if (cell.isDisposed) {
-              return false;
-            }
+      case 'markdown':
+        (cell as MarkdownCell).rendered = true;
+        cell.inputHidden = false;
+        executed.emit({ notebook, cell });
+        break;
+      case 'code':
+        if (sessionContext) {
+          const deletedCells = notebook.model?.deletedCells ?? [];
+          return CodeCell.execute(cell as CodeCell, sessionContext, {
+            deletedCells,
+            recordTiming: notebook.notebookConfig.recordTiming
+          })
+            .then(reply => {
+              deletedCells.splice(0, deletedCells.length);
+              if (cell.isDisposed) {
+                return false;
+              }
 
-            if (!reply) {
-              return true;
-            }
+              if (!reply) {
+                return true;
+              }
 
-            if (reply.content.status === 'ok') {
-              const content = reply.content;
+              if (reply.content.status === 'ok') {
+                const content = reply.content;
 
-              if (content.payload && content.payload.length) {
-                handlePayload(content, notebook, cell);
-              }
+                if (content.payload && content.payload.length) {
+                  handlePayload(content, notebook, cell);
+                }
 
-              return true;
-            } else {
-              throw new Error('KernelReplyNotOK');
-            }
-          })
-          .catch(reason => {
-            if (cell.isDisposed || reason.message.startsWith('Canceled')) {
-              return false;
-            }
-            throw reason;
-          })
-          .then(ran => {
-            if (ran) {
-              executed.emit({ notebook, cell });
-            }
+                return true;
+              } else {
+                throw new Error('KernelReplyNotOK');
+              }
+            })
+            .catch(reason => {
+              if (cell.isDisposed || reason.message.startsWith('Canceled')) {
+                return false;
+              }
+              throw reason;
+            })
+            .then(ran => {
+              if (ran) {
+                executed.emit({ notebook, cell });
+              }
 
-            return ran;
-          });
-      }
-      (cell.model as ICodeCellModel).clearExecution();
-      break;
-    default:
-      break;
+              return ran;
+            });
+        }
+        (cell.model as ICodeCellModel).clearExecution();
+        break;
+      default:
+        break;
     }
 
     return Promise.resolve(true);
@@ -1723,20 +1723,20 @@ namespace Private {
         let newCell: ICellModel;
 
         switch (value) {
-        case 'code':
-          newCell = model.contentFactory.createCodeCell({ cell });
-          break;
-        case 'markdown':
-          newCell = model.contentFactory.createMarkdownCell({ cell });
-          if (child.model.type === 'code') {
-            newCell.trusted = false;
-          }
-          break;
-        default:
-          newCell = model.contentFactory.createRawCell({ cell });
-          if (child.model.type === 'code') {
-            newCell.trusted = false;
-          }
+          case 'code':
+            newCell = model.contentFactory.createCodeCell({ cell });
+            break;
+          case 'markdown':
+            newCell = model.contentFactory.createMarkdownCell({ cell });
+            if (child.model.type === 'code') {
+              newCell.trusted = false;
+            }
+            break;
+          default:
+            newCell = model.contentFactory.createRawCell({ cell });
+            if (child.model.type === 'code') {
+              newCell.trusted = false;
+            }
         }
         cells.set(index, newCell);
       }

+ 9 - 9
packages/notebook/src/celllist.ts

@@ -475,15 +475,15 @@ export class CellList implements IObservableUndoableList<ICellModel> {
           const cellType = cellDB.createValue(id + '.type');
           let cell: ICellModel;
           switch (cellType.get()) {
-          case 'code':
-            cell = this._factory.createCodeCell({ id: id });
-            break;
-          case 'markdown':
-            cell = this._factory.createMarkdownCell({ id: id });
-            break;
-          default:
-            cell = this._factory.createRawCell({ id: id });
-            break;
+            case 'code':
+              cell = this._factory.createCodeCell({ id: id });
+              break;
+            case 'markdown':
+              cell = this._factory.createMarkdownCell({ id: id });
+              break;
+            default:
+              cell = this._factory.createRawCell({ id: id });
+              break;
           }
           this._cellMap.set(id, cell);
         }

+ 32 - 32
packages/notebook/src/model.ts

@@ -213,17 +213,17 @@ export class NotebookModel extends DocumentModel implements INotebookModel {
     const factory = this.contentFactory;
     for (const cell of value.cells) {
       switch (cell.cell_type) {
-      case 'code':
-        cells.push(factory.createCodeCell({ cell }));
-        break;
-      case 'markdown':
-        cells.push(factory.createMarkdownCell({ cell }));
-        break;
-      case 'raw':
-        cells.push(factory.createRawCell({ cell }));
-        break;
-      default:
-        continue;
+        case 'code':
+          cells.push(factory.createCodeCell({ cell }));
+          break;
+        case 'markdown':
+          cells.push(factory.createMarkdownCell({ cell }));
+          break;
+        case 'raw':
+          cells.push(factory.createRawCell({ cell }));
+          break;
+        default:
+          continue;
       }
     }
     this.cells.beginCompoundOperation();
@@ -307,20 +307,20 @@ export class NotebookModel extends DocumentModel implements INotebookModel {
     change: IObservableList.IChangedArgs<ICellModel>
   ): void {
     switch (change.type) {
-    case 'add':
-      change.newValues.forEach(cell => {
-        cell.contentChanged.connect(this.triggerContentChange, this);
-      });
-      break;
-    case 'remove':
-      break;
-    case 'set':
-      change.newValues.forEach(cell => {
-        cell.contentChanged.connect(this.triggerContentChange, this);
-      });
-      break;
-    default:
-      break;
+      case 'add':
+        change.newValues.forEach(cell => {
+          cell.contentChanged.connect(this.triggerContentChange, this);
+        });
+        break;
+      case 'remove':
+        break;
+      case 'set':
+        change.newValues.forEach(cell => {
+          cell.contentChanged.connect(this.triggerContentChange, this);
+        });
+        break;
+      default:
+        break;
     }
     this.triggerContentChange();
   }
@@ -469,13 +469,13 @@ export namespace NotebookModel {
      */
     createCell(type: nbformat.CellType, opts: CellModel.IOptions): ICellModel {
       switch (type) {
-      case 'code':
-        return this.createCodeCell(opts);
-      case 'markdown':
-        return this.createMarkdownCell(opts);
-      case 'raw':
-      default:
-        return this.createRawCell(opts);
+        case 'code':
+          return this.createCodeCell(opts);
+        case 'markdown':
+          return this.createMarkdownCell(opts);
+        case 'raw':
+        default:
+          return this.createRawCell(opts);
       }
     }
 

+ 1 - 1
packages/notebook/src/modelfactory.ts

@@ -15,7 +15,7 @@ import { INotebookModel, NotebookModel } from './model';
  * A model factory for notebooks.
  */
 export class NotebookModelFactory
-implements DocumentRegistry.IModelFactory<INotebookModel> {
+  implements DocumentRegistry.IModelFactory<INotebookModel> {
   /**
    * Construct a new notebook model factory.
    */

+ 24 - 24
packages/notebook/src/notebooktools.ts

@@ -326,25 +326,25 @@ export namespace NotebookTools {
     processMessage(msg: Message): void {
       super.processMessage(msg);
       switch (msg.type) {
-      case 'activenotebookpanel-changed':
-        this.onActiveNotebookPanelChanged(msg);
-        break;
-      case 'activecell-changed':
-        this.onActiveCellChanged(msg);
-        break;
-      case 'selection-changed':
-        this.onSelectionChanged(msg);
-        break;
-      case 'activecell-metadata-changed':
-        this.onActiveCellMetadataChanged(msg as ObservableJSON.ChangeMessage);
-        break;
-      case 'activenotebookpanel-metadata-changed':
-        this.onActiveNotebookPanelMetadataChanged(
-          msg as ObservableJSON.ChangeMessage
-        );
-        break;
-      default:
-        break;
+        case 'activenotebookpanel-changed':
+          this.onActiveNotebookPanelChanged(msg);
+          break;
+        case 'activecell-changed':
+          this.onActiveCellChanged(msg);
+          break;
+        case 'selection-changed':
+          this.onSelectionChanged(msg);
+          break;
+        case 'activecell-metadata-changed':
+          this.onActiveCellMetadataChanged(msg as ObservableJSON.ChangeMessage);
+          break;
+        case 'activenotebookpanel-metadata-changed':
+          this.onActiveNotebookPanelMetadataChanged(
+            msg as ObservableJSON.ChangeMessage
+          );
+          break;
+        default:
+          break;
       }
     }
 
@@ -648,11 +648,11 @@ export namespace NotebookTools {
      */
     handleEvent(event: Event): void {
       switch (event.type) {
-      case 'change':
-        this.onValueChanged();
-        break;
-      default:
-        break;
+        case 'change':
+          this.onValueChanged();
+          break;
+        default:
+          break;
       }
     }
 

+ 1 - 1
packages/notebook/src/truststatus.tsx

@@ -85,7 +85,7 @@ namespace NotebookTrustComponent {
  * The NotebookTrust status item.
  */
 export class NotebookTrustStatus extends VDomRenderer<
-NotebookTrustStatus.Model
+  NotebookTrustStatus.Model
 > {
   /**
    * Construct a new status item.

+ 147 - 147
packages/notebook/src/widget.ts

@@ -325,11 +325,11 @@ export class StaticNotebook extends Widget {
     args: IObservableMap.IChangedArgs<ReadonlyPartialJSONValue>
   ): void {
     switch (args.key) {
-    case 'language_info':
-      this._updateMimetype();
-      break;
-    default:
-      break;
+      case 'language_info':
+        this._updateMimetype();
+        break;
+      default:
+        break;
     }
   }
 
@@ -406,50 +406,50 @@ export class StaticNotebook extends Widget {
   ) {
     let index = 0;
     switch (args.type) {
-    case 'add':
-      index = args.newIndex;
-      each(args.newValues, value => {
-        this._insertCell(index++, value);
-      });
-      break;
-    case 'move':
-      this._moveCell(args.oldIndex, args.newIndex);
-      break;
-    case 'remove':
-      each(args.oldValues, value => {
-        this._removeCell(args.oldIndex);
-      });
-      // Add default cell if there are no cells remaining.
-      if (!sender.length) {
-        const model = this.model;
-        // Add the cell in a new context to avoid triggering another
-        // cell changed event during the handling of this signal.
-        requestAnimationFrame(() => {
-          if (model && !model.isDisposed && !model.cells.length) {
-            model.cells.push(
-              model.contentFactory.createCell(
-                this.notebookConfig.defaultCell,
-                {}
-              )
-            );
-          }
+      case 'add':
+        index = args.newIndex;
+        each(args.newValues, value => {
+          this._insertCell(index++, value);
         });
-      }
-      break;
-    case 'set':
-      // TODO: reuse existing widgets if possible.
-      index = args.newIndex;
-      each(args.newValues, value => {
-        // Note: this ordering (insert then remove)
-        // is important for getting the active cell
-        // index for the editable notebook correct.
-        this._insertCell(index, value);
-        this._removeCell(index + 1);
-        index++;
-      });
-      break;
-    default:
-      return;
+        break;
+      case 'move':
+        this._moveCell(args.oldIndex, args.newIndex);
+        break;
+      case 'remove':
+        each(args.oldValues, value => {
+          this._removeCell(args.oldIndex);
+        });
+        // Add default cell if there are no cells remaining.
+        if (!sender.length) {
+          const model = this.model;
+          // Add the cell in a new context to avoid triggering another
+          // cell changed event during the handling of this signal.
+          requestAnimationFrame(() => {
+            if (model && !model.isDisposed && !model.cells.length) {
+              model.cells.push(
+                model.contentFactory.createCell(
+                  this.notebookConfig.defaultCell,
+                  {}
+                )
+              );
+            }
+          });
+        }
+        break;
+      case 'set':
+        // TODO: reuse existing widgets if possible.
+        index = args.newIndex;
+        each(args.newValues, value => {
+          // Note: this ordering (insert then remove)
+          // is important for getting the active cell
+          // index for the editable notebook correct.
+          this._insertCell(index, value);
+          this._removeCell(index + 1);
+          index++;
+        });
+        break;
+      default:
+        return;
     }
   }
 
@@ -459,18 +459,18 @@ export class StaticNotebook extends Widget {
   private _insertCell(index: number, cell: ICellModel): void {
     let widget: Cell;
     switch (cell.type) {
-    case 'code':
-      widget = this._createCodeCell(cell as ICodeCellModel);
-      widget.model.mimeType = this._mimetype;
-      break;
-    case 'markdown':
-      widget = this._createMarkdownCell(cell as IMarkdownCellModel);
-      if (cell.value.text === '') {
-        (widget as MarkdownCell).rendered = false;
-      }
-      break;
-    default:
-      widget = this._createRawCell(cell as IRawCellModel);
+      case 'code':
+        widget = this._createCodeCell(cell as ICodeCellModel);
+        widget.model.mimeType = this._mimetype;
+        break;
+      case 'markdown':
+        widget = this._createMarkdownCell(cell as IMarkdownCellModel);
+        if (cell.value.text === '') {
+          (widget as MarkdownCell).rendered = false;
+        }
+        break;
+      default:
+        widget = this._createRawCell(cell as IRawCellModel);
     }
     widget.addClass(NB_CELL_CLASS);
     const layout = this.layout as PanelLayout;
@@ -599,15 +599,15 @@ export class StaticNotebook extends Widget {
       const cell = this.widgets[i];
       let config: Partial<CodeEditor.IConfig>;
       switch (cell.model.type) {
-      case 'code':
-        config = this._editorConfig.code;
-        break;
-      case 'markdown':
-        config = this._editorConfig.markdown;
-        break;
-      default:
-        config = this._editorConfig.raw;
-        break;
+        case 'code':
+          config = this._editorConfig.code;
+          break;
+        case 'markdown':
+          config = this._editorConfig.markdown;
+          break;
+        default:
+          config = this._editorConfig.raw;
+          break;
       }
       Object.keys(config).forEach((key: keyof CodeEditor.IConfig) => {
         cell.editor.setOption(key, config[key] ?? null);
@@ -1158,8 +1158,8 @@ export class Notebook extends StaticNotebook {
    * selection.
    */
   getContiguousSelection():
-  | { head: number; anchor: number }
-  | { head: null; anchor: null } {
+    | { head: number; anchor: number }
+    | { head: null; anchor: null } {
     const cells = this.widgets;
     const first = ArrayExt.findFirstIndex(cells, c => this.isSelected(c));
 
@@ -1247,54 +1247,54 @@ export class Notebook extends StaticNotebook {
     }
 
     switch (event.type) {
-    case 'contextmenu':
-      if (event.eventPhase === Event.CAPTURING_PHASE) {
-        this._evtContextMenuCapture(event as PointerEvent);
-      }
-      break;
-    case 'mousedown':
-      if (event.eventPhase === Event.CAPTURING_PHASE) {
-        this._evtMouseDownCapture(event as MouseEvent);
-      } else {
-        this._evtMouseDown(event as MouseEvent);
-      }
-      break;
-    case 'mouseup':
-      if (event.currentTarget === document) {
-        this._evtDocumentMouseup(event as MouseEvent);
-      }
-      break;
-    case 'mousemove':
-      if (event.currentTarget === document) {
-        this._evtDocumentMousemove(event as MouseEvent);
-      }
-      break;
-    case 'keydown':
-      this._ensureFocus(true);
-      break;
-    case 'dblclick':
-      this._evtDblClick(event as MouseEvent);
-      break;
-    case 'focusin':
-      this._evtFocusIn(event as MouseEvent);
-      break;
-    case 'focusout':
-      this._evtFocusOut(event as MouseEvent);
-      break;
-    case 'lm-dragenter':
-      this._evtDragEnter(event as IDragEvent);
-      break;
-    case 'lm-dragleave':
-      this._evtDragLeave(event as IDragEvent);
-      break;
-    case 'lm-dragover':
-      this._evtDragOver(event as IDragEvent);
-      break;
-    case 'lm-drop':
-      this._evtDrop(event as IDragEvent);
-      break;
-    default:
-      break;
+      case 'contextmenu':
+        if (event.eventPhase === Event.CAPTURING_PHASE) {
+          this._evtContextMenuCapture(event as PointerEvent);
+        }
+        break;
+      case 'mousedown':
+        if (event.eventPhase === Event.CAPTURING_PHASE) {
+          this._evtMouseDownCapture(event as MouseEvent);
+        } else {
+          this._evtMouseDown(event as MouseEvent);
+        }
+        break;
+      case 'mouseup':
+        if (event.currentTarget === document) {
+          this._evtDocumentMouseup(event as MouseEvent);
+        }
+        break;
+      case 'mousemove':
+        if (event.currentTarget === document) {
+          this._evtDocumentMousemove(event as MouseEvent);
+        }
+        break;
+      case 'keydown':
+        this._ensureFocus(true);
+        break;
+      case 'dblclick':
+        this._evtDblClick(event as MouseEvent);
+        break;
+      case 'focusin':
+        this._evtFocusIn(event as MouseEvent);
+        break;
+      case 'focusout':
+        this._evtFocusOut(event as MouseEvent);
+        break;
+      case 'lm-dragenter':
+        this._evtDragEnter(event as IDragEvent);
+        break;
+      case 'lm-dragleave':
+        this._evtDragLeave(event as IDragEvent);
+        break;
+      case 'lm-dragover':
+        this._evtDragOver(event as IDragEvent);
+        break;
+      case 'lm-drop':
+        this._evtDrop(event as IDragEvent);
+        break;
+      default:
+        break;
     }
   }
 
@@ -1802,25 +1802,25 @@ export class Notebook extends StaticNotebook {
 
     // If in select mode, update the selection
     switch (this._mouseMode) {
-    case 'select':
-      const target = event.target as HTMLElement;
-      const index = this._findCell(target);
-      if (index !== -1) {
-        this.extendContiguousSelectionTo(index);
-      }
-      break;
-    case 'couldDrag':
-      // Check for a drag initialization.
-      const data = this._dragData!;
-      const dx = Math.abs(event.clientX - data.pressX);
-      const dy = Math.abs(event.clientY - data.pressY);
-      if (dx >= DRAG_THRESHOLD || dy >= DRAG_THRESHOLD) {
-        this._mouseMode = null;
-        this._startDrag(data.index, event.clientX, event.clientY);
-      }
-      break;
-    default:
-      break;
+      case 'select':
+        const target = event.target as HTMLElement;
+        const index = this._findCell(target);
+        if (index !== -1) {
+          this.extendContiguousSelectionTo(index);
+        }
+        break;
+      case 'couldDrag':
+        // Check for a drag initialization.
+        const data = this._dragData!;
+        const dx = Math.abs(event.clientX - data.pressX);
+        const dy = Math.abs(event.clientY - data.pressY);
+        if (dx >= DRAG_THRESHOLD || dy >= DRAG_THRESHOLD) {
+          this._mouseMode = null;
+          this._startDrag(data.index, event.clientX, event.clientY);
+        }
+        break;
+      default:
+        break;
     }
   }
 
@@ -1961,15 +1961,15 @@ export class Notebook extends StaticNotebook {
       each(values, (cell: nbformat.ICell) => {
         let value: ICellModel;
         switch (cell.cell_type) {
-        case 'code':
-          value = factory.createCodeCell({ cell });
-          break;
-        case 'markdown':
-          value = factory.createMarkdownCell({ cell });
-          break;
-        default:
-          value = factory.createRawCell({ cell });
-          break;
+          case 'code':
+            value = factory.createCodeCell({ cell });
+            break;
+          case 'markdown':
+            value = factory.createMarkdownCell({ cell });
+            break;
+          default:
+            value = factory.createRawCell({ cell });
+            break;
         }
         model.cells.insert(index++, value);
       });

+ 2 - 2
packages/notebook/src/widgetfactory.ts

@@ -24,8 +24,8 @@ import {
  * A widget factory for notebook panels.
  */
 export class NotebookWidgetFactory extends ABCWidgetFactory<
-NotebookPanel,
-INotebookModel
+  NotebookPanel,
+  INotebookModel
 > {
   /**
    * Construct a new notebook widget factory.

+ 1 - 1
packages/observables/src/observablejson.ts

@@ -31,7 +31,7 @@ export namespace IObservableJSON {
    * A type alias for observable JSON changed args.
    */
   export type IChangedArgs = IObservableMap.IChangedArgs<
-  ReadonlyPartialJSONValue
+    ReadonlyPartialJSONValue
   >;
 }
 

+ 45 - 45
packages/observables/src/undoablelist.ts

@@ -194,28 +194,28 @@ export class ObservableUndoableList<T> extends ObservableList<T>
     let index = 0;
     const serializer = this._serializer;
     switch (change.type) {
-    case 'add':
-      each(change.newValues, () => {
-        this.remove(change.newIndex);
-      });
-      break;
-    case 'set':
-      index = change.oldIndex;
-      each(change.oldValues, value => {
-        this.set(index++, serializer.fromJSON(value));
-      });
-      break;
-    case 'remove':
-      index = change.oldIndex;
-      each(change.oldValues, value => {
-        this.insert(index++, serializer.fromJSON(value));
-      });
-      break;
-    case 'move':
-      this.move(change.newIndex, change.oldIndex);
-      break;
-    default:
-      return;
+      case 'add':
+        each(change.newValues, () => {
+          this.remove(change.newIndex);
+        });
+        break;
+      case 'set':
+        index = change.oldIndex;
+        each(change.oldValues, value => {
+          this.set(index++, serializer.fromJSON(value));
+        });
+        break;
+      case 'remove':
+        index = change.oldIndex;
+        each(change.oldValues, value => {
+          this.insert(index++, serializer.fromJSON(value));
+        });
+        break;
+      case 'move':
+        this.move(change.newIndex, change.oldIndex);
+        break;
+      default:
+        return;
     }
   }
 
@@ -226,28 +226,28 @@ export class ObservableUndoableList<T> extends ObservableList<T>
     let index = 0;
     const serializer = this._serializer;
     switch (change.type) {
-    case 'add':
-      index = change.newIndex;
-      each(change.newValues, value => {
-        this.insert(index++, serializer.fromJSON(value));
-      });
-      break;
-    case 'set':
-      index = change.newIndex;
-      each(change.newValues, value => {
-        this.set(change.newIndex++, serializer.fromJSON(value));
-      });
-      break;
-    case 'remove':
-      each(change.oldValues, () => {
-        this.remove(change.oldIndex);
-      });
-      break;
-    case 'move':
-      this.move(change.oldIndex, change.newIndex);
-      break;
-    default:
-      return;
+      case 'add':
+        index = change.newIndex;
+        each(change.newValues, value => {
+          this.insert(index++, serializer.fromJSON(value));
+        });
+        break;
+      case 'set':
+        index = change.newIndex;
+        each(change.newValues, value => {
+          this.set(change.newIndex++, serializer.fromJSON(value));
+        });
+        break;
+      case 'remove':
+        each(change.oldValues, () => {
+          this.remove(change.oldIndex);
+        });
+        break;
+      case 'move':
+        this.move(change.oldIndex, change.newIndex);
+        break;
+      default:
+        return;
     }
   }
 
@@ -290,7 +290,7 @@ export namespace ObservableUndoableList {
    * A default, identity serializer.
    */
   export class IdentitySerializer<T extends JSONValue>
-  implements ISerializer<T> {
+    implements ISerializer<T> {
     /**
      * Identity serialize.
      */

+ 64 - 64
packages/outputarea/src/widget.ts

@@ -148,16 +148,16 @@ export class OutputArea extends Widget {
    * The kernel future associated with the output area.
    */
   get future(): Kernel.IShellFuture<
-  KernelMessage.IExecuteRequestMsg,
-  KernelMessage.IExecuteReplyMsg
+    KernelMessage.IExecuteRequestMsg,
+    KernelMessage.IExecuteReplyMsg
   > {
     return this._future;
   }
 
   set future(
     value: Kernel.IShellFuture<
-    KernelMessage.IExecuteRequestMsg,
-    KernelMessage.IExecuteReplyMsg
+      KernelMessage.IExecuteRequestMsg,
+      KernelMessage.IExecuteReplyMsg
     >
   ) {
     // Bail if the model is disposed.
@@ -214,44 +214,44 @@ export class OutputArea extends Widget {
     args: IOutputAreaModel.ChangedArgs
   ): void {
     switch (args.type) {
-    case 'add':
-      this._insertOutput(args.newIndex, args.newValues[0]);
-      this.outputLengthChanged.emit(this.model.length);
-      break;
-    case 'remove':
-      if (this.widgets.length) {
-        // all items removed from model
-        if (this.model.length === 0) {
-          this._clear();
-        } else {
-          // range of items removed from model
-          // remove widgets corresponding to removed model items
-          const startIndex = args.oldIndex;
-          for (
-            let i = 0;
-            i < args.oldValues.length && startIndex < this.widgets.length;
-            ++i
-          ) {
-            const widget = this.widgets[startIndex];
-            widget.parent = null;
-            widget.dispose();
+      case 'add':
+        this._insertOutput(args.newIndex, args.newValues[0]);
+        this.outputLengthChanged.emit(this.model.length);
+        break;
+      case 'remove':
+        if (this.widgets.length) {
+          // all items removed from model
+          if (this.model.length === 0) {
+            this._clear();
+          } else {
+            // range of items removed from model
+            // remove widgets corresponding to removed model items
+            const startIndex = args.oldIndex;
+            for (
+              let i = 0;
+              i < args.oldValues.length && startIndex < this.widgets.length;
+              ++i
+            ) {
+              const widget = this.widgets[startIndex];
+              widget.parent = null;
+              widget.dispose();
+            }
+
+            // apply item offset to target model item indices in _displayIdMap
+            this._moveDisplayIdIndices(startIndex, args.oldValues.length);
+
+            // prevent jitter caused by immediate height change
+            this._preventHeightChangeJitter();
           }
-
-          // apply item offset to target model item indices in _displayIdMap
-          this._moveDisplayIdIndices(startIndex, args.oldValues.length);
-
-          // prevent jitter caused by immediate height change
-          this._preventHeightChangeJitter();
+          this.outputLengthChanged.emit(this.model.length);
         }
+        break;
+      case 'set':
+        this._setOutput(args.newIndex, args.newValues[0]);
         this.outputLengthChanged.emit(this.model.length);
-      }
-      break;
-    case 'set':
-      this._setOutput(args.newIndex, args.newValues[0]);
-      this.outputLengthChanged.emit(this.model.length);
-      break;
-    default:
-      break;
+        break;
+      default:
+        break;
     }
   }
 
@@ -496,28 +496,28 @@ export class OutputArea extends Widget {
     let targets: number[] | undefined;
 
     switch (msgType) {
-    case 'execute_result':
-    case 'display_data':
-    case 'stream':
-    case 'error':
-      output = { ...msg.content, output_type: msgType };
-      model.add(output);
-      break;
-    case 'clear_output':
-      const wait = (msg as KernelMessage.IClearOutputMsg).content.wait;
-      model.clear(wait);
-      break;
-    case 'update_display_data':
-      output = { ...msg.content, output_type: 'display_data' };
-      targets = this._displayIdMap.get(displayId);
-      if (targets) {
-        for (const index of targets) {
-          model.set(index, output);
+      case 'execute_result':
+      case 'display_data':
+      case 'stream':
+      case 'error':
+        output = { ...msg.content, output_type: msgType };
+        model.add(output);
+        break;
+      case 'clear_output':
+        const wait = (msg as KernelMessage.IClearOutputMsg).content.wait;
+        model.clear(wait);
+        break;
+      case 'update_display_data':
+        output = { ...msg.content, output_type: 'display_data' };
+        targets = this._displayIdMap.get(displayId);
+        if (targets) {
+          for (const index of targets) {
+            model.set(index, output);
+          }
         }
-      }
-      break;
-    default:
-      break;
+        break;
+      default:
+        break;
     }
     if (displayId && msgType === 'display_data') {
       targets = this._displayIdMap.get(displayId) || [];
@@ -557,8 +557,8 @@ export class OutputArea extends Widget {
 
   private _minHeightTimeout: number | null = null;
   private _future: Kernel.IShellFuture<
-  KernelMessage.IExecuteRequestMsg,
-  KernelMessage.IExecuteReplyMsg
+    KernelMessage.IExecuteRequestMsg,
+    KernelMessage.IExecuteReplyMsg
   >;
   private _displayIdMap = new Map<string, number[]>();
 }
@@ -954,8 +954,8 @@ namespace Private {
   }
 
   export const currentPreferredMimetype = new AttachedProperty<
-  IRenderMime.IRenderer,
-  string
+    IRenderMime.IRenderer,
+    string
   >({
     name: 'preferredMimetype',
     create: owner => ''

+ 20 - 20
packages/property-inspector/src/index.ts

@@ -100,24 +100,24 @@ abstract class PropertyInspectorProvider extends Widget
     const owner = sender.owner;
     const current = this._tracker.currentWidget;
     switch (action) {
-    case 'content':
-      if (current === owner) {
-        this.setContent(sender.content);
-      }
-      break;
-    case 'dispose':
-      if (owner) {
-        this._tracker.remove(owner);
-        this._inspectors.delete(owner);
-      }
-      break;
-    case 'show-panel':
-      if (current === owner) {
-        this.showPanel();
-      }
-      break;
-    default:
-      throw new Error('Unsupported inspector action');
+      case 'content':
+        if (current === owner) {
+          this.setContent(sender.content);
+        }
+        break;
+      case 'dispose':
+        if (owner) {
+          this._tracker.remove(owner);
+          this._inspectors.delete(owner);
+        }
+        break;
+      case 'show-panel':
+        if (current === owner) {
+          this.showPanel();
+        }
+        break;
+      default:
+        throw new Error('Unsupported inspector action');
     }
   }
 
@@ -302,8 +302,8 @@ namespace Private {
     private _content: Widget | null = null;
     private _owner: Widget | null = null;
     private _onAction = new Signal<
-    PropertyInspector,
-    Private.PropertyInspectorAction
+      PropertyInspector,
+      Private.PropertyInspectorAction
     >(this);
   }
 }

+ 11 - 11
packages/rendermime-extension/src/index.ts

@@ -79,18 +79,18 @@ function activate(
     linkHandler: !docManager
       ? undefined
       : {
-        handleLink: (node: HTMLElement, path: string, id?: string) => {
-          // If node has the download attribute explicitly set, use the
-          // default browser downloading behavior.
-          if (node.tagName === 'A' && node.hasAttribute('download')) {
-            return;
+          handleLink: (node: HTMLElement, path: string, id?: string) => {
+            // If node has the download attribute explicitly set, use the
+            // default browser downloading behavior.
+            if (node.tagName === 'A' && node.hasAttribute('download')) {
+              return;
+            }
+            app.commandLinker.connectNode(node, CommandIDs.handleLink, {
+              path,
+              id
+            });
           }
-          app.commandLinker.connectNode(node, CommandIDs.handleLink, {
-            path,
-            id
-          });
-        }
-      },
+        },
     latexTypesetter: latexTypesetter ?? undefined
   });
 }

+ 2 - 2
packages/rendermime-interfaces/src/index.ts

@@ -242,8 +242,8 @@ export namespace IRenderMime {
      * The options used to open a document with the renderer factory.
      */
     readonly documentWidgetFactoryOptions?:
-    | IDocumentWidgetFactoryOptions
-    | ReadonlyArray<IDocumentWidgetFactoryOptions>;
+      | IDocumentWidgetFactoryOptions
+      | ReadonlyArray<IDocumentWidgetFactoryOptions>;
 
     /**
      * The optional file type associated with the extension.

+ 4 - 4
packages/rendermime/src/attachmentmodel.ts

@@ -72,10 +72,10 @@ export class AttachmentModel implements IAttachmentModel {
     for (const key in value) {
       // Ignore data and metadata that were stripped.
       switch (key) {
-      case 'data':
-        break;
-      default:
-        this._raw[key] = Private.extract(value, key);
+        case 'data':
+          break;
+        default:
+          this._raw[key] = Private.extract(value, key);
       }
     }
   }

+ 13 - 13
packages/rendermime/src/outputmodel.ts

@@ -95,11 +95,11 @@ export class OutputModel implements IOutputModel {
     for (const key in value) {
       // Ignore data and metadata that were stripped.
       switch (key) {
-      case 'data':
-      case 'metadata':
-        break;
-      default:
-        this._raw[key] = Private.extract(value, key);
+        case 'data':
+        case 'metadata':
+          break;
+        default:
+          this._raw[key] = Private.extract(value, key);
       }
     }
     this.type = value.output_type;
@@ -183,14 +183,14 @@ export class OutputModel implements IOutputModel {
       output[key] = Private.extract(this._raw, key);
     }
     switch (this.type) {
-    case 'display_data':
-    case 'execute_result':
-    case 'update_display_data':
-      output['data'] = this.data as PartialJSONObject;
-      output['metadata'] = this.metadata as PartialJSONObject;
-      break;
-    default:
-      break;
+      case 'display_data':
+      case 'execute_result':
+      case 'update_display_data':
+        output['data'] = this.data as PartialJSONObject;
+        output['metadata'] = this.metadata as PartialJSONObject;
+        break;
+      default:
+        break;
     }
     // Remove transient data.
     delete output['transient'];

+ 87 - 87
packages/rendermime/src/renderers.ts

@@ -1018,93 +1018,93 @@ namespace Private {
       while (numbers.length) {
         const n = numbers.shift();
         switch (n) {
-        case 0:
-          fg = bg = [];
-          bold = false;
-          underline = false;
-          inverse = false;
-          break;
-        case 1:
-        case 5:
-          bold = true;
-          break;
-        case 4:
-          underline = true;
-          break;
-        case 7:
-          inverse = true;
-          break;
-        case 21:
-        case 22:
-          bold = false;
-          break;
-        case 24:
-          underline = false;
-          break;
-        case 27:
-          inverse = false;
-          break;
-        case 30:
-        case 31:
-        case 32:
-        case 33:
-        case 34:
-        case 35:
-        case 36:
-        case 37:
-          fg = n - 30;
-          break;
-        case 38:
-          try {
-            fg = getExtendedColors(numbers);
-          } catch (e) {
-            numbers.length = 0;
-          }
-          break;
-        case 39:
-          fg = [];
-          break;
-        case 40:
-        case 41:
-        case 42:
-        case 43:
-        case 44:
-        case 45:
-        case 46:
-        case 47:
-          bg = n - 40;
-          break;
-        case 48:
-          try {
-            bg = getExtendedColors(numbers);
-          } catch (e) {
-            numbers.length = 0;
-          }
-          break;
-        case 49:
-          bg = [];
-          break;
-        case 90:
-        case 91:
-        case 92:
-        case 93:
-        case 94:
-        case 95:
-        case 96:
-        case 97:
-          fg = n - 90 + 8;
-          break;
-        case 100:
-        case 101:
-        case 102:
-        case 103:
-        case 104:
-        case 105:
-        case 106:
-        case 107:
-          bg = n - 100 + 8;
-          break;
-        default:
+          case 0:
+            fg = bg = [];
+            bold = false;
+            underline = false;
+            inverse = false;
+            break;
+          case 1:
+          case 5:
+            bold = true;
+            break;
+          case 4:
+            underline = true;
+            break;
+          case 7:
+            inverse = true;
+            break;
+          case 21:
+          case 22:
+            bold = false;
+            break;
+          case 24:
+            underline = false;
+            break;
+          case 27:
+            inverse = false;
+            break;
+          case 30:
+          case 31:
+          case 32:
+          case 33:
+          case 34:
+          case 35:
+          case 36:
+          case 37:
+            fg = n - 30;
+            break;
+          case 38:
+            try {
+              fg = getExtendedColors(numbers);
+            } catch (e) {
+              numbers.length = 0;
+            }
+            break;
+          case 39:
+            fg = [];
+            break;
+          case 40:
+          case 41:
+          case 42:
+          case 43:
+          case 44:
+          case 45:
+          case 46:
+          case 47:
+            bg = n - 40;
+            break;
+          case 48:
+            try {
+              bg = getExtendedColors(numbers);
+            } catch (e) {
+              numbers.length = 0;
+            }
+            break;
+          case 49:
+            bg = [];
+            break;
+          case 90:
+          case 91:
+          case 92:
+          case 93:
+          case 94:
+          case 95:
+          case 96:
+          case 97:
+            fg = n - 90 + 8;
+            break;
+          case 100:
+          case 101:
+          case 102:
+          case 103:
+          case 104:
+          case 105:
+          case 106:
+          case 107:
+            bg = n - 100 + 8;
+            break;
+          default:
           // Unknown codes are ignored
         }
       }

+ 69 - 69
packages/services/src/kernel/default.ts

@@ -221,8 +221,8 @@ export class KernelConnection implements Kernel.IKernelConnection {
    */
   clone(
     options: Pick<
-    Kernel.IKernelConnection.IOptions,
-    'clientId' | 'username' | 'handleComms'
+      Kernel.IKernelConnection.IOptions,
+      'clientId' | 'username' | 'handleComms'
     > = {}
   ): Kernel.IKernelConnection {
     return new KernelConnection({
@@ -328,7 +328,7 @@ export class KernelConnection implements Kernel.IKernelConnection {
   ): Kernel.IFuture<
     KernelMessage.IShellControlMessage,
     KernelMessage.IShellControlMessage
-    > {
+  > {
     this._sendMessage(msg);
     this._anyMessage.emit({ msg, direction: 'send' });
 
@@ -574,7 +574,7 @@ export class KernelConnection implements Kernel.IKernelConnection {
       content
     });
     return Private.handleShellMessage(this, msg) as Promise<
-    KernelMessage.ICompleteReplyMsg
+      KernelMessage.ICompleteReplyMsg
     >;
   }
 
@@ -598,7 +598,7 @@ export class KernelConnection implements Kernel.IKernelConnection {
       content: content
     });
     return Private.handleShellMessage(this, msg) as Promise<
-    KernelMessage.IInspectReplyMsg
+      KernelMessage.IInspectReplyMsg
     >;
   }
 
@@ -622,7 +622,7 @@ export class KernelConnection implements Kernel.IKernelConnection {
       content
     });
     return Private.handleShellMessage(this, msg) as Promise<
-    KernelMessage.IHistoryReplyMsg
+      KernelMessage.IHistoryReplyMsg
     >;
   }
 
@@ -648,7 +648,7 @@ export class KernelConnection implements Kernel.IKernelConnection {
   ): Kernel.IShellFuture<
     KernelMessage.IExecuteRequestMsg,
     KernelMessage.IExecuteReplyMsg
-    > {
+  > {
     const defaults: JSONObject = {
       silent: false,
       store_history: true,
@@ -669,8 +669,8 @@ export class KernelConnection implements Kernel.IKernelConnection {
       true,
       disposeOnDone
     ) as Kernel.IShellFuture<
-    KernelMessage.IExecuteRequestMsg,
-    KernelMessage.IExecuteReplyMsg
+      KernelMessage.IExecuteRequestMsg,
+      KernelMessage.IExecuteReplyMsg
     >;
   }
 
@@ -690,7 +690,7 @@ export class KernelConnection implements Kernel.IKernelConnection {
   ): Kernel.IControlFuture<
     KernelMessage.IDebugRequestMsg,
     KernelMessage.IDebugReplyMsg
-    > {
+  > {
     const msg = KernelMessage.createMessage({
       msgType: 'debug_request',
       channel: 'control',
@@ -703,8 +703,8 @@ export class KernelConnection implements Kernel.IKernelConnection {
       true,
       disposeOnDone
     ) as Kernel.IControlFuture<
-    KernelMessage.IDebugRequestMsg,
-    KernelMessage.IDebugReplyMsg
+      KernelMessage.IDebugRequestMsg,
+      KernelMessage.IDebugReplyMsg
     >;
   }
 
@@ -728,7 +728,7 @@ export class KernelConnection implements Kernel.IKernelConnection {
       content
     });
     return Private.handleShellMessage(this, msg) as Promise<
-    KernelMessage.IIsCompleteReplyMsg
+      KernelMessage.IIsCompleteReplyMsg
     >;
   }
 
@@ -750,7 +750,7 @@ export class KernelConnection implements Kernel.IKernelConnection {
       content
     });
     return Private.handleShellMessage(this, msg) as Promise<
-    KernelMessage.ICommInfoReplyMsg
+      KernelMessage.ICommInfoReplyMsg
     >;
   }
 
@@ -1060,11 +1060,11 @@ export class KernelConnection implements Kernel.IKernelConnection {
     this._msgChain = Promise.resolve();
     this._kernelSession = '';
     this._futures = new Map<
-    string,
-    KernelFutureHandler<
-    KernelMessage.IShellControlMessage,
-    KernelMessage.IShellControlMessage
-    >
+      string,
+      KernelFutureHandler<
+        KernelMessage.IShellControlMessage,
+        KernelMessage.IShellControlMessage
+      >
     >();
     this._comms = new Map<string, Kernel.IComm>();
     this._displayIdToParentIds.clear();
@@ -1290,44 +1290,44 @@ export class KernelConnection implements Kernel.IKernelConnection {
     }
     if (msg.channel === 'iopub') {
       switch (msg.header.msg_type) {
-      case 'status':
-        // Updating the status is synchronous, and we call no async user code
-        const executionState = (msg as KernelMessage.IStatusMsg).content
-          .execution_state;
-        if (executionState === 'restarting') {
-          // The kernel has been auto-restarted by the server. After
-          // processing for this message is completely done, we want to
-          // handle this restart, so we don't await, but instead schedule
-          // the work as a microtask (i.e., in a promise resolution). We
-          // schedule this here so that it comes before any microtasks that
-          // might be scheduled in the status signal emission below.
-          void Promise.resolve().then(async () => {
-            // handleRestart changes the status to 'restarting', so we call it
-            // first so that the status won't flip back and forth between
-            // 'restarting' and 'autorestarting'.
-            await this._handleRestart();
-            this._updateStatus('autorestarting');
-          });
-        }
-        this._updateStatus(executionState);
-        break;
-      case 'comm_open':
-        if (this.handleComms) {
-          await this._handleCommOpen(msg as KernelMessage.ICommOpenMsg);
-        }
-        break;
-      case 'comm_msg':
-        if (this.handleComms) {
-          await this._handleCommMsg(msg as KernelMessage.ICommMsgMsg);
-        }
-        break;
-      case 'comm_close':
-        if (this.handleComms) {
-          await this._handleCommClose(msg as KernelMessage.ICommCloseMsg);
-        }
-        break;
-      default:
-        break;
+        case 'status':
+          // Updating the status is synchronous, and we call no async user code
+          const executionState = (msg as KernelMessage.IStatusMsg).content
+            .execution_state;
+          if (executionState === 'restarting') {
+            // The kernel has been auto-restarted by the server. After
+            // processing for this message is completely done, we want to
+            // handle this restart, so we don't await, but instead schedule
+            // the work as a microtask (i.e., in a promise resolution). We
+            // schedule this here so that it comes before any microtasks that
+            // might be scheduled in the status signal emission below.
+            void Promise.resolve().then(async () => {
+              // handleRestart changes the status to 'restarting', so we call it
+              // first so that the status won't flip back and forth between
+              // 'restarting' and 'autorestarting'.
+              await this._handleRestart();
+              this._updateStatus('autorestarting');
+            });
+          }
+          this._updateStatus(executionState);
+          break;
+        case 'comm_open':
+          if (this.handleComms) {
+            await this._handleCommOpen(msg as KernelMessage.ICommOpenMsg);
+          }
+          break;
+        case 'comm_msg':
+          if (this.handleComms) {
+            await this._handleCommMsg(msg as KernelMessage.ICommMsgMsg);
+          }
+          break;
+        case 'comm_close':
+          if (this.handleComms) {
+            await this._handleCommClose(msg as KernelMessage.ICommCloseMsg);
+          }
+          break;
+        default:
+          break;
       }
       // If the message was a status dead message, we might have disposed ourselves.
       if (!this.isDisposed) {
@@ -1453,11 +1453,11 @@ export class KernelConnection implements Kernel.IKernelConnection {
   private _reconnectTimeout: any = null;
 
   private _futures = new Map<
-  string,
-  KernelFutureHandler<
-  KernelMessage.IShellControlMessage,
-  KernelMessage.IShellControlMessage
-  >
+    string,
+    KernelFutureHandler<
+      KernelMessage.IShellControlMessage,
+      KernelMessage.IShellControlMessage
+    >
   >();
   private _comms = new Map<string, Kernel.IComm>();
   private _targetRegistry: {
@@ -1494,13 +1494,13 @@ namespace Private {
    */
   export function logKernelStatus(kernel: Kernel.IKernelConnection): void {
     switch (kernel.status) {
-    case 'idle':
-    case 'busy':
-    case 'unknown':
-      return;
-    default:
-      console.debug(`Kernel: ${kernel.status} (${kernel.id})`);
-      break;
+      case 'idle':
+      case 'busy':
+      case 'unknown':
+        return;
+      default:
+        console.debug(`Kernel: ${kernel.status} (${kernel.id})`);
+        break;
     }
   }
 

+ 17 - 17
packages/services/src/kernel/future.ts

@@ -203,25 +203,25 @@ export abstract class KernelFutureHandler<
    */
   async handleMsg(msg: KernelMessage.IMessage): Promise<void> {
     switch (msg.channel) {
-    case 'control':
-    case 'shell':
-      if (
-        msg.channel === this.msg.channel &&
+      case 'control':
+      case 'shell':
+        if (
+          msg.channel === this.msg.channel &&
           (msg.parent_header as KernelMessage.IHeader<
-          KernelMessage.MessageType
+            KernelMessage.MessageType
           >).msg_id === this.msg.header.msg_id
-      ) {
-        await this._handleReply(msg as REPLY);
-      }
-      break;
-    case 'stdin':
-      await this._handleStdin(msg as KernelMessage.IStdinMessage);
-      break;
-    case 'iopub':
-      await this._handleIOPub(msg as KernelMessage.IIOPubMessage);
-      break;
-    default:
-      break;
+        ) {
+          await this._handleReply(msg as REPLY);
+        }
+        break;
+      case 'stdin':
+        await this._handleStdin(msg as KernelMessage.IStdinMessage);
+        break;
+      case 'iopub':
+        await this._handleIOPub(msg as KernelMessage.IIOPubMessage);
+        break;
+      default:
+        break;
     }
   }
 

+ 8 - 8
packages/services/src/kernel/kernel.ts

@@ -288,8 +288,8 @@ export interface IKernelConnection extends IObservableDisposable {
     disposeOnDone?: boolean,
     metadata?: JSONObject
   ): IShellFuture<
-  KernelMessage.IExecuteRequestMsg,
-  KernelMessage.IExecuteReplyMsg
+    KernelMessage.IExecuteRequestMsg,
+    KernelMessage.IExecuteReplyMsg
   >;
 
   /**
@@ -312,8 +312,8 @@ export interface IKernelConnection extends IObservableDisposable {
     content: KernelMessage.IDebugRequestMsg['content'],
     disposeOnDone?: boolean
   ): IControlFuture<
-  KernelMessage.IDebugRequestMsg,
-  KernelMessage.IDebugReplyMsg
+    KernelMessage.IDebugRequestMsg,
+    KernelMessage.IDebugReplyMsg
   >;
 
   /**
@@ -513,8 +513,8 @@ export interface IKernelConnection extends IObservableDisposable {
    */
   clone(
     options?: Pick<
-    IKernelConnection.IOptions,
-    'clientId' | 'username' | 'handleComms'
+      IKernelConnection.IOptions,
+      'clientId' | 'username' | 'handleComms'
     >
   ): IKernelConnection;
 }
@@ -623,8 +623,8 @@ export interface IManager extends IBaseManager {
   startNew(
     createOptions?: IKernelOptions,
     connectOptions?: Omit<
-    IKernelConnection.IOptions,
-    'model' | 'serverSettings'
+      IKernelConnection.IOptions,
+      'model' | 'serverSettings'
     >
   ): Promise<IKernelConnection>;
 

+ 2 - 2
packages/services/src/kernel/manager.ts

@@ -174,8 +174,8 @@ export class KernelManager extends BaseManager implements Kernel.IManager {
   async startNew(
     createOptions: IKernelOptions = {},
     connectOptions: Omit<
-    Kernel.IKernelConnection.IOptions,
-    'model' | 'serverSettings'
+      Kernel.IKernelConnection.IOptions,
+      'model' | 'serverSettings'
     > = {}
   ): Promise<Kernel.IKernelConnection> {
     const model = await startNew(createOptions, this.serverSettings);

+ 6 - 6
packages/services/src/session/default.ts

@@ -50,8 +50,8 @@ export class SessionConnection implements Session.ISessionConnection {
    * A signal emitted when the kernel changes.
    */
   get kernelChanged(): ISignal<
-  this,
-  Session.ISessionConnection.IKernelChangedArgs
+    this,
+    Session.ISessionConnection.IKernelChangedArgs
   > {
     return this._kernelChanged;
   }
@@ -409,8 +409,8 @@ export class SessionConnection implements Session.ISessionConnection {
   private _isDisposed = false;
   private _disposed = new Signal<this, void>(this);
   private _kernelChanged = new Signal<
-  this,
-  Session.ISessionConnection.IKernelChangedArgs
+    this,
+    Session.ISessionConnection.IKernelChangedArgs
   >(this);
   private _statusChanged = new Signal<this, Kernel.Status>(this);
   private _connectionStatusChanged = new Signal<this, Kernel.ConnectionStatus>(
@@ -424,7 +424,7 @@ export class SessionConnection implements Session.ISessionConnection {
     options: Kernel.IKernelConnection.IOptions
   ) => Kernel.IKernelConnection;
   private _kernelConnectionOptions: Omit<
-  Kernel.IKernelConnection.IOptions,
-  'model' | 'username' | 'clientId' | 'serverSettings'
+    Kernel.IKernelConnection.IOptions,
+    'model' | 'username' | 'clientId' | 'serverSettings'
   >;
 }

+ 4 - 4
packages/services/src/session/manager.ts

@@ -101,8 +101,8 @@ export class SessionManager extends BaseManager implements Session.IManager {
    */
   connectTo(
     options: Omit<
-    Session.ISessionConnection.IOptions,
-    'connectToKernel' | 'serverSettings'
+      Session.ISessionConnection.IOptions,
+      'connectToKernel' | 'serverSettings'
     >
   ): Session.ISessionConnection {
     const sessionConnection = new SessionConnection({
@@ -155,8 +155,8 @@ export class SessionManager extends BaseManager implements Session.IManager {
   async startNew(
     createOptions: Session.ISessionOptions,
     connectOptions: Omit<
-    Session.ISessionConnection.IOptions,
-    'model' | 'connectToKernel' | 'serverSettings'
+      Session.ISessionConnection.IOptions,
+      'model' | 'connectToKernel' | 'serverSettings'
     > = {}
   ): Promise<Session.ISessionConnection> {
     const model = await startSession(createOptions, this.serverSettings);

+ 15 - 15
packages/services/src/session/session.ts

@@ -36,12 +36,12 @@ export interface ISessionConnection extends IObservableDisposable {
    * A signal emitted when the kernel changes.
    */
   kernelChanged: ISignal<
-  this,
-  IChangedArgs<
-  Kernel.IKernelConnection | null,
-  Kernel.IKernelConnection | null,
-  'kernel'
-  >
+    this,
+    IChangedArgs<
+      Kernel.IKernelConnection | null,
+      Kernel.IKernelConnection | null,
+      'kernel'
+    >
   >;
 
   /**
@@ -212,8 +212,8 @@ export namespace ISessionConnection {
      * Kernel connection options
      */
     kernelConnectionOptions?: Omit<
-    Kernel.IKernelConnection.IOptions,
-    'model' | 'username' | 'clientId' | 'serverSettings'
+      Kernel.IKernelConnection.IOptions,
+      'model' | 'username' | 'clientId' | 'serverSettings'
     >;
   }
 
@@ -221,9 +221,9 @@ export namespace ISessionConnection {
    * An arguments object for the kernel changed signal.
    */
   export type IKernelChangedArgs = IChangedArgs<
-  Kernel.IKernelConnection | null,
-  Kernel.IKernelConnection | null,
-  'kernel'
+    Kernel.IKernelConnection | null,
+    Kernel.IKernelConnection | null,
+    'kernel'
   >;
 }
 
@@ -282,8 +282,8 @@ export interface IManager extends IDisposable {
   startNew(
     createOptions: ISessionOptions,
     connectOptions?: Omit<
-    ISessionConnection.IOptions,
-    'model' | 'connectToKernel' | 'serverSettings'
+      ISessionConnection.IOptions,
+      'model' | 'connectToKernel' | 'serverSettings'
     >
   ): Promise<ISessionConnection>;
 
@@ -316,8 +316,8 @@ export interface IManager extends IDisposable {
    */
   connectTo(
     options: Omit<
-    ISessionConnection.IOptions,
-    'connectToKernel' | 'serverSettings'
+      ISessionConnection.IOptions,
+      'connectToKernel' | 'serverSettings'
     >
   ): ISessionConnection;
 

+ 2 - 2
packages/services/src/setting/index.ts

@@ -18,8 +18,8 @@ const SERVICE_SETTINGS_URL = 'api/settings';
  * The settings API service manager.
  */
 export class SettingManager extends DataConnector<
-ISettingRegistry.IPlugin,
-string
+  ISettingRegistry.IPlugin,
+  string
 > {
   /**
    * Create a new setting manager.

+ 2 - 2
packages/services/src/terminal/default.ts

@@ -364,8 +364,8 @@ export class TerminalConnection implements Terminal.ITerminalConnection {
 
   private _connectionStatus: Terminal.ConnectionStatus = 'connecting';
   private _connectionStatusChanged = new Signal<
-  this,
-  Terminal.ConnectionStatus
+    this,
+    Terminal.ConnectionStatus
   >(this);
   private _isDisposed = false;
   private _disposed = new Signal<this, void>(this);

+ 16 - 16
packages/services/src/validate.ts

@@ -19,14 +19,14 @@ export function validateProperty(
   if (typeName !== void 0) {
     let valid = true;
     switch (typeName) {
-    case 'array':
-      valid = Array.isArray(value);
-      break;
-    case 'object':
-      valid = typeof value !== 'undefined';
-      break;
-    default:
-      valid = typeof value === typeName;
+      case 'array':
+        valid = Array.isArray(value);
+        break;
+      case 'object':
+        valid = typeof value !== 'undefined';
+        break;
+      default:
+        valid = typeof value === typeName;
     }
     if (!valid) {
       throw new Error(`Property '${name}' is not of type '${typeName}'`);
@@ -35,14 +35,14 @@ export function validateProperty(
     if (values.length > 0) {
       let valid = true;
       switch (typeName) {
-      case 'string':
-      case 'number':
-      case 'boolean':
-        valid = values.includes(value);
-        break;
-      default:
-        valid = values.findIndex(v => v === value) >= 0;
-        break;
+        case 'string':
+        case 'number':
+        case 'boolean':
+          valid = values.includes(value);
+          break;
+        default:
+          valid = values.findIndex(v => v === value) >= 0;
+          break;
       }
       if (!valid) {
         throw new Error(

+ 11 - 11
packages/settingeditor/src/inspector.ts

@@ -55,9 +55,9 @@ export function createInspector(
  * multiple client objects can lead to missed fetch responses.
  */
 class InspectorConnector extends DataConnector<
-InspectionHandler.IReply,
-void,
-InspectionHandler.IRequest
+  InspectionHandler.IReply,
+  void,
+  InspectionHandler.IRequest
 > {
   constructor(editor: RawEditor) {
     super();
@@ -125,16 +125,16 @@ namespace Private {
    */
   function renderError(error: ISchemaValidator.IError): string {
     switch (error.keyword) {
-    case 'additionalProperties':
-      return `**\`[additional property error]\`**
+      case 'additionalProperties':
+        return `**\`[additional property error]\`**
           \`${error.params?.additionalProperty}\` is not a valid property`;
-    case 'syntax':
-      return `**\`[syntax error]\`** *${error.message}*`;
-    case 'type':
-      return `**\`[type error]\`**
+      case 'syntax':
+        return `**\`[syntax error]\`** *${error.message}*`;
+      case 'type':
+        return `**\`[type error]\`**
           \`${error.dataPath}\` ${error.message}`;
-    default:
-      return `**\`[error]\`** *${error.message}*`;
+      default:
+        return `**\`[error]\`** *${error.message}*`;
     }
   }
 }

+ 5 - 5
packages/settingeditor/src/pluginlist.tsx

@@ -79,11 +79,11 @@ export class PluginList extends Widget {
    */
   handleEvent(event: Event): void {
     switch (event.type) {
-    case 'mousedown':
-      this._evtMousedown(event as MouseEvent);
-      break;
-    default:
-      break;
+      case 'mousedown':
+        this._evtMousedown(event as MouseEvent);
+        break;
+      default:
+        break;
     }
   }
 

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.