How do I create this hinting functionality?

I want hint words / autocomplete for:

  1. Array of hint words: This appears always at the start of a new line (nothing written)
  2. Array of hint words: Always appears after a “=” has been written.
  3. Array of hint words: Always appears after a “->” has been written.

Is it possible to do this with CodeMirror?

This is my current code. It’s working, but it’s only got 1 array of hint words, I don’t know how to implement more arrays of hints:

  CodeMirror.registerHelper("hintWords", "FrenziedLang", maincommands);

  var myCodeMirror = CodeMirror(document.body, {
      mode:  "CustomLang"
  });

  myCodeMirror.on("inputRead", function(editor, change) {
      if (change.text[0] == "@") myCodeMirror.showHint();
  });

  myCodeMirror.on("keyup", function (cm, event) {
      if (!cm.state.completionActive && /*Enables keyboard navigation in autocomplete list*/
          event.keyCode == 13) {        /*Enter - do not open autocomplete list just after item has been selected in it*/ 
          CodeMirror.commands.autocomplete(cm, null, {completeSingle: false});
      }
  });