Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 489764

Summary: Server API does not load required plugins properly (was: Tern server handles "type" request wrongly when running on Nodejs environment.)
Product: [ECD] Orion Reporter: Troy Tao <troytao>
Component: JS ToolsAssignee: Troy Tao <troytao>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie, steve_northover
Version: 11.0   
Target Milestone: 12.0   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/68543
https://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=58f1082da48907e54c0022143a726ecb6b5c670e
Whiteboard:
Attachments:
Description Flags
A nodejs server example.
none
A second server example which talks to tern directly. none

Description Troy Tao CLA 2016-03-16 11:39:47 EDT
Created attachment 260352 [details]
A nodejs server example.

To reproduce this bug, first get the build of JSTools, then write a Nodejs script (for example purpose, see the attachment) and run the script sending a "type" query to the JSTools API (which is the orionJavaScript.js in the example). The returned output turned out to be incomplete and useless.
Comment 1 Troy Tao CLA 2016-03-16 11:40:37 EDT
Created attachment 260353 [details]
A second server example which talks to tern directly.
Comment 2 Troy Tao CLA 2016-03-16 11:42:01 EDT
To see a correct output, you can set up another Nodejs script talking to tern directly without the JSTool API. I have uploaded a such example.
Comment 3 Eclipse Genie CLA 2016-03-16 11:48:46 EDT
New Gerrit change created: https://git.eclipse.org/r/68543
Comment 4 Michael Rennie CLA 2016-03-16 13:43:48 EDT
There does seem to be a bug in the default plugin loading.

We should have the API server import ternDefaults.jjs and mixin the plugins on a default start up the same way we do in ternWorkerCore.js

The API change to pass a file array should be removed.
Comment 6 Michael Rennie CLA 2016-03-17 14:22:58 EDT
Closing fixed. Thanks Troy!