CodeEditor: Add basic code completion and snippet support

Bug: 48828
Change-Id: If7d165fc849ca9687dd7d511b0d111b9969fb2a7
This commit is contained in:
Derk-Jan Hartman 2014-01-10 15:06:22 +01:00
parent 26973c1fa9
commit 1373c915df
2 changed files with 11 additions and 0 deletions

View file

@ -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;

View file

@ -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 = [
{