Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 260363 Details for
Bug 488906
Error running lint because the tern server is not started
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
proposed fix
tern-manager-sync.patch (text/plain), 5.09 KB, created by
Michael Rennie
on 2016-03-16 16:06:28 EDT
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Michael Rennie
Created:
2016-03-16 16:06:28 EDT
Size:
5.09 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js >index 3d1c4d5..c33aa98 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js >@@ -99,9 +99,8 @@ > > var ternReady = false, > workerReady = false, >- startCount = 0, >+ pendingStart, > TRACE, >- pendingStart = Object.create(null), > messageQueue = [], // for all other requests > modifyQueue = []; // for add and removes only > >@@ -130,20 +129,7 @@ > * @callback > */ > WrappedWorker.prototype.postMessage = function(msg, f) { >- var starting = msg.request === "start_server"; >- if(starting) { >- if(!workerReady) { >- pendingStart.msg = msg; >- pendingStart.f = f; >- return; //don't queue start_server requests >- } >- if(startCount > 0 && msg.args.initial) { >- return; >- } >- startCount++; >- ternReady = false; >- } >- if(ternReady || starting || msg.request === 'read') { //configuration reads can happen while the server is starting >+ if(ternReady || msg.request === 'read') { //configuration reads can happen while the server is starting > if(msg !== null && typeof msg === 'object') { > if(typeof msg.messageID !== 'number' && typeof msg.ternID !== 'number') { > //don't overwrite an id from a tern-side request >@@ -155,6 +141,12 @@ > console.log("postMessage ("+this.messageId+") - SENT "+JSON.stringify(msg)); //$NON-NLS-1$ //$NON-NLS-2$ > } > this.worker.postMessage(msg); >+ } else if(msg.request === "start_server") { >+ if(!workerReady) { >+ pendingStart = {msg: msg, f: f}; >+ } else { >+ this.worker.postMessage(msg); >+ } > } else if (msg.request === "addFile" || msg.request === "delFile") { > if(TRACE) { > console.log("postMessage ("+this.messageId+") - MODIFY QUEUED: "+JSON.stringify(msg)); //$NON-NLS-1$ //$NON-NLS-2$ >@@ -187,10 +179,10 @@ > console.log("worker_ready ("+ternWorker.messageId+"): "+JSON.stringify(response)); //$NON-NLS-1$ //$NON-NLS-2$ > } > workerReady = true; >- if (!pendingStart.msg || !pendingStart.msg.request){ >- pendingStart.msg = {request: "start_server", args: {initial: true}}; //$NON-NLS-1$ >+ if(pendingStart) { >+ ternWorker.postMessage(pendingStart.msg, pendingStart.f); >+ pendingStart = null; > } >- ternWorker.postMessage(pendingStart.msg, pendingStart.f); > }, > /** > * @callback >@@ -292,28 +284,25 @@ > * @since 10.0 > */ > function serverReady() { >- startCount--; >- if(startCount === 0) { >- ternReady = true; >- // process all add/remove first >- for(var i = 0, len = modifyQueue.length; i < len; i++) { >- var item = modifyQueue[i]; >- if(TRACE) { >- console.log("clearing MODIFY queue: "+JSON.stringify(item.msg)); //$NON-NLS-1$ >- } >- ternWorker.postMessage(item.msg, item.f); >+ ternReady = true; >+ // process all add/remove first >+ for(var i = 0, len = modifyQueue.length; i < len; i++) { >+ var item = modifyQueue[i]; >+ if(TRACE) { >+ console.log("clearing MODIFY queue: "+JSON.stringify(item.msg)); //$NON-NLS-1$ > } >- modifyQueue = []; >- // process remaining pending requests >- for(i = 0, len = messageQueue.length; i < len; i++) { >- item = messageQueue[i]; >- if(TRACE) { >- console.log("clearing MESSAGE queue: "+JSON.stringify(item.msg)); //$NON-NLS-1$ >- } >- ternWorker.postMessage(item.msg, item.f); >- } >- messageQueue = []; >+ ternWorker.postMessage(item.msg, item.f); > } >+ modifyQueue = []; >+ // process remaining pending requests >+ for(i = 0, len = messageQueue.length; i < len; i++) { >+ item = messageQueue[i]; >+ if(TRACE) { >+ console.log("clearing MESSAGE queue: "+JSON.stringify(item.msg)); //$NON-NLS-1$ >+ } >+ ternWorker.postMessage(item.msg, item.f); >+ } >+ messageQueue = []; > } > > /** >diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/ternProjectManager.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/ternProjectManager.js >index 8401700..088258d 100644 >--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/ternProjectManager.js >+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/ternProjectManager.js >@@ -241,16 +241,19 @@ > this.projectLocation = project.Location; > this.scriptResolver.setSearchLocation(project.Location); > var c = project.Children; >+ var tpf; > for(var i = 0, len = c.length; i < len; i++) { > if(".tern-project" === c[i].Name) { >- this.currentFile = c[i].Location; >- this.starting(); >- return this.parseTernJSON(this.currentFile).then(function(jsonOptions){ >- this.json = jsonOptions; >- return this.loadTernProjectOptions(jsonOptions); >- }.bind(this)); >+ tpf = c[i].Location; >+ break; > } > } >+ if(typeof tpf === 'string') { >+ this.refresh(tpf); >+ } else { >+ //no .tern-project - request default startup >+ this.loadTernProjectOptions(); >+ } > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 488906
:
260069
|
260350
|
260363
|
260364