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 254524 Details for
Bug 465610
[tern] Provide progress when activating Tern content assist and improve worker load time
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]
potential fix for worker loading
worker-startup.patch (text/plain), 4.18 KB, created by
Michael Rennie
on 2015-06-17 19:36:12 EDT
(
hide
)
Description:
potential fix for worker loading
Filename:
MIME Type:
Creator:
Michael Rennie
Created:
2015-06-17 19:36:12 EDT
Size:
4.18 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 0900a4c..22530ee 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 >@@ -117,7 +117,7 @@ > this.worker = new Worker(wUrl.href); > this.worker.onmessage = onMessage; > this.worker.onerror = onError; >- this.worker.postMessage(''); >+ this.worker.postMessage('start_server'); //$NON-NLS-1$ > // } > } > >@@ -134,6 +134,12 @@ > }; > > var prefService = core.serviceRegistry.getService("orion.core.preference"); //$NON-NLS-1$ >+ /** >+ * Object of contributed environments >+ * >+ * TODO will need to listen to updated tern plugin settings once enbaled to clear this cache >+ */ >+ var contributedEnvs; > > // Start the worker > var ternWorker = new WrappedWorker("ternWorker.js", //$NON-NLS-1$ >@@ -172,18 +178,40 @@ > } > break; > } >+ case 'installed_plugins': { >+ var plugins = _d.plugins; >+ return prefService ? prefService.getPreferences("/cm/configurations").then(function(prefs){ //$NON-NLS-1$ >+ var props = prefs.get("tern/plugins"); //$NON-NLS-1$ >+ if (!props) { >+ props = Object.create(null); >+ } else if(typeof(props) === 'string') { >+ props = JSON.parse(props); >+ } >+ var keys = Object.keys(plugins); >+ for(var i = 0; i < keys.length; i++) { >+ var key = keys[i]; >+ props[key] = plugins[key]; >+ } >+ prefs.put("tern/plugins", JSON.stringify(props)); //$NON-NLS-1$ >+ prefs.sync(true); >+ }) : new Deferred().resolve(); >+ break; >+ } >+ case 'environments': { >+ contributedEnvs = _d.envs; >+ break; >+ } > } >- } >+ } else if(typeof(evnt.data) === 'string') { >+ if(evnt.data === 'server_ready') { >+ ternWorker.postMessage({request: 'installed_plugins'}); //$NON-NLS-1$ >+ ternWorker.postMessage({request: 'environments'}); //$NON-NLS-1$ >+ } >+ } > }, > function(err) { > Logger.log(err); > }); >- /** >- * Object of contributed environments >- * >- * TODO will need to listen to updated tern plugin settings once enbaled to clear this cache >- */ >- var contributedEnvs; > > /** > * @description Queries the Tern server to return all contributed environment names from the installed plugins >@@ -209,37 +237,6 @@ > } > return envDeferred; > } >- >- //this handler is for ferrying preferences to and from the Tern server >- ternWorker.addEventListener('message', function(evnt) { >- if(typeof(evnt.data) === 'object') { >- var _d = evnt.data; >- switch(_d.request) { >- case 'installed_plugins': { >- var plugins = _d.plugins; >- return prefService ? prefService.getPreferences("/cm/configurations").then(function(prefs){ //$NON-NLS-1$ >- var props = prefs.get("tern/plugins"); //$NON-NLS-1$ >- if (!props) { >- props = Object.create(null); >- } else if(typeof(props) === 'string') { >- props = JSON.parse(props); >- } >- var keys = Object.keys(plugins); >- for(var i = 0; i < keys.length; i++) { >- var key = keys[i]; >- props[key] = plugins[key]; >- } >- prefs.put("tern/plugins", JSON.stringify(props)); //$NON-NLS-1$ >- prefs.sync(true); >- }) : new Deferred().resolve(); >- } >- } >- } else if(typeof(evnt.data) === 'string') { >- if(evnt.data === 'server_ready') { >- ternWorker.postMessage({request: 'installed_plugins'}); //$NON-NLS-1$ >- } >- } >- }, false); > > provider.registerService("orion.edit.contentassist", new TernAssist.TernContentAssist(astManager, ternWorker, getEnvironments), //$NON-NLS-1$ > {
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 465610
:
254485
| 254524