registerHintsHelperAsync static method

void registerHintsHelperAsync(
  1. String mode,
  2. HintsHelperAsync helper
)

Implementation

static void registerHintsHelperAsync(String mode, HintsHelperAsync helper) {
  _init();

  var function = JsFunction.withThis((win, editor, showHints, [options]) {
    var results = helper(
        CodeMirror.fromJsObject(editor), HintsOptions.fromProxy(options));

    results.then((HintResults? r) {
      showHints.apply([r?.toProxy()]);
    });
  });

  function['async'] = true;

  CodeMirror.registerHelper('hint', mode, function);
}