title: Building an IDEA plugin for Realm
body: <p>I'm working on a MongoDB Realm application, the online function editor is not that intuitive for me, not giving the same experience with using a real IDE as we can experience with IntelliJ/Webstorm, etc.</p>
  <p>So I exported my application and loaded it in Webstorm but since it is basically a serverless app, functions need to run on the cloud runtime. The online editor gives an integrated way of editing a function and running it with a single click, but this is obviously not available when you export your project:</p>
  <p><a href="https://i.stack.imgur.com/UyIf3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UyIf3.png" alt="enter image description here" /></a></p>
  <p>On the cloud function editor, one way to test this method <code>processCsv</code>, is through the cloud console:</p>
  <pre class="lang-sh prettyprint-override"><code>exports('...encodedData...') 
  </code></pre>
  <p>It will run and log the function on the same console.</p>
  <p>There is however an Admin API that can be used to update cloud functions and trigger them. Which are good news and a possible way to integrate to an IDE like Webstorm through plugins.</p>
  <p>The <a href="https://docs.mongodb.com/realm/admin/api/v3/#functions-apis" rel="nofollow noreferrer">Realm Admin Function API</a> allows</p>
  <ol>
  <li>Updating cloud functions</li>
  <li>Executing cloud functions</li>
  </ol>
  <p><strong>So my question would be:</strong></p>
  <ul>
  <li>When building an IDEA plugin would it be possible to create a mapping that will bind the <code>source.js</code> to a function (that will later be called)</li>
  <li>Is it possible to monitor that file and there are saved changes it will automatically call the update function to push the source code changes based on the bonded function name</li>
  <li>And what's the best way to build a run terminal of the plugin to actually do something like:</li>
  </ul>
  <p><a href="https://i.stack.imgur.com/gzZMT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gzZMT.png" alt="enter image description here" /></a></p>