Skip to content

How to enable Autocomplete in the Ace editor

Harutyun Amirjanyan edited this page Nov 3, 2013 · 4 revisions

In brief:

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

When setting enableBasicAutocompletion to true then the keyword and snippet completer as well as the text completer are used.

Here is an example for implementing a new completer: http://plnkr.co/edit/6MVntVmXYUbjR0DI82Cr?p=preview