Autocompletion in ACE editor

Wojciech Danilo picture Wojciech Danilo · Nov 24, 2012 · Viewed 37.3k times · Source

I've found simmilar question: Ace Editor autocomplete and multiple languages

But the responses were that autocompletion is not supported by ACE, and according to Google group for Ace Editor "It is on my wishlish for Ace and we definitively need it for Cloud9".

This post is one year old and as you can see, the cloud9 supports autocompletion now: https://c9.io/site/features/

So is autocompletion available in Ace Editor by default? I cannot find any information about it.

Answer

hwjp picture hwjp · Nov 1, 2013

Autocomplete is now an official part of the API. Enabling it takes 3 lines of code:

ace.require("ace/ext/language_tools");
var editor = ace.edit("editor");
editor.setOptions({
    enableBasicAutocompletion: true
});

Depending on your setup with require-js, you may also need to include an additional javascript file in the html for your page:

<script src="ace/ext-language_tools.js"></script>

You can find a demo at https://github.com/ajaxorg/ace/blob/master/demo/autocompletion.html

And here's the wiki page I just wrote on the topic:

https://github.com/ajaxorg/ace/wiki/How-to-enable-Autocomplete-in-the-Ace-editor