Summary: | [acorn] Investigate pre-resolving paths to dependency literals | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [ECD] Orion (Archived) | Reporter: | Michael Rennie <Michael_Rennie> | ||||||||
Component: | JS Tools | Assignee: | Project Inbox <orion.client-inbox> | ||||||||
Status: | REOPENED --- | QA Contact: | |||||||||
Severity: | enhancement | ||||||||||
Priority: | P3 | CC: | curtis.windatt.public, steve_northover, troytao | ||||||||
Version: | 12.0 | Keywords: | performance, triaged | ||||||||
Target Milestone: | --- | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
See Also: | https://git.eclipse.org/r/70791 | ||||||||||
Whiteboard: | |||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 453093, 470907 | ||||||||||
Attachments: |
|
Description
Michael Rennie
2016-04-12 11:05:10 EDT
We should also investigate loading types mentioned in JSDoc, and tag doc nodes with the name mapping. This would finally allow content assist, etc to work properly for doc'd types that have not been loaded into Tern (because now we could load them correctly without an explicit requirejs / node entry). New Gerrit change created: https://git.eclipse.org/r/70791 (In reply to Eclipse Genie from comment #2) > New Gerrit change created: https://git.eclipse.org/r/70791 In this commit, I moved the file resolving from resolver.js to orionAcron.js and successfully attached the result to the AST node that can be used by both node.js and requirejs.js plugins when they are asked to calculate type information. Thus, the original resolver object in the two plugins become useless and has been removed. Besides, I also removed the fix that comes from bug 481271 (javascriptPlugin.js) since orionAcron.js has did the same thing while parsing. There are still some problems of this commit: 1. This commit cannot handle multiple-level loading. If a loaded module requires its own dependencies, the result seems to be invalid. (I think this problem exists before this commit and have pointed it out in Bug 481271 at comment 30) 2. To resolve files, orionAcron instance needs to access ternServer. In ast.js, we have that access but in astManager.js, we do not. I tried to put the server into OrionAcorn.prototype, but it failed to share between the two orionAcron instances. This is caused due to the closures created during module loading process. There is a example I wrote to show this phenomenon and I will add it as an attachment. Created attachment 261162 [details]
Failure of sharing ternServer using prototype scheme
Run this code in node.js and the result will show that oa2.ternServer is undefined.
Created attachment 261163 [details]
Failure of sharing ternServer using prototype scheme and One possible Solution
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see: https://dev.eclipse.org/mhonarc/lists/orion-dev/msg04002.html Reopening Created attachment 267949 [details] Patch from gerrit This is the change from gerrit: https://git.eclipse.org/r/#/c/70791/ |