<commit_before>/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2016, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
'use strict';

import {
  Container, Token
} from 'phosphor-di';

import {
  CommandPalette
} from './palette';

import {
  ICommandPalette
} from './index';

import {
  ICommandRegistry
} from '../commandregistry/index';


/**
 * Register the plugin contributions.
 *
 * @param container - The di container for type registration.
 *
 * #### Notes
 * This is called automatically when the plugin is loaded.
 */
export
function register(container: Container): void {
  container.register(ICommandPalette, CommandPaletteWrapper);
}

class CommandPaletteWrapper {
  /**
   * The dependencies required by the command palette.
   */
  static requires: Token<any>[] = [ICommandRegistry];

  /**
   * Create a new command palette instance.
   *
   * @param commandRegistry - A command registry instance
   */
  static create(commandRegistry: ICommandRegistry): ICommandPalette {
    return new CommandPalette(commandRegistry);
  }
}
<commit_msg>switching to IFactory instead of wrapper class<commit_after>/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2016, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
'use strict';

import {
  Container, Token, IFactory
} from 'phosphor-di';

import {
  CommandPalette
} from './palette';

import {
  ICommandPalette
} from './index';

import {
  ICommandRegistry
} from '../commandregistry/index';


const paletteFactory = {
  requires: [ICommandRegistry] as Token<any>[],
  create: (commandRegistry: ICommandRegistry): ICommandPalette => {
    return new CommandPalette(commandRegistry);
  }
} as IFactory<ICommandPalette>;

/**
 * Register the plugin contributions.
 *
 * @param container - The di container for type registration.
 *
 * #### Notes
 * This is called automatically when the plugin is loaded.
 */
export
function register(container: Container): void {
  container.register(ICommandPalette, paletteFactory);
}

{'fraction_non_alphanumeric': 0.21902834008097166, 'fraction_numerical': 0.0072874493927125505, 'mean_word_length': 2.4082758620689657, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4526476', 'n_tokens_mistral': 633, 'n_tokens_neox': 614, 'n_words': 204}