diff --git a/CodeEditor.php b/CodeEditor.php index a624c731..4b38fc44 100644 --- a/CodeEditor.php +++ b/CodeEditor.php @@ -68,6 +68,7 @@ $wgResourceModules['ext.codeEditor.ace'] = array( 'ace/mode-json.js', 'ace/mode-css.js', 'ace/mode-lua.js', + 'ace/ext-language_tools.js', ), ) + $tpl; diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js index 4b37518e..52080acc 100644 --- a/modules/jquery.codeEditor.js +++ b/modules/jquery.codeEditor.js @@ -183,6 +183,10 @@ container.width( box.width() ) .height( box.height() ); + // Non-lazy loaded dependencies: Enable code completion + ace.require( 'ace/ext/language_tools' ); + + // Load the editor now context.codeEditor = ace.edit( editdiv[0] ); context.codeEditor.getSession().setValue( box.val() ); @@ -193,6 +197,12 @@ context.codeEditor.setReadOnly( box.prop( 'readonly' ) ); + // The options to enable + context.codeEditor.setOptions( { + enableBasicAutocompletion: true, + enableSnippets: true + } ); + // fakeout for bug 29328 context.$iframe = [ {