Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Misspelled Ace Editor Options

I have implemented an Ace editor setup for PHP (which is working fine), but when I try to set additional options using Ace's API, I receive warnings in the console.

Here is the code used to init the editor and try to set the options;

ace.require("ace/ext/language_tools");
ace.require("ace/ext/emmet");

// PHP
var phpeditor = ace.edit("php_inc");
phpeditor.setTheme("ace/theme/dreamweaver");
phpeditor.getSession().setMode("ace/mode/php");
phpeditor.setOptions({
        enableSnippets: true,
        enableLiveAutoComplete: true,
        enableBasicAutocompletion: true,
        showPrintMargin: settings.showPrintMargin,
        useSoftTabs: false,
        fontSize: settings.fontSize,
        showInvisibles: settings.showInvisibles,
        behavioursEnabled: settings.behavioursEnabled,
        tabSize: settings.tabSize,
        useWrapMode: settings.useWrapMode,
        useWorker: settings.useWorker,
        setHighlightActiveLine: false,
        enableEmmet: true
    });

And here are the console warnings I get;

misspelled option "enableSnippets" ace.js?ver=3.9.1:5207
misspelled option "enableLiveAutoComplete" ace.js?ver=3.9.1:5207
misspelled option "enableBasicAutocompletion" ace.js?ver=3.9.1:5207
misspelled option "setHighlightActiveLine" ace.js?ver=3.9.1:5207
misspelled option "enableEmmet" ace.js?ver=3.9.1:5207

Any help will be greatly appreciated.

like image 750
Harri Bell-Thomas Avatar asked Jul 09 '14 10:07

Harri Bell-Thomas


1 Answers

  1. you need to include script files for extensions you use see https://github.com/ajaxorg/ace-builds/blob/v1.1.4/demo/autocompletion.html#L28
  2. option name is "enableLiveAutocompletion" instead of "enableLiveAutoComplete" https://github.com/ajaxorg/ace/blob/v1.1.4/lib/ace/ext/language_tools.js#L186
  3. options names do not have set in them so it should be highlightActiveLine

you can see list of all available options by running Object.keys(editor.$options)

like image 198
a user Avatar answered Nov 10 '22 20:11

a user