[orion-dev] Fw: [wtp-dev] JSDT enhancements
----- Forwarded by Mike Wilson/Ottawa/IBM on 2012/11/28 13:21 -----
From: John Peberdy <john@xxxxxxxxxx>
To: "General discussion of project-wide or architectural issues." <wtp-dev@xxxxxxxxxxx>
Date: 2012/11/28 11:36
Subject: [wtp-dev] JSDT enhancements
Sent by: wtp-dev-bounces@xxxxxxxxxxx
The main difference to existing JSDT is that it uses NJSDoc  as the data source. NJSDoc works by executing code in a modified Rhino runtime and analyzing the resulting structure. The Rhino runtime is modified in two ways: very few things will cause an error and second it stores the code location of every assignment and slot creation. This allows the NJSDoc algorithm to calculate precise definition locations even in nested or indirectly created classes or structures.
JSDT integrated with the NJSDoc algorithm is efficient. For a very large 70,000 line of code project here are the costs:
I've implemented basic integration with type resolution. Global variable and class member completion is working. Also hoverdoc and jump to definition is working.
- 5.5Mb of cached Rhino bytecode
- 4.5Mb for the NJSDoc structure including resolved class hierarchy and comments attached to the structure
- 800ms to naively recreate the global NJSDoc structure after an edit
Here is my plan:
Eventually I'd like the code to be merged back into JSDT assuming it proves useful to users. I'll share the code and set up an update site soon.
- Use JSDoc comments to hint types
- Add ability to manually hint the type of a local variable (an example of this in Scheme is here )
- Built in support for AMD spec and maybe CommonJS modules
- Improve performance, eliminate more JDT specific code
Let me know if you have any comments on this approach or in general.
 http://imgur.com/a/VTYAi _______________________________________________
wtp-dev mailing list