javascriptrequirejsbowerace-editor

Ace Editor RequireJS Referencing ace/ext-language_tools Dependencies "ace/lib/oop" and "ace/lib/event_emitter"


I'm using RequireJS to load the ace editor. I'm not having any issues getting most of the editor and its dependencies loaded. But I'm specifically referencing ace/ext-language_tools, but it loads additional references "ace/lib/oop" and "ace/lib/event_emitter", but these files don't exist in the ace-build bower library. They only exist in the source code. I'm trying to use the built and minified version, but I can't seem to get these additional files referenced. What am I doing wrong? Is there some reason these files aren't being built with either the CDN version at https://cdnjs.com/libraries/ace/ or the ace-build bower library?


Solution

  • In built version ace/lib/oop and ace/lib/event_emitter are declared in ace.js file

    see the example below

    <script src=https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.3/ace.js></script>
    <script src=https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.3/ext-language_tools.js></script>
    
    <script>
      editor = ace.edit()
      document.body.appendChild(editor.container)
      editor.container.style.height = '100px'
      editor.setOptions({
        enableBasicAutocompletion: true,
        enableLiveAutocompletion: true,
        enableSnippets: true,
      })
      editor.session.setMode("ace/mode/javascript")
    </script>