title: Monaco editor - Pre-populate find control with text
body: <p>I'm hosting a Monaco editor in my React app. </p>
  
  <p>So far, I've got the editor to open the find control when the editor has mounted, but I need to pre-populate it with some text. </p>
  
  <p>The bit of code at the moment looks like this: </p>
  
  <pre><code>... 
  
  class CodeEditorMonaco extends Component {
    constructor (props) {
      super(props)
      this.editorDidMount = this.editorDidMount.bind(this)
      this.editor = null
    }
  
    editorDidMount (editor, monaco) {
      editor.focus()
      editor.getAction('actions.find').run()
    } 
  
    render () {
      return (
        &lt;div className='code-editor'&gt;
          &lt;MonacoEditor
            width='100%'
            height='75vh'
            language='json'
            editorDidMount={this.editorDidMount}
            ref={editor =&gt; { this.editor = editor }}
          /&gt;
        &lt;/div&gt;
      )
    }
  }
  ...
  </code></pre>
  
  <p>I don't think the API documentation is clear as to whether this is possible or not.</p>
  
  <p>My first instinct was to do
      <code>editor.getAction('actions.find').run('text here')</code>
  but that doesn't seem to work</p>
  
  <p>When you highlight a word in the editor itself, and then press <code>CMD+F</code> you get the find control pre-populated with the text, so I believe it's possible to achieve. </p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Find control:
  <a href="https://i.stack.imgur.com/kkC2f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kkC2f.png" alt="Find control"></a></p>