title: Is it possible to close the auto-complete SuggestWidget programmatically?
body: <p>I'm in the process of migrating from Codemirror to Monaco editor for a project where we use a prefix key to type in special characters. For example, given a prefix of <code>.</code>, if the user types <code>.</code> followed by <code>o</code> the editor replaces the sequence with <code>Ω</code>.</p>
  
  <p>It is possible to use the addCommand and provide it a chord, like this:</p>
  
  <pre><code>editor.addCommand(
    monaco.KeyMod.chord(monaco.KeyCode.US_DOT , monaco.KeyCode.KEY_O),
    x=&gt;{ // write out special char here 
      editor.executeEdits("", [
        { range: editor.getSelection(), text: "Ω" }
      ]);
    }
  )
  </code></pre>
  
  <p>But I want to use the auto-complete feature to help the user by listing the special chars once they type the prefix key. A CompletionItemProvider allows me to do that by providing the prefix key in the triggerCharacters property:</p>
  
  <pre><code>monaco.languages.registerCompletionItemProvider('mylang', {
    triggerCharacters:['.'],
    provideCompletionItems: (model,position,token) =&gt; { 
      let l=position.lineNumber,c=position.column;
      let s=model.getLineContent(l),ch=s[c-2];
      console.log('completion triggered on: '+ch)
      if (ch==='.'){
        return CompletionItem[]; // return list of valid special chars
      }
    }
  })
  </code></pre>
  
  <p>Now I get the list of suggestions when the user types the prefix key, but even if he follows that with an <code>o</code>, it doesn't trigger until he commits by hitting enter or selecting the item with the mouse. I can attach a listener to spot a valid sequence and do the replacement that way:</p>
  
  <pre><code>editor.model.onDidChangeContent(e=&gt;{
    if (valid sequence) 
      editor.executeEdits('',[{range,text:'Ω'}])
  
  })
  </code></pre>
  
  <p>This works, but I'm left with the SuggestionWizard open. </p>
  
  <p>The immediate question is if there is any way I can control programmatically when to hide the widget?</p>
  
  <p>Secondary, is there a better way to achieve the above?</p>
  
  <h3>Update:</h3>
  
  <p>Found a hack to get it closed using private methods. Not happy to use this approach for obvious reasons, but also because it seems to require a delayed action that I haven't managed to pinpoint the reason for yet.</p>
  
  <pre><code>let sw=editor._view.contentWidgets._widgets["editor.widget.suggestWidget"]
  setTimeout(x=&gt;sw&amp;&amp;sw._actual&amp;&amp;sw._actual.hideWidget(),50)
  </code></pre>