title: How to automatically pick a "mode" for Ace Editor, given a file extension
body: <p>I'm working on a project that uses a java/scala backend (<a href="http://liftweb.net/">Lift</a>, to be precise, though that shouldn't affect this question), and as part of the frontend we use <a href="http://ace.ajax.org/">Ace Editor</a>. I've been googling for a while and have yet to find an answer to this question:</p>
  
  <p>Given a file extension (e.g. <code>js</code>, <code>c</code>, <code>cpp</code>, <code>h</code>, <code>java</code>, <code>rb</code>, etc), how can I automatically pick an Ace "mode" for the appropriate language?</p>
  
  <p>I'm hoping to avoid manually creating a map, a la <code>js -&gt; javascript, c -&gt; c_cpp, java -&gt; java</code>. Is there a java/scala library available for this? Or better yet, does Ace have this functionality built in somehow?</p>