From 6159874530dfaba1e01499b5f0c8587c64131acb Mon Sep 17 00:00:00 2001 From: Jason Barnabe Date: Tue, 4 Feb 2014 12:19:52 -0600 Subject: [PATCH] Implement sourceeditor autocomplete --- content/edit.js | 6 ++++++ content/edit.xul | 1 + 2 files changed, 7 insertions(+) diff --git a/content/edit.js b/content/edit.js index 60bbe0f..5e30ce5 100644 --- a/content/edit.js +++ b/content/edit.js @@ -1,8 +1,10 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); var require = null; +var autocompleter = null; try { require = Components.utils.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require; + autocompleter = require("devtools/sourceeditor/autocomplete"); } catch (ex) { // file not available... } @@ -162,6 +164,10 @@ function init2() { wrapLinesE.checked = wrapLines; wrapLinesE.style.display = ""; } + if (sourceEditorType == "sourceeditor" && autocompleter != null) { + sourceEditor.extend(autocompleter); + sourceEditor.setupAutoCompletion(null); + } initStyle(); diff --git a/content/edit.xul b/content/edit.xul index 6d4d056..261b416 100644 --- a/content/edit.xul +++ b/content/edit.xul @@ -1,6 +1,7 @@ +