TheDJ has uploaded a new change for review.
https://gerrit.wikimedia.org/r/106693
Change subject: CodeEditor: Add basic code completion and snippet support
......................................................................
CodeEditor: Add basic code completion and snippet support
Bug: 48828
Change-Id: If7d165fc849ca9687dd7d511b0d111b9969fb2a7
---
M CodeEditor.php
M modules/jquery.codeEditor.js
2 files changed, 12 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor
refs/changes/93/106693/1
diff --git a/CodeEditor.php b/CodeEditor.php
index 06dae9d..59a5215 100644
--- a/CodeEditor.php
+++ b/CodeEditor.php
@@ -61,6 +61,7 @@
'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 15f23cf..504840a 100644
--- a/modules/jquery.codeEditor.js
+++ b/modules/jquery.codeEditor.js
@@ -149,6 +149,11 @@
.height( box.height() );
editdiv.text( box.val() );
+
+ /* Non-lazy loaded dependencies: Enable
code completion */
+ ace.require( 'ace/ext/language_tools' );
+
+ /* Load the editor now */
context.codeEditor = ace.edit(
editdiv[0] );
// Disable some annoying commands
@@ -156,6 +161,12 @@
context.codeEditor.commands.removeCommand( 'transposeletters' ); // ctrl+T
context.codeEditor.commands.removeCommand( 'gotoline' ); // ctrl+L
+ /* The options to enable */
+ context.codeEditor.setOptions({
+ enableBasicAutocompletion: true,
+ enableSnippets: true
+ });
+
// fakeout for bug 29328
context.$iframe = [
{
--
To view, visit https://gerrit.wikimedia.org/r/106693
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If7d165fc849ca9687dd7d511b0d111b9969fb2a7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeEditor
Gerrit-Branch: master
Gerrit-Owner: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits