From 01685c255fda6e13f1cd2980130d2e388d52125c Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sat, 4 Jul 2015 11:31:01 +0800 Subject: Updated codemirror to 5.4.0 --- public/vendor/codemirror/addon/tern/tern.js | 6 ++++-- public/vendor/codemirror/addon/tern/worker.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'public/vendor/codemirror/addon/tern') diff --git a/public/vendor/codemirror/addon/tern/tern.js b/public/vendor/codemirror/addon/tern/tern.js index 99b8a646..dfb19b84 100755 --- a/public/vendor/codemirror/addon/tern/tern.js +++ b/public/vendor/codemirror/addon/tern/tern.js @@ -59,6 +59,7 @@ this.options = options || {}; var plugins = this.options.plugins || (this.options.plugins = {}); if (!plugins.doc_comment) plugins.doc_comment = true; + this.docs = Object.create(null); if (this.options.useWorker) { this.server = new WorkerServer(this); } else { @@ -69,7 +70,6 @@ plugins: plugins }); } - this.docs = Object.create(null); this.trackChange = function(doc, change) { trackChange(self, doc, change); }; this.cachedArgHints = null; @@ -124,6 +124,8 @@ var self = this; var doc = findDoc(this, cm.getDoc()); var request = buildRequest(this, doc, query, pos); + var extraOptions = request.query && this.options.queryOptions && this.options.queryOptions[request.query.type] + if (extraOptions) for (var prop in extraOptions) request.query[prop] = extraOptions[prop]; this.server.request(request, function (error, data) { if (!error && self.options.responseFilter) @@ -442,7 +444,7 @@ function atInterestingExpression(cm) { var pos = cm.getCursor("end"), tok = cm.getTokenAt(pos); - if (tok.start < pos.ch && (tok.type == "comment" || tok.type == "string")) return false; + if (tok.start < pos.ch && tok.type == "comment") return false; return /[\w)\]]/.test(cm.getLine(pos.line).slice(Math.max(pos.ch - 1, 0), pos.ch + 1)); } diff --git a/public/vendor/codemirror/addon/tern/worker.js b/public/vendor/codemirror/addon/tern/worker.js index 48277af8..887f906a 100755 --- a/public/vendor/codemirror/addon/tern/worker.js +++ b/public/vendor/codemirror/addon/tern/worker.js @@ -39,6 +39,6 @@ function startServer(defs, plugins, scripts) { }); } -var console = { +this.console = { log: function(v) { postMessage({type: "debug", message: v}); } }; -- cgit v1.2.3