- 1 JSDT Renewal
- 1.1 Principles
- 1.2 Current Problems
- 1.3 Proposal/Discussion for changes
- 1.4 Committed Changes
- 1.5 Principal changes comparing to the current architecture
The new architecture should be based on principals which will allow JSDT to meet the following fundamental requirements:
- Fast (Performance is the key requirement. If we choose between performance and some advanced feature, performance always wins)
- Leveraging source solutions elsewhere
The functionality may be limited to the basics: Syntax highlighting, very basic code completion and validation, debugger. The main goal for Eclipse Neon is to provide a platform which meets the requirements above and not to focus on any advanced functionality. JSDT should not prevent users from developing (performance issues, false positive validation problems, etc) and help when possible.
As a general rule, all APIs are subject to be deprecated for Neon. We will not maintain deprecated APIs on Neon and the removal of deprecated APIs can happen as early as Neon+1
We will have workspace compatibility for the Neon release.
Only workspace compatibility is guaranteed. We reserve the right to discontinue/replace features.
- No ECMAScript 2015 support
- Problems with corner syntax cases on the current specification
- AST model does not cover ES 2015
- Inference Engine is built-in
- Validation is built-in
- Validation only covers syntax errors found through parser.
- No extension points for adding 3rd party validation
Proposal/Discussion for changes
See also 481706
Use typescript language services
- Provides ES6 parsing
- Strong backing
- Enables typescript support in the future
- Inference is built-in
- Requires node.js to run
- Tends to get slow on large projects due to inference
- limits 3rd party integration with services bundled in.
Use acorn(or esprima) parser
- Provides ESTree AST format used in many tools
- Used by Orion project
- Parser plugins to support other formats (.jsx etc)
- Requires node.js to run
- AST tree needs to be converted to a Java model
Use Shift-ast parser
- Implementation in Java
- Provides a detailed Java AST model
- Lack of tolerant parsing. Parsing stops on the first syntax error.
- AST model is not compatible to ESTree needs conversion
- Fairly new project
- SourceLocation implementatation was not complete at version 2.1.1
Build ES6 support to JSDT parser
- The easiest alternate to integrate.
- Parser is originally developed for Java requires an update for even existing rules
- The mechanics to update the parser is fragile. See instructions
- Requires JSDT project to continue with maintenance of the parser
AST Model update
We need to update AST model to include ES6 features. Unfortunately, JSDT (similar to JDT) has 2 AST models. Depending on the parser strategy chosen we may introduce a 3rd one.
- Update internal AST model
- Deprecate/remove org.eclipse.wst.jsdt.core.dom AST model.
- Introduce a new AST model (shift-ast and/or estree compliant)
- Update internal AST model but deprecate it.
- Remove org.eclipse.wst.jsdt.core.dom AST model.
- Remove anything related to validation from Parser except basic syntax validation.
- Utilize "org.eclipse.wst.sse.ui.extensions.sourcevalidation" for as-you-type validation
- Utilize "org.eclipse.wst.validation.validator" for batch validation
Principal changes comparing to the current architecture
- Rely on third-party parsers/compilers which are being actively driven by the community so we will get the latest standards (ECMA6 etc) supported in the tooling. Plus the ecosystem of extensions (jQuery, Angular, etc).