Search code examples
regexace-editor

Ace editor snippet format for RegEx based triggers


I'm using an array of snippets with following format

{
  name: 'response',
  trigger: 'resp|rp',
  path: ['paths', '.', '.', '.'],
  content: [
    '${1:code}:',
    '  description: ${2}',
    '  schema: ${3}',
    '${4}'
  ].join('\n')
},

How can I use a RegEx for the trigger? I tried regex key with no luck.


Solution

  • It's not possible to do via public api see register method of snippetManager, you can make it to work by accessing snippetNameMap directly, but it would be better to create feature request on Aces issue tracker.