How to use the @kui-shell/plugin-editor.language function in @kui-shell/plugin-editor

To help you get started, we’ve selected a few @kui-shell/plugin-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IBM / kui / plugins / plugin-openwhisk-editor-extensions / src / lib / cmds / compose.ts View on Github external
const defaultPlaceholderFn = ({ kind = 'nodejs:default', template }) => {
  if (!template) {
    // if the command didn't specify a template to start with, we
    // will use one of the built-in placeholders, based on the
    // kind of code being created
    return placeholders[language(kind)]
  } else {
    // otherwise, we will open the editor showing a template file
    return new Promise((resolve, reject) => {
      const readViaImport = () => {
        debug(
          'readViaImport',
          Util.findFile(template),
          Util.findFile(template).replace(/^.*plugin-apache-composer\/samples(.*)$/, '$1')
        )
        resolve(
          require('raw-loader!@kui-shell/plugin-apache-composer/samples' +
            Util.findFile(template).replace(/^.*plugin-apache-composer\/samples(.*)$/, '$1')).default
        )
      }

      const readViaFilesystem = () => {
github IBM / kui / plugins / plugin-openwhisk-editor-extensions / src / lib / cmds / compose.ts View on Github external
  const makePlaceholderCode = placeholderFn || (() => placeholder || placeholders[language(kind)])
github IBM / kui / plugins / plugin-openwhisk-editor-extensions / src / lib / cmds / new.ts View on Github external
  const makePlaceholderCode = placeholderFn || (() => placeholder || placeholders[language(kind)])