diff options
author | Wu Cheng-Han | 2015-07-04 11:31:01 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2015-07-04 11:31:01 +0800 |
commit | 01685c255fda6e13f1cd2980130d2e388d52125c (patch) | |
tree | c329610e7011c0d77c55ef54f371181aeb362d13 /public/vendor/codemirror/addon/tern | |
parent | 1d843c8ac257d512a96cf054ab24e6a3c2f34e26 (diff) |
Updated codemirror to 5.4.0
Diffstat (limited to 'public/vendor/codemirror/addon/tern')
-rwxr-xr-x | public/vendor/codemirror/addon/tern/tern.js | 6 | ||||
-rwxr-xr-x | public/vendor/codemirror/addon/tern/worker.js | 2 |
2 files changed, 5 insertions, 3 deletions
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}); } }; |