How to use the monaco-editor-core.editor function in monaco-editor-core

To help you get started, we’ve selected a few monaco-editor-core examples, based on popular ways it is used in public projects.

github microsoft / BotFramework-Composer / Composer / packages / tools / language-servers / language-understanding / demo / src / client.ts View on Github external
monaco.languages.register({
  id: 'bflu',
  extensions: ['.lu'],
  aliases: ['LU', 'language-understanding'],
  mimetypes: ['application/lu'],
});

monaco.languages.setLanguageConfiguration('bflu', {
  autoClosingPairs: [
    { open: '{', close: '}' },
    { open: '[', close: ']' },
    { open: '(', close: ')' },
  ],
});

monaco.editor.defineTheme('lutheme', {
  base: 'vs',
  inherit: false,
  colors: {},
  rules: [],
});

// create Monaco editor
const value = `@  ml a
@  composite la = [a, b]
 `;

const editor = monaco.editor.create(document.getElementById('container')!, {
  model: monaco.editor.createModel(value, 'bflu', monaco.Uri.parse('inmemory://model.json')),
  glyphMargin: true,
  autoClosingBrackets: 'always',
  wordBasedSuggestions: false,
github microsoft / BotFramework-Composer / Composer / packages / tools / language-servers / language-generation / demo / src / client.ts View on Github external
[/^\s*@\{/, { token: 'expression', next: '@expression' }],
      [/=\s*[\s\S]+\s*$/, { token: 'structure-property' }],
      [/\s*[a-zA-Z0-9_-]+\s*$/, { token: 'structure-name' }],
      [/./, 'structure-lg.content'],
    ],
  },
});

monaco.languages.register({
  id: 'botbuilderlg',
  extensions: ['.lg'],
  aliases: ['LG', 'language-generation'],
  mimetypes: ['application/lg'],
});

monaco.editor.defineTheme('lgtheme', {
  base: 'vs',
  inherit: false,
  colors: {},
  rules: [
    { token: 'template-name', foreground: '0000FF' },
    { token: 'function-name', foreground: '79571E' },
    { token: 'keywords', foreground: '0000FF' },
    { token: 'comments', foreground: '7A7574' },
    { token: 'number', foreground: '00A32B' },
    { token: 'string', foreground: 'DF2C2C' },
    { token: 'structure-name', foreground: '00B7C3' },
  ],
});

// create Monaco editor
const value = `#ted

monaco-editor-core

A browser based code editor

MIT
Latest version published 2 months ago

Package Health Score

93 / 100
Full package analysis

Similar packages